Re: [xml] Tools to look inside a DTD allows?



* Jack Schwartz wrote:
However, it would be better if I used a tool to get this information if 
one existed.  (In my simple case, at least it would help with skipping 
comments in the DTD file, etc.)  Does such a tool or API exist in 
libxml2, lxml or somewhere else?

Well, you could use http://search.cpan.org/dist/SGML-DTDParse/ to turn a
DTD into an XML format that's easy to process, or you could use a tool
like trang http://code.google.com/p/jing-trang/ to turn the DTD into RNG
which is kinda easier to process than having to write a DTD parser that
can cope with entity madness. For that last part I use xmllint to sim-
plify http://lists.w3.org/Archives/Public/www-archive/2005Feb/0029.html

http://lists.w3.org/Archives/Public/www-archive/2011Jan/0029.html offers
something similar to what you are looking for, though it's for RELAX NG
and so it solves a more complex problem than you are trying to solve.
-- 
Björn Höhrmann · mailto:bjoern hoehrmann de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]