•
•
•
•
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 456,515 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,741 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.
Please support our RSS, Web Services and SOAP advertiser: Programming Forums
Views: 1280 | Replies: 2 | Solved
![]() |
| |
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,
Could the above also be done and have the same meaning as:
Or more to the point, like this:
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.
(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,
xml Syntax (Toggle Plain Text)
<A> <X name="one" /> <X name="two" /> <X name="three" /> </A> <B> <X name="red" /> <X name="green" /> <X name="blue" /> </B>
xml Syntax (Toggle Plain Text)
<A> <X name="one" /> </A> <B> <X name="red" /> <X name="green" /> </B> <A> <X name="two" /> <X name="three" /> </A> <B> <X name="blue" /> </B>
xml Syntax (Toggle Plain Text)
<A> <X name="one" /> </A> <A> <X name="two" /> </A> <B> <X name="red" /> </B> <B> <X name="green" /> </B> <A> <X name="three" /> </A> <B> <X name="blue" /> </B>
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 12:54 pm.
•
•
Join Date: Jul 2006
Location: Deptford, London
Posts: 971
Reputation:
Rep Power: 5
Solved Threads: 48
The first and second and third documents are equivalent; only in terms of the hierachal relationship between nodes. They are not by any means equal, and depending on the actual XML language they belong to, might not be considered equivalent semantically; nor are they necessarily equivalent in terms of hierachy if nodes are considered instances of something as opposed to types of something. That is, you might be saying, in the first case, that the X's in A are constituent parts of some single 'definition' of A, whereas in the second case, you might be saying that each X within an A or B is a unique X 'instance' within some unique A or B 'instance'. It depends on the XML language or representation, but in most XML languages I've used, the treatment of nodes is as instances, and the order of nodes that are in a 'sibling level' sequence is considered to some degree; so, the first, second and third examples would certainly not be considered equivelant on any meaningful level in a language like say, XHTML or XSLT.
In short, if you're authoring the XML dialect, it's up to you; it's merely a design decision. If you're working within the bounds of an existing dialect, you have to consult the specification of the dialect, because there's no way you can assume any level of equivalence.
In short, if you're authoring the XML dialect, it's up to you; it's merely a design decision. If you're working within the bounds of an existing dialect, you have to consult the specification of the dialect, because there's no way you can assume any level of equivalence.
Plato forgot the nullahedron..
![]() |
•
•
•
•
•
•
•
•
DaniWeb RSS, Web Services and SOAP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- XML Transforming Help (XML, XSLT and XPATH)
- My Turbo Archive...will it help? (Search Engine Optimization)
- Something showling my system down (hijackthis log incl) (Viruses, Spyware and other Nasties)
- Pass XML file contents to a hash table. (Java)
- ASP.NET <--> XML <--> VB6.0 (ASP.NET)
- help required for implementing project using JAVA & XML (Java)
- searches appearing as .xml files in windows folder (Windows NT / 2000 / XP / 2003)
- Php parser error when xml version is mentioned (PHP)
Other Threads in the RSS, Web Services and SOAP Forum
- Previous Thread: XML Schema Question
- Next Thread: XML with PHP?



Hybrid Mode