Microsoft
Software
Hardware
Network
Question : XMLDOMN
I have an XML file, i can iterate thru the <field> attribute at the <row> level but i need to get to the "primary-key" attribute fo the <ROW> object.
How can i do this?
XML like this:
<?xml version="1.0" encoding="UTF-8" ?>
- <query-response>
- <data-table filter="CONTAINER_BY_GATE_
VISIT" count="3">
- <columns>
<column>Number</column>
<column>Trucking Co Id</column>
<column>Truck Visit Driver Card</column>
<column>Ctr Number</column>
<column>Status</column>
<column>Operator</column>
<column>Transaction Type</column>
<column>ISO Type</column>
<column>Chs Number</column>
<column>Next Stage ID</column>
<column>Stage ID</column>
</columns>
- <rows>
- <row primary-key="7860734">
<field>164</field>
<field>COFF</field>
<field>123078</field>
<field>IPXU3829377</field>
<field>COMPLETE</field>
<field>CSA</field>
<field>Receive Empty</field>
<field>2200</field>
<field>METZ207287</field>
<field />
<field>INSPECTION</field>
</row>
- <row primary-key="7860752">
<field>165</field>
<field>COFF</field>
<field>123078</field>
<field>TTNU1799477</field>
<field>OK</field>
<field>CSA</field>
<field>Deliver Import</field>
<field>2200</field>
<field />
<field>INSPECTOUT</field>
<field>INGATE</field>
</row>
- <row primary-key="7860406">
<field>159</field>
<field>COFF</field>
<field>123078</field>
<field>IPXU3829377</field>
<field>CANCEL</field>
<field>CSA</field>
<field>Receive Empty</field>
<field>2200</field>
<field>METZ207287</field>
<field>INSPECTION</field>
<field>INGATE</field>
</row>
</rows>
</data-table>
</query-response>
i have this code to parse it:
SET objXML2 = Server.CreateObject("Micro
soft.XMLDO
M")
objXML2.async = False
objXML2.LoadXML(xmlFile)
strXMLRctr = 0
strXMLFctr = 0
Set objRoot = objXML2.documentElement
Set objRows = objRoot.getElementsByTagNa
me("row")
For Each objRow in objRows
strXMLRctr = strXMLRctr + 1
Set objFlds = objRow.getElementsByTagNam
e("field")
response.write "----" & objRow.text & "<br>"
For Each objFld in objFlds
strXMLFctr = strXMLFctr + 1
Next
Next
Answer : XMLDOMN
Check this:
response.write "key: " & objRow.getAttribute("prima
ry-key") & " ---- " & objRow.text & "<br>"
Random Solutions
Reducing bandwidth consumption between domain controllors at multiple sites
Default time exchange deleting emails
DELL LATITUDE D610 80GIG STUCK IN BOOT LOOP
Dictionary list C#
What is the best Raid stripe size and Windows allocation unit size for large files?
Lost User Selection on XP start up screen
I have designed an website in flash as well in html, if the browser dont have flash then i want them to be directed to the html version, or else they need to directed to flash version
GroupWise 6.0.1 - Some addresses are undeliverable and have been crossed out
Winsock error in XP Professional Error 12029 Provider entry MSAFD Could not make an HTTP connection.
Mail folders->knowing what FILE is for what message