Beruflich Dokumente
Kultur Dokumente
Batches:
XML Parser
Or in IE 5 or 6
SAX Approach
String of Elements
XML Doc
<bookstore>
<book>
<title>Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
</bookstore>
It is an incremental approach
Signals the application program about the
start and end of elements
Deals with only single element at a time
Considers data to be made up of string of
elements
It concentrate just on the current and not on
the XML Document in totality
Document Object Model(DOM)
This approach treats the XML Document as
a tree like structure
Loads the entire XML document into the
memory
Compiles the XML Doc into an internal tree
Converts the elements and attributes into
nodes of the tree
XML Parser
The XML DOM contains methods (functions)
to traverse XML trees, access, insert, and
delete nodes.
However, before an XML document can be
accessed and manipulated, it must be loaded
into an XML DOM object.
An XML parser reads XML, and converts it
into an XML DOM object that can be
accessed with JavaScript.
Most browsers have a built-in XML parser.
<html>
<body>
<script type="text/javascript">
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else // for older IE 5/6
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET","books.xml",false);
xhttp.send("");
xmlDoc=xhttp.responseXML;
</script>
</body>
</html>
Name LastName
FirstName
MiddleName
Age Years
Months
Address Country
State
City
Pin
Phone Country code
Area code
Phone number