I hope someone can help me with this as I've been scratchiing my head all day about it. I have an XML document loaded into a webpage and using ASP I am trying to extract the data from it. This goes well (if somewhat clumsily) until I reach the "RepairLines" section. I am trying to retrieve the data from within each "RepairLine" but am failing miserably.
The XML document looks like this
<ContainerData>
<JobType>Authorised</JobType>
<DepotCode>FLX</DepotCode>
<ContainerNo>TXLU8393021</ContainerNo>
<RecordNo>1</RecordNo>
<Client>BLU</Client>
<Model>MODEL1</Model>
<Size>20</Size>
<Type>REF</Type>
<ISOCODE>Test1</ISOCODE>
<SerialNumber>2300</SerialNumber>
<Manufacturer>sss</Manufacturer>
<CleanOnly>Y</CleanOnly>
<SMV></SMV>
<SSV></SSV>
<Sound-Indicator>N</Sound-Indicator>
<ACEP></ACEP>
<Warranty>Y</Warranty>
<Remarks>asdasdasdasdasdsdsaddasdasdasd</Remarks>
<SendEst>False</SendEst>
<EstimateDate>13-01-06-04-52-04</EstimateDate>
<RepairLines>
<RepairLine code="1">
<Location>BR4N</Location>
<Component>BCD</Component>
<Damage>BK</Damage>
<Repair>PC</Repair>
<Material>PM</Material>
<Length>12</Length>
<Width>10</Width>
<Quantity>1</Quantity>
<PartNumber></PartNumber>
<LabourHour>12</LabourHour>
<MaterialCost>2</MaterialCost>
<RepairComplete>N</RepairComplete>
</RepairLine>
<RepairLine code="2">
<Location>D</Location>
<Component>SGL</Component>
<Damage>CO</Damage>
<Repair></Repair>
<Material>PM</Material>
<Length>100</Length>
<Width>20</Width>
<Quantity>2</Quantity>
<PartNumber>14-00220-00</PartNumber>
<LabourHour>2</LabourHour>
<MaterialCost>2</MaterialCost>
<RepairComplete>False</RepairComplete>
</RepairLine>
</RepairLines>
I need to get the Location, Component, Damage etc. as individual items from the RepairLine but can only manage to get them in a string
The piece of code is
Set ObjNodes = objXMLdoc.documentElement.childnodes
for each strnode in objnodes
fname = strnode.NodeName
fdata = strnode.xml
if fname = "RepairLines" then
repcount = 0
set replist = objXMLdoc.getElementsByTagName("RepairLine")
for repcount = 0 to replist.length-1
response.Write("item " & replist.item(repcount).text & "<br>")
next
This gives me "item BR4N BCD BK PC PM 12 10 1 12 2 N" and "item D SGL CO PM 100 20 2 14-00220-00 2 2 False"
As you can probably tell I am new to processesing XML and flying by the seat of my pants at the moment.
Thanks in anticipation for any help/pointers you gurus can give.
The XML document looks like this
<ContainerData>
<JobType>Authorised</JobType>
<DepotCode>FLX</DepotCode>
<ContainerNo>TXLU8393021</ContainerNo>
<RecordNo>1</RecordNo>
<Client>BLU</Client>
<Model>MODEL1</Model>
<Size>20</Size>
<Type>REF</Type>
<ISOCODE>Test1</ISOCODE>
<SerialNumber>2300</SerialNumber>
<Manufacturer>sss</Manufacturer>
<CleanOnly>Y</CleanOnly>
<SMV></SMV>
<SSV></SSV>
<Sound-Indicator>N</Sound-Indicator>
<ACEP></ACEP>
<Warranty>Y</Warranty>
<Remarks>asdasdasdasdasdsdsaddasdasdasd</Remarks>
<SendEst>False</SendEst>
<EstimateDate>13-01-06-04-52-04</EstimateDate>
<RepairLines>
<RepairLine code="1">
<Location>BR4N</Location>
<Component>BCD</Component>
<Damage>BK</Damage>
<Repair>PC</Repair>
<Material>PM</Material>
<Length>12</Length>
<Width>10</Width>
<Quantity>1</Quantity>
<PartNumber></PartNumber>
<LabourHour>12</LabourHour>
<MaterialCost>2</MaterialCost>
<RepairComplete>N</RepairComplete>
</RepairLine>
<RepairLine code="2">
<Location>D</Location>
<Component>SGL</Component>
<Damage>CO</Damage>
<Repair></Repair>
<Material>PM</Material>
<Length>100</Length>
<Width>20</Width>
<Quantity>2</Quantity>
<PartNumber>14-00220-00</PartNumber>
<LabourHour>2</LabourHour>
<MaterialCost>2</MaterialCost>
<RepairComplete>False</RepairComplete>
</RepairLine>
</RepairLines>
I need to get the Location, Component, Damage etc. as individual items from the RepairLine but can only manage to get them in a string
The piece of code is
Set ObjNodes = objXMLdoc.documentElement.childnodes
for each strnode in objnodes
fname = strnode.NodeName
fdata = strnode.xml
if fname = "RepairLines" then
repcount = 0
set replist = objXMLdoc.getElementsByTagName("RepairLine")
for repcount = 0 to replist.length-1
response.Write("item " & replist.item(repcount).text & "<br>")
next
This gives me "item BR4N BCD BK PC PM 12 10 1 12 2 N" and "item D SGL CO PM 100 20 2 14-00220-00 2 2 False"
As you can probably tell I am new to processesing XML and flying by the seat of my pants at the moment.
Thanks in anticipation for any help/pointers you gurus can give.