[xml] Losing DTD reference when saving XML file



Hi,
I'm working on a small app that reads in data from an xml file, makes
some changes, then I want to save the xml file again. I validate the XML
against a DTD because I want to make sure it's valid and because I want
to use ID attributes. The trouble I'm having is that all DTD references
are lost when I save the file. I've tried it with a full internal DTD
and with an external DTD reference, but the lines just are not saved.
The save functions I've tried are:
        xmlSaveFormatFile(FILENAME, doc, 1);

and:
        ctxt = xmlSaveToFilename(FILENAME, ENCODING, 1);
        ret = xmlSaveDoc(ctxt, doc);
        xmlSaveClose(ctxt);

Either way, this line is not saved in the output:
        <!DOCTYPE beeswax SYSTEM "beeswax.dtd">

I searched these mail archives but didn't turn up any clues. Ideas?

Thanks! -RPM





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