[jdom-interest] XSL transformations and missing doctypes

Per Norrman per.norrman at austers.se
Wed Aug 25 00:19:59 PDT 2004


Hi,

Are you specifying the doctype using the xsl:ouput element? In that
case, note that the xsl:output element is only applicable when
the XSLT processor is generating XML from the result tree.

Since you are transforming into xhtml, you can easily set
the doctype after the transformation is completed.

/pmn

Lee Turner wrote:

> Hi
> 
> I am using JDOM b10 in my system where I am using xsl to transform my JDOM
> documents into xhtml to be displayed on the front end.  My problem is that
> when the transformation has been done I am missing the doctype that I set in
> the xsl.  The code I am using is as follows :
> 
>         //snip
>         Transformer transformer = template.newTransformer();
>         JDOMSource source = new JDOMSource(incomingDocument);
>         JDOMResult result = new JDOMResult();
>         transformer.transform(source, result);
>         return result.getDocument();
> 
> I have taken my xsl and tried that outside of JDOM, using static xml instead
> and the doctype is there in the output and I have even just used the
> javax.xml classes to do the transform DOMSource and StreamResult etc
> and the doctype is in the output here as well.
> 
> I have looked on the web and news groups and there seem to be a few
> references to missing doctypes, but I couldn't find anything to say whether
> it has been fixed in the latest CVS of JDOM.  I downloaded the daily
> snapshot from the JDOM web site and still saw the same behaviour.
> 
> Has anyone else seen this when performing transformations using JDOM  ?
> Any help would be greatly appreciated.
> 
> Kind regards
> Lee
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
> 



More information about the jdom-interest mailing list