xsl-list
[Top] [All Lists]

RE: parameter use in XPath

2003-10-24 09:55:02
Are you stating that "*[name()=$keyword]" worked for me as 
the value of a match attribute of xsl:template, using 
libxslt, quite literally "by accident" (i.e., because the 
processor doesn't check this constraint)? If so, are there 
any side effects which may manifest as bugs elsewhere in the 
stylesheet by taking this terse approach? Do you recommend 
abandoning this approach?


There are several 1.0 processors that don't enforce this constraint. The
constraint is there in the spec because of a misguided attempt to
prevent circularities such as

<xsl:variable name="x">
  <xsl:apply-templates match="/*/item[1]"/>
</xsl:variable>

<xsl:template match="item[$x]">
  ...
</xsl:template>

Like the restriction on using RTFs as node-sets, it's totally
unnecessary but conformant processors are required to enforce it.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>