• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml reserved word and well-formed

 
Avianu Sud
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is XML a reserved word, which is not allowed in element names(for well-formed xml)?
I thought it was, but XMLSpy lets me save a file with <xml/> or <xml_name/> as elements.
 
Hari Vignesh Padmanaban
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Avianu,
A good question !!
I think, what you say is right :
An elemnt name must be a Legal XML name. It must contain only letters, digits and 4 punctuation marks(":","-",".","_"). And the first charcater can be any Unicode letter, "_" or : ONLY. Also any combination of xml would not be allowed also !!!
I think the XMLSpy parser does not check for this validity constraint
But the question here is :
THEY SHOULD NOT BE USED or THEY CANNOT BE USED ?
I am not rellay sure , I think as far as XMLSpy is considered, They should not be used
Any people with indepth knowledge of XML, please do clarify !!!
 
v giri
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quote from page 2 Essential XML by Skonnard:
Element names that begin with character sequence xml or any recapitalization thereof are reserved by the XML specification for future use.
best wishes
 
Hari Vignesh Padmanaban
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
xmlSpy allows you to save an element beginning with "xml" as this is not an ERROR or a FATAL ERROR. It is considered to be a warning!!!
---------------------------------------------------------------------"Parsers may or may not detect these type of problems. If a parser does detect one, it will not throw an exception, but will continue parsing"
-- Elliote.R.harold - Processing XML with Java.
---------------------------------------------------------------------
The use of "xml" as starting of an elemnts is reserved by W3C. most of teh parsers allow you to name an elemnt starting with "xml" for teh above reason .
But it is always better to avoid doing that and stick with the specifications!!!:-)
Hari
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic