nishMaria
nishMaria

Reputation: 135

XSLT: :result-document

I have an XSL which generates a XML file

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> 
  <xsl:output method="html" indent="yes"/> 
  <xsl:template match="/"> 
    <xsl:variable name="filename" select="concat('TextTypes','.html')" />
    <xsl:result-document method="html" href="{$filename}">
      <font name="{$truncatedFont}" size="{$truncatedSize}" style="{@styleOverride}" env="{$env}" lang="{@language}" />
    </xsl:result-document>    
  </xsl:template> 
</xsl:stylesheet> 

When I run the XSLT i get the error:

ERROR:  'Unsupported XSL element 'http://www.w3.org/1999/XSL/Transform:result-document''
Error during transformation
javax.xml.transform.TransformerException: java.lang.RuntimeException: Unsupported XSL element 'http://www.w3.org/1999/XSL/Transform:result-document'

I have specified ny XSLT verision as 2.0. I am confused on why i get this error. Please help.

Upvotes: 4

Views: 7675

Answers (3)

Kevan
Kevan

Reputation: 891

It depends on how you're running your XSLT nishMaria.

If you can daisy chain XSLT then you can process the input document multiple times to produce multiple different output files or produce one output file with all the desired output then pass this file through a number of XSLT's each of which just selects part of the output.

Upvotes: 0

Martin Honnen
Martin Honnen

Reputation: 167716

XSLT 2.0 is only supported by a few XSLT processors, I think with Java there is only Saxon 9 and with IBM's websphere you can also use IBM's XSLT 2.0 processor but the XSLT processor in the Oracle respectively SUN JRE and JDK is based an Apache Xalan and only supports XSLT 1.0.

Upvotes: 4

hroptatyr
hroptatyr

Reputation: 4829

Looks like your xslt processor does not support version 2.0.

Upvotes: 0

Related Questions