I am using an ASP page to accept job posts to my site and I'm having a devil of a time retrieving values from the XML. Could someone help me with some sample code to get the values of: The "UserID" then iterate through each "Job" and get the values of the property "Action", get the "JobTitle" then "ContactName"? Here is the XML: <jobs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <userid>5555555</userid> <job action="ADD"> <jobtitle></jobtitle> <jobcontactinformation> <contactname></contactname> </jobcontactinformation> </job> <job action="DELETE"> <jobtitle></jobtitle> <jobcontactinformation> <contactname></contactname> </jobcontactinformation> </job> </jobs>Thanks! |
XML is case-sensitive. The tag "Job" is not the same as "job". This is not a Chilkat-imposed thing -- it is the XML standard. |
I just did this as a little VBS script to test but here is what I have so far looking at the documentation and samples but then I get lost. Any help would be appreciated: set xml = CreateObject("Chilkat_9_5_0.Xml") success = xml.LoadXmlFile("C:Chilkatgood.xml") If (success <> 1) Then MsgBox "Load Failure" Else MsgBox "Load Success" End If numWithTag = xml.NumChildrenHavingTag("Job") MsgBox numWithTag If (numWithTag > 0) Then
End If set xml = Nothing |
Hmmmmm. That was strange that that happened. The XML that I copied from had the uppercase "Job" vs. "job". Something happened in the paste... Anyway, yes, it should be xml.NumChildrenHavingTag("job") in this case. Any idea how I: Get "userid" then iterate through each "job" and get the values of the property "action", get the "jobtitle" then "contactname"? Thanks! |
This should help |