This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.

 
Or we might never have existed at all. Freaky. So we should cherish everything. Even this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic