[jdom-interest] General XSL Question

Nott, Matthias mnott at vignette.com
Tue Jun 11 05:03:01 PDT 2002


Laurent,

You're the man! That was it. Makes things a lot easier
now, since the output can be more flexible.

Merci!

Matthias


-----Original Message-----
From: Laurent Bihanic [mailto:laurent.bihanic at atosorigin.com]
Sent: Tuesday, June 11, 2002 1:06 PM
To: Nott, Matthias
Cc: jdom
Subject: Re: [jdom-interest] General XSL Question



Hi,

You get this exception because you direct the output of the XSL
transformation 
to JDOM (probably using JDOMResult) which tries to build an XML document out

of it. If the output of your transformation is not well-formed XML, you
should 
use a StreamResult to collect it into a file or buffer.

Laurent

Nott, Matthias wrote:
> Y'all, 
> 
> I'm trying a relatively simple thing. An XML Document is
> transformed using an XSL Sheet which begins
> 
> <?xml version = "1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> <xsl:template match="/">
> <xsl:apply-templates/>
> </xsl:template>
> 
> and then carries on with normal transformation. All the 
> transformations work, yet I get the exception
> 
> Ill-formed XML document (multiple root elements detected)
> 
> When instead I use
> <?xml version = "1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> <xsl:template match="/">
> <html>
> <xsl:apply-templates/>
> </html>
> </xsl:template>
> 
> it works, but outputs <html> and </html> around
> my transformed content, which is not what I want,
> as I am generating some javascript and not html.
> 
> So question: is it really required to have some
> markup tag as an envelope around what is being
> generated?
> 
> Thanks
> 
> Matthias
> 



More information about the jdom-interest mailing list