• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

External DTD

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am valdating XML documents against an external dtd.
My question is if I reuse the Parser instance for the second XML document after parsing/validating the first one, will the parser read from the external dtd file again? It apears so from the hsystem I/O report. Is there a way to let the parser reuse a loaded dtd? By the way, those XML documents use the same DTD.
Thanks in advance.
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am not sure if there's a way to keep a in-memory representation of the DTD so that can be reused.
Check out the interface
org.xml.sax.EntityResolver
You can give an implemenetaion for this interface and return any kind of inputsource.
Again i need to confirm if it will get called when the parser hits a <!DOCTYPE declaration.
Please let us know in case you find a solution for your problem.

Originally posted by Edy Yu:
I am valdating XML documents against an external dtd.
My question is if I reuse the Parser instance for the second XML document after parsing/validating the first one, will the parser read from the external dtd file again? It apears so from the hsystem I/O report. Is there a way to let the parser reuse a loaded dtd? By the way, those XML documents use the same DTD.
Thanks in advance.

reply
    Bookmark Topic Watch Topic
  • New Topic