• 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

Pre-processing DTD to remove ENTITY's

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a DTD with lots of ENTITY's, and want to explore the possible performance improvement during validation parsing by getting rid of them.
Does anyone have a tool or a technique for pre-processing a DTD, yielding a new DTD without the ENTITY's?
Ron
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you just want to remove the entities, or transform them to something else?. Just to remove them is a job for something like a simple sed script, but is that a wise move? Presumably they are in the data for a reason.
 
Ron Olson
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank,
The preprocessor must create a DTD that is *exactly* equivalent to the original DTD.
For example, a DTD that contained this
<!ENTITY % NAME "(FirstName, LastName)">
<!ELEMENT Mom (%NAME ;) >
<!ELEMENT Dad (%NAME ;) >
would instead contain this
<!ELEMENT Mom (FirstName, LastName) >
<!ELEMENT Dad (FirstName, LastName) >
So, just like #define does its work in a C preprocessor and then disappears, the ENTITY definition would do it's thing in a DTD preprocessor and then disappear. Of course, in the DTD case preprocessing would just be a one time deal - done only if the master DTD changed.
Ron
[This message has been edited by Ron Olson (edited March 15, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!