Hi, I need to capture the value of an attribute in the XML file.
For example, the XML file contains:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<Clients>
<Client>
<ClientId>P9990000000041</ClientId>
<Speciality Speciality="1">Computer science</Speciality>
<MaritalSta MaritalSta="2">Single</MaritalSta>
<AprobDate />
<BirthDate>1960-01-01</BirthDate>
...
</Client>
</Clients>
I need to capture the value "1" of the "Speciality" attribute.
Which is the best way to do it?
Some part of my ASP source code is:
Dim oXMLdoc
Dim AtriXML
Set oXMLdoc = Server.CreateObject("Microsoft.XMLDOM"
oXMLdoc.async = False
oXMLdoc.Load(Server.MapPath("Files/ClientData.xml")
Set currNode = oXMLdoc.documentElement
For i = 0 To currNode.childNodes.length - 1
If currNode.hasChildNodes Then
For j = 0 To currNode.childNodes.Item(i).childNodes.length - 1
Response.Write(currNode.childNodes.Item(i).childNodes.Item(j).nodeName & ": "
Response.Write(currNode.childNodes.Item(i).childNodes.Item(j).nodeTypedValue)
Set AtriXML = currNode.Attributes.item(1) ' Is it good???
Set VarValue = AtriXML.NodeValue ' Is it good???
For example, the XML file contains:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<Clients>
<Client>
<ClientId>P9990000000041</ClientId>
<Speciality Speciality="1">Computer science</Speciality>
<MaritalSta MaritalSta="2">Single</MaritalSta>
<AprobDate />
<BirthDate>1960-01-01</BirthDate>
...
</Client>
</Clients>
I need to capture the value "1" of the "Speciality" attribute.
Which is the best way to do it?
Some part of my ASP source code is:
Dim oXMLdoc
Dim AtriXML
Set oXMLdoc = Server.CreateObject("Microsoft.XMLDOM"
oXMLdoc.async = False
oXMLdoc.Load(Server.MapPath("Files/ClientData.xml")
Set currNode = oXMLdoc.documentElement
For i = 0 To currNode.childNodes.length - 1
If currNode.hasChildNodes Then
For j = 0 To currNode.childNodes.Item(i).childNodes.length - 1
Response.Write(currNode.childNodes.Item(i).childNodes.Item(j).nodeName & ": "
Response.Write(currNode.childNodes.Item(i).childNodes.Item(j).nodeTypedValue)
Set AtriXML = currNode.Attributes.item(1) ' Is it good???
Set VarValue = AtriXML.NodeValue ' Is it good???