Project

Profile

Help

Attribute value template w/ xsl:output attrs?

Added by Anonymous over 18 years ago

Legacy ID: #3359067 Legacy Poster: Gretchen Moran (gmoran-pentaho)

Hello, I'm hoping I can get some help with functionality that I presume is supported in saxon 8.5. I want to use an attribute value template to retrieve the value for the encoding attribute on the xsl:output element. Everything I have read about XSLT 2.0 and saxon says I should be able to do this. Am I missing something basic?? Here is the start of my XSLT file : <xsl:stylesheet version="2.0" xmlns:xhtml="http://www.w3.org/2002/06/xhtml2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:include href="system/custom/xsl/ui.xsl"/> <xsl:param name="action-url" select="''"/> <xsl:param name="output-encoding" select="UTF-8"/> <xsl:output method="xml" encoding="{$output-encoding}" /> When I try to transform my source document, passing the proper encoding as a parameter, I get the following error: net.sf.saxon.trans.DynamicError: Invalid encoding name: {$output-encoding} I know with XSLT 1.0, using an attribute value template with xsl:export was not available. Help!!! thanks in advance, Gretchen


Replies (5)

Please register to reply

RE: Attribute value template w/ xsl:output at - Added by Anonymous over 18 years ago

Legacy ID: #3359565 Legacy Poster: Kevin Rodgers (notorious_kev)

I don't think the xsl:output encoding attribute can be an attribute value template. The spec uses {...} to indicate such attributes (see http://www.w3.org/TR/xslt20/#terminology) but the xsl:encoding attribute is defined as string -- not {string}. See http://www.w3.org/TR/xslt20/#element-output vs. http://www.w3.org/TR/xslt20/#element-output -- Kevin

RE: Attribute value template w/ xsl:output at - Added by Anonymous over 18 years ago

Legacy ID: #3359568 Legacy Poster: Kevin Rodgers (notorious_kev)

Oops, see http://www.w3.org/TR/xslt20/#element-output vs. http://www.w3.org/TR/xslt20/#element-result-document. -- Kevin

RE: Attribute value template w/ xsl:output attrs? - Added by Anonymous over 18 years ago

Legacy ID: #3359711 Legacy Poster: Gretchen Moran (gmoran-pentaho)

Thanks Kevin, I think you're right. I had read so much about that rule being changed, but it turns out it was allowed in the XSLT 1.1 spec, I just assumed it carried through to 2.0.

RE: Attribute value template w/ xsl:output at - Added by Anonymous over 18 years ago

Legacy ID: #3360054 Legacy Poster: Michael Kay (mhkay)

The XSLT 2.0 spec permitted AVTs for xsl:output attributes at one stage, but that was many drafts ago. To choose serialization parameters at run-time, use xsl:result-documents, which does allow the parameters to be AVTs. Michael Kay

RE: Attribute value template w/ xsl:output at - Added by Anonymous over 18 years ago

Legacy ID: #3360345 Legacy Poster: Gretchen Moran (gmoran-pentaho)

Thanks Michael, I will try that. best regards, Gretchen

    (1-5/5)

    Please register to reply