User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 402,035 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,443 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.

XML Sections(?)

Join Date: Apr 2004
Posts: 3,473
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 16
Solved Threads: 138
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

XML Sections(?)

  #1  
Oct 4th, 2007
I don't know the correct term to use in the title. It's been ages since I've messed with XML, and I don't use it in any professional way, nor am I headed that direction.

(Before during and after this question, I will be searching http://www.w3.org and other sites.)

My question is this: can you have multiple sections of the same name? For example,
  1. <A>
  2. <X name="one" />
  3. <X name="two" />
  4. <X name="three" />
  5. </A>
  6. <B>
  7. <X name="red" />
  8. <X name="green" />
  9. <X name="blue" />
  10. </B>
Could the above also be done and have the same meaning as:
  1. <A>
  2. <X name="one" />
  3. </A>
  4. <B>
  5. <X name="red" />
  6. <X name="green" />
  7. </B>
  8. <A>
  9. <X name="two" />
  10. <X name="three" />
  11. </A>
  12. <B>
  13. <X name="blue" />
  14. </B>
Or more to the point, like this:
  1. <A> <X name="one" /> </A>
  2. <A> <X name="two" /> </A>
  3. <B> <X name="red" /> </B>
  4. <B> <X name="green" /> </B>
  5. <A> <X name="three" /> </A>
  6. <B> <X name="blue" /> </B>
I hope this poorly-worded question conveys the general idea. Perhaps I will be able to better word this later.

For those inquiring minds who want to ask, "Why?" my answer is this: I am trying to automate a documentation-to-code process; given a map file sucked into Excel and processed in Excel to correlate items, and then use Excel to output text containing XML-formatted fields. The "group" (A and B in my example) containing an "item" (X in the example) are not necessarily hierarchically display/processed.

Thank you for your attention and any assistance you provide.

[edit]Ah, I believe http://www.w3schools.com/xml/default.asp was where I was trying to find earlier.

This leads me to believe my answer is, "Yes, you can do this." And I believe the term in the title ought to be Child Elements rather than Sections.
Last edited by Dave Sinkula : Oct 4th, 2007 at 11:54 am.
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 10:48 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC