|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Checking node position
Gary, Saxon 5.4.1 complains
<xsl:variable name="head-types"
select="document('')//x:keynode/text()"/>
<xsl:template match="p[. = $head-types]">
<xsl:element name="{.}">
<xsl:apply-templates select="key('parent', generate-id())[not(. =
$head-types)]"
mode="inner"/>
</xsl:element>
</xsl:template>
Failed to compile style sheet
At xsl:template on line 18 of trash.xsl: The match pattern in
xsl:template may not contain references to variables
18 is the template match above.
It looks OK to me, am I missing something?
The variable within the predicate I thought was OK?
DaveP
Gary Peskin wrote:
> This approach is a little more table-driven:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:x="foo" exclude-result-prefixes="x">
>
> <x:keynode>head1</x:keynode>
> <x:keynode>head2</x:keynode>
>
> <xsl:key name="parent" match="p"
> use="generate-id(preceding-sibling::p[string(.) =
> document('')//x:keynode/text()])" />
>
> <xsl:variable name="head-types"
> select="document('')//x:keynode/text()"/>
>
> <xsl:template match="p[. = $head-types]">
> <xsl:element name="{.}">
> <xsl:apply-templates select="key('parent', generate-id())[not(. =
> $head-types)]"
> mode="inner"/>
> </xsl:element>
> </xsl:template>
>
> <xsl:template match="p"/>
>
> <xsl:template match="p" mode="inner">
> <sub>
> <xsl:copy-of select="."/>
> </sub>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








