Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

2 XML and 2 DTD

 
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an XML file which has a DTD of its own. Within this XML file an ENTITY is declared which references another XML file which also has a DTD.
Now when I try to open the first XML file it gives an error that 2 DTDs can't exist.
What should I do?
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normal!
You ask to your XML parser to validate the XML document with DTDs but the URL of DTDs should be not accessible by the parser.
2 choices:
-not validate the XML data (a parser option) , the XML data is just well formed
-be able to make the DTDs accessible by the parser with a HTTP server (like http://www.w3.org/XML/1998/06/xmlspec-v21.dtd) or with the file system ( like ./myDTDs/DTD1.dtd ) but with this way you need to be careful of the real location of the file.
Don't forget that the future is XML Shema ... if U could , use shema . It is more complicated but type-checked.
------------------
---------
Guillaume
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!