Re: [xml] Losing DTD reference when saving XML file



Any hint on how to keep the DTD in the XML file when saving it, please?
Thanks in advance! -Ross

On Tue, 2007-02-13 at 14:34 -0500, Ross Mohn wrote:
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


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml





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