This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Need to have a space in XML Element Name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Need to have a space in XML Element Name" Watch "Need to have a space in XML Element Name" New topic
Author

Need to have a space in XML Element Name

Amit Siinngghh
Greenhorn

Joined: Jun 19, 2004
Posts: 12
Hello All,

Can we have a space in XML element name.

like

<Name>
<Some name/>
<Name>

is there a way to specify a space in XML name I tried   but then the xml is not wellformed.

any insights into it

thanks
Amit
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1024
    
    4
No.

If you look at the XML 1.1 spec, starting at definition number [39] and follow all the sub definitions, sub sub definitions, etc. You'll see that you can't put a space in a tag name. You can't even get clever and call "Some" the tag name and "name" an attribute with no value (like some HTML things <INPUT CHECKED/> because every attribute needs an assigned value. The best you might get is <Some name=""/>.

Ryan
[ May 26, 2005: Message edited by: Ryan McGuire ]
Amit Siinngghh
Greenhorn

Joined: Jun 19, 2004
Posts: 12
Thanks for clearing it up,


Amit
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Need to have a space in XML Element Name