aspose file tools*
The moose likes XML and Related Technologies and the fly likes xml id Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml id" Watch "xml id" New topic

xml id

kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 56
can i create a xml document without id?

is this correct?

<?xml version="1.0"?>
<cookies> <- root
<rmbme> <-name
<id>asdasd</id> <-element
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

You can have an element named "id" if you like. There are very few restrictions on elements names in XML, the main one being that they can't start with the string "xml". And you can have documents which don't contain any elements named "id" as well. If you've ever seen any other XML documents then chances are that you have seen a document without any such element.
It is sorta covered in the JavaRanch Style Guide.
subject: xml id