[jdom-interest] JDOMResult

Matt Preston matthew at knowledgeview.co.uk
Tue Feb 26 09:26:53 PST 2002


Hi all,

I have been using the JDOMResult for some transformations where I need a
JDOM Document at the end, but have run into a problem.  It seems that the
Document produced never has a DocType set, even if my xsl stylesheet creates
one.

e.g. I created a doctype with this xsl

<xsl:output indent="yes" method="xml" encoding="UTF-8"
doctype-public="-//IPTC//NITF DTD 2.0//EN"
doctype-system="http://www.nitf.org/site/nitf-documentation/nitf-2-5-no-comm
ents.dtd"/>

I used this code to do the transformation

  JDOMResult _result = new JDOMResult();

  StreamSource _source = new StreamSource(anInputStream);

  _transformer.transform(_source, _result);

  Document _document = _result.getDocument();

_document.getDocType() returns null.  If rather than using JDOMResult, I use
a StreamResult and make the Document via a SAXBuilder, the Document has the
correct DocType.

Has anyone else experienced this?

Cheers,
Matt Preston


---
Not dirty!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/2002





More information about the jdom-interest mailing list