Microsoft XML parser is a COM component that comes with Internet Explorer 5 and higher. Once you have installed Internet Explorer, the parser is available to scripts.
Microsoft' s XML parser supports ll the necessary functions to traverse the node tree, access the nodes and their attribute values, insert and delete nodes, and convert the node tree back to XML.
The following table lists the most commonly used node types supported by Microsoft' s XML parser:
<table border="1 " bgcolor="yello" height="500px" width="100"%>
<tr align="center">
<td>
Node Type
</td>
<td>
Processing instruction
</td>
<td>
Element
</td>
<td>
Attribute
</td>
<td>
Text
</td>
</tr>
<tr align="center">
<td>
Example
</td>
<td>
<?xml version = "1.0"?>
</td>
<td>
<drink type = "beer"> Carlsberg</drink>
</td>
<td>
type = "beer"
</td>
<td>
Carlsberg
</td>
</tr>
<tr>
MSXML Parser 2.5 is the XML parser that is shipped with Windows 2000 and IE 5.5.
MSXML Parser 3.0 is the XML parser that is shipped with IE 6.0 and Windows XP.
The MSXML 3.0 parser features:
1) Javascript, VBScript, Perl, VB, Java, C++, etc. support
2) Complete XML support
3) Full DOM and NameSpace support
4) DTD and validation
5) Complete XSLT and XPath support
6) SAX2 support
7) Server-safe HTTP
To create and instance of Microsoft' s XML parser with JavaScript, use the following code:
var xmlDoc=new ActiveXobject("Microsoft.XMLDOM")
To create an instance of Microsoft' s XML parser with VBScript , use the following code:
var xmlDoc=CreateObject("Microsoft.XMLDOM")
To create an instance of Microsoft's XML parser in an ASP page (using VBScript), use the following code:
set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
The following code loads an existing XML document ("note.xml") into Microsoft's XML parser:
<script type="text/javascript">
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("note.xml")
...
...
...
</script>
0 comments:
Post a Comment