Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Programmatic Alteration of Internal DTD Subset Programmatic Alteration of Internal DTD SubsetTo: NULL Date: 10/10/2008 3:57:00 PM Hi All, I have hundreds of small XML files of the form (extrabeous stuff removed): <?xml version="1.0"?> <!DOCTYPE page PUBLIC "-//LOCAL//DTD PAGE 0.1//EN" "page.dtd"> <page> <graphic boardno="entityname1" /> <graphic boardno="entityname2" /> </page> that I would like to process into this form: <?xml version="1.0"?> <!DOCTYPE page [ <!ENTITY entityname1 SYSTEM "entityname1.gif" NDATA gif> <!ENTITY entityname2 SYSTEM "entityname2.gif" NDATA gif> <!NOTATION gif SYSTEM "image/gif"> ]> <page> <graphic boardno="entityname1" /> <graphic boardno="entityname2" /> </page> That is, I'd like to load each file, find all the boardno attributes, insert an ENTITY declaration, insert a NOTATION declaration, and write the result to a file. The XML markup is unchanged, just the internal DTD is altered. Finding the boardno attributes in a DOM is trivial, but manipulating the internal DTD subset and getting it to file is eluding me. Apart from doing the DTD manipulation as a text file, any suggested tool sets/approaches. Perl, Python, Java, whatever. Regards, Chris W | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
