Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

xml reserved word and well-formed

 
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.
 
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 !!!
 
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
 
Nothing? Or something? Like this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic