Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml file does not conform to dtd

 
Barry Andrews
Ranch Hand
Posts: 523
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am new to xml and I am wondering about something. I thought that if I had a #REQUIRED Qualifier in the dtd, then the attribute would be required in the xml. But in the code I have here, notice that the idTo attribute for <TO> is required in the dtd, but I do not have it in the xml. When I display the xml in Internet Explorer, it does not show errors. Does anyone know why this is? Am I misunderstanding something or what? Many thanks to you!!
Barry

Here is the xml file:

And here is the dtd:
 
L Goundalkar
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Barry..
There is nothing wrong with your understanding or with IE. By default the parser within IE is set NOT TO VALIDATE the xml file agaist DTD.
Just try the following html with script to check your xml file.

Also refer this for confirmation
http://www.biglist.com/lists/xsl-list/archives/199903/msg00487.html
Cheers

------------------
L Goundalkar
lggoundalkar@hotmail.com
Sun Certified Programmer for Java 2 Platform
 
arul senthil
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Goundalkar
The parser has not yet been set for validation!!! The line 6 should read xmlDoc.validateOnParse="true". Otherwise it's ok.
Thanks for the answer,
Regards,
Senthil
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic