Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaRanch XML mock exam errata

 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Murali Mohan pointed that an answer to question 10 of �core XML� exam is incorrect. He tried this XML document and did not get an error message.
<?xml version="1.0" encoding="UTF-8"?>
<company>
<Sevenhills>10th floor</Sevenhills>
<Microsoft>5Th flooor</Microsoft>
<myXMLcompany>myXMLcompany</myXMLcompany>
<XMLcompany i="xml">XMLcompany</XMLcompany>
<xml>hai</xml>
</company>
I also checked the document above and neither IE (which is not a big surprise) nor Xalan (which is a bigger surprise) complained.
W3C XML specification said:
"Names beginning with the string "xml", or any string which would match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization in this or future versions of this specification." http://www.w3.org/TR/2000/REC-xml-20001006#sec-common-syn
Perhaps that means that currently W3C compliant software is not required to report a well-formedness violation. However, if later versions of XML specification will use names starting with "XML" string, then XML documents misusing such names for their own proposals will cause a collision.
Any other ideas?
Thanks, Murali!
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Map, your reasoning is absolutely correct.
Since XML is an evolving standard, they have reserved names beginning with 'xml' for future versions. They may or give them a special meaning. For now, parsers and applications may chose not to report any errors if such elements are found in the document.
Having that said, XML authors should be aware of this fact. It is in their best interest to avoid using any reserved constructs simply because it might cause toomuch of a problem to cleanup if they indeed become reserved as a result of future standardization efforts.
Hope that helps!
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

IMHO, currently we SHOULD NOT expect any violations/errors
when strings matiching (any flavor of) "xml" are used, since
nothing of this sort is mentioned in the specs.
As Ajith said, we should use it as a guideline and avoid
it so that in future we may not have any problems.
regds.
- satya
 
Tiger Scott
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another thing I had noticed was with Sanjay M exam Q1.
I thinkd. <ELEMNT test ( this,that)* > is valid code. But the answer indicates it is wrong. He has not given any explanation of course.
Sanjay
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That may be my mistake when I put it online. Can anybody try this DTD? I do not have any validating tools right now...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic