Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Programmatic Alteration of Internal DTD Subset >Thread Next - Re: Programmatic Alteration of Internal DTD Subset Re: Programmatic Alteration of Internal DTD SubsetTo: NULL Date: 10/11/2008 9:30:00 AM I explored the similar issue some time back. You could look at my findings at, http://gandhimukul.tripod.com/xml/xml.html Please see, item no, 6. Regards, Mukul On Oct 10, 10:56=A0am, Chris W <chrisw_j...@yahoo.com.au> wrote: > Hi All, > > I have hundreds of small XML files of the form (extrabeous stuff removed)= : > > <?xml version=3D"1.0"?> > <!DOCTYPE page PUBLIC "-//LOCAL//DTD PAGE 0.1//EN" "page.dtd"> > <page> > =A0 <graphic boardno=3D"entityname1" /> > =A0 <graphic boardno=3D"entityname2" /> > </page> > > that I would like to process into this form: > > <?xml version=3D"1.0"?> > <!DOCTYPE page [ > =A0 =A0 =A0 =A0 <!ENTITY =A0entityname1 SYSTEM "entityname1.gif" NDATA gi= f> > =A0 =A0 =A0 =A0 <!ENTITY =A0entityname2 SYSTEM "entityname2.gif" NDATA gi= f> > =A0 =A0 =A0 =A0 <!NOTATION gif SYSTEM "image/gif"> > ]> > <page> > =A0 <graphic boardno=3D"entityname1" /> > =A0 <graphic boardno=3D"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. =A0The XML markup is unchanged, just the internal > DTD is altered. =A0Finding the boardno attributes in a DOM is trivial, bu= t > 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. =A0Perl, Python, Java, whatever. > > Regards, > Chris W | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
