•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 391,692 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 3,210 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 XML, XSLT and XPATH advertiser:
Views: 1036 | Replies: 1
![]() |
•
•
Join Date: Jan 2008
Location: USA East Cost
Posts: 386
Reputation:
Rep Power: 1
Solved Threads: 37
Hey, I'm attempting to write an XML parser in C++, and I have some questions on some XML syntax. First: what is the rule for what goes between the end of the last attribute and the end of a tag? E.g.:
is this ok:
is this ok:
and this:
and this:
Which of those are ok and which are not (if any)?
Second, can there be whitespace between the attribute name and the equal sign and the equal sign and the attribute value: (atr="value", atr = "value",atr ="value", or atr= "value")?
That's it for now, but I might have a couple more questions later.
is this ok:
<tag attribute="value" > ?is this ok:
<tag attribute="value"> ?and this:
<tag attribute="value" /> ?and this:
<tag attribute="value"/> ?Which of those are ok and which are not (if any)?
Second, can there be whitespace between the attribute name and the equal sign and the equal sign and the attribute value: (atr="value", atr = "value",atr ="value", or atr= "value")?
That's it for now, but I might have a couple more questions later.
I'm a student. If my statements seem too absolute, feel free to coat them with "In my opinion..." or "I believe...".
>Which of those are ok and which are not (if any)?
They're all valid XML. The extra space in an empty element is a style guideline in XHTML for compatibility reasons, but that has to do with conforming applications and not the requirements of a parser.
>can there be whitespace between the attribute name and
>the equal sign and the equal sign and the attribute value
I think this will be the least of your problems, but yes, whitespace between markup elements is allowed. The big issue is figuring out where whitespace is significant, and the XML specification will tell you that in painful detail.
They're all valid XML. The extra space in an empty element is a style guideline in XHTML for compatibility reasons, but that has to do with conforming applications and not the requirements of a parser.
>can there be whitespace between the attribute name and
>the equal sign and the equal sign and the attribute value
I think this will be the least of your problems, but yes, whitespace between markup elements is allowed. The big issue is figuring out where whitespace is significant, and the XML specification will tell you that in painful detail.
Member of: Beautiful Code Club.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb XML, XSLT and XPATH Marketplace
- Previous Thread: XSLT Nested For-Each Loop
- Next Thread: Is it possible to exclude leaf nodes dynamically using XPATH?



Linear Mode