xsl-list
[Top] [All Lists]

Re: [xsl] Using attributes with XPath

2006-08-24 09:09:02


Mike I'm not sure what you mean by this:

2. Here the meaning is something like 

<xsl:template match="@type[....]"/>

the OP's original code of

<xsl:template match="@type[parent::list]"/>

was correct although most people would write it as

<xsl:template match="list/@type"/>


Certainly, it
is more than obvious that an attribute must have some relationship
with the element it stands with, it cannot be floating in space.

although XSLT2 does in fact allow you to generate attribute nodes that
do just that.
<xsl:variable name="a" as="attribute()">
<xsl:attribute name="x">y</xsl;attribute>
</xsl:variable>

then $a is an attribute node with no parent (and can't be serialised
unless it is copied into the content of an element being constructed)

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--