File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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: 1010
    
    3
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to have a space in XML Element Name