You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Steve Buroff <sj...@lucent.com> on 2000/08/07 21:20:11 UTC

Getting DTD in an output XML file

I have an application where the DTD is distributed. Most of it is in
a separate file but there is some in the DOCTYPE declaration of
the XML file. My problem is in writing out a modified version of the
XML file. I use the OutputFormat.setDoctype() method and this
does give me the DOCTYPE declaration with the correct SYSTEM
value. However, I can't figure out how to get the rest of the DTD, the
part that was in the DOCTYPE declaration in the input XML file,
into the output file.

I'm using xerces 1.1.3 and DOM. Any suggestions would be appreciated.
TIA.

Steve Buroff

Re: Getting DTD in an output XML file

Posted by Arundhati Bhowmick <ar...@hyperreal.org>.
Xerces 1.2.0 version has the dctype features. Using this version you can
create a doctype, using this doctype create the document and set in the
parser before parsing. All the DTD information will be part of your
DOMTree. You can try in the current DOMPrint sample.
Arundhati

Steve Buroff wrote:

> I have an application where the DTD is distributed. Most of it is ina
> separate file but there is some in the DOCTYPE declaration ofthe XML
> file. My problem is in writing out a modified version of theXML file.
> I use the OutputFormat.setDoctype() method and thisdoes give me the
> DOCTYPE declaration with the correct SYSTEMvalue. However, I can't
> figure out how to get the rest of the DTD, thepart that was in the
> DOCTYPE declaration in the input XML file,into the output file. I'm
> using xerces 1.1.3 and DOM. Any suggestions would be appreciated.TIA.
> Steve Buroff

--


Arundhati Bhowmick
IBM -- XML Technology Group (Silicon Valley)