Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Database
XML
looping through a collection of elements
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="yea420, post: 5721, member: 2306"] Hi everyone, and thanks in advance for your help. I'm pulling apart an xml document that's spit out by framemaker to make a new xml document. So what I have to do is loop through all the elements off the root and then go through a case structure (or something similiar) to logically define what to do with each element. Here is a simplified version of the xml: <xml> <title></title> <title><page-number>This is the title</page-number> </title> <chapter><A id="no idea what this even is></A>Chapter 232</chapter> <paragraph>This is a paragraph</paragraph> <paragraph>This is another paragraph</paragraph> <paragraph>And still more paragraphs</paragraph> </xml> Ok, after searchin examples over the old net I thought this would be easy. Unfortunately every time I try looping through nodes and such I get out put I'm not expecting. Here's the pseudo for what I want to do Get all elements below /xml Do while element Select Case element Case "title" If not element is empty lookup the page-number End If Case "chapter" get rid of <A> element Case "paragraph" get paragraph text End select End While So I'm not to concerned about the case statement but if someone can poin me in the right direction ro running through each element at a specific level, right under /xml, well,,, it would make my day :) [/QUOTE]
Insert quotes…
Verification
Post reply
Database
XML
looping through a collection of elements
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom