login about faq

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!

asked Sep 20 '14 at 14:18

mcgarry's gravatar image

mcgarry
112


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.

link

answered Sep 22 '14 at 09:29

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

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

For i = 0 To numWithTag - 1

Next

End If

set xml = Nothing

link

answered Sep 20 '14 at 16:39

mcgarry's gravatar image

mcgarry
112

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!

link

answered Sep 22 '14 at 14:38

mcgarry's gravatar image

mcgarry
112

link

answered Sep 25 '14 at 11:53

CDS's gravatar image

CDS
169912

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×59
×5

Asked: Sep 20 '14 at 14:18

Seen: 1,196 times

Last updated: Sep 25 '14 at 11:53

powered by OSQA