Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting xml file

Status
Not open for further replies.

baran121

Programmer
Sep 8, 2005
337
TR
hi i have a problem after getting data from xml.

there is two example as attact which i use for my software, first one i get data completely. second one is i can get some data not all.

first XML file
second XML file

could you help me please?

main code to get data from xml ;

Set oparser = CreateObject("msxml2.domdocument")
bRet = oparser.loadXML(str_xml)

If bRet Then
Set celem1 = oparser.documentElement.selectNodes("//DueDate")
Set celem2 = oparser.documentElement.selectNodes("//Chassis")
Set celem3 = oparser.documentElement.selectNodes("//PartNumber")
Set celem4 = oparser.documentElement.selectNodes("//PartDescription")
Set celem5 = oparser.documentElement.selectNodes("//Quantity")
Set celem6 = oparser.documentElement.selectNodes("//VehicleCode")
Set celem7 = oparser.documentElement.selectNodes("//PartNote")
Set celem8 = oparser.documentElement.selectNodes("//Note")
Set celem9 = oparser.documentElement.selectNodes("//ShipTo")
Set celem10 = oparser.documentElement.selectNodes("//Plan")


For i = 0 To celem1.Length - 1


next
 
Hi there!

1.) Many of us have IT restrictions that don't allow the download of such attachments. Please post some relative portions of the respective XML

2.) Specify which data of the second file you're getting and which not

3.) you're missing and End If

4.) What would you like to do within your For loop?

5.) Are your celem dimmed as IXMLNode or as IXMLElement?

Cheers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
hi there i solved problem :)
there is the code

Set celemi1 = oparser.documentElement.selectNodes("//DueDate")
Set celemi2 = oparser.documentElement.selectNodes("//Chassis")
Set celemi3 = oparser.documentElement.selectNodes("//VehicleCode")
Set celemi4 = oparser.documentElement.selectNodes("//Note")
Set celemi5 = oparser.documentElement.selectNodes("//ShipTo")

Set celemj1 = oparser.documentElement.selectNodes("//PartNumber")
Set celemj2 = oparser.documentElement.selectNodes("//PartDescription")
Set celemj3 = oparser.documentElement.selectNodes("//Quantity")
Set celemj4 = oparser.documentElement.selectNodes("//PartNote")

For i = 0 To celemi2.Length - 1 'xxxxxx
For j = 0 To celemj1.Length - 1 'yyyyyy

next
next

Set celemi1 = Nothing
Set celemi2 = Nothing
Set celemi3 = Nothing
Set celemi4 = Nothing
Set celemi5 = Nothing

Set celemj1 = Nothing
Set celemj2 = Nothing
Set celemj3 = Nothing
Set celemj4 = Nothing

End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top