xsl-list
[Top] [All Lists]

Re: [xsl] understanding attributes and predicates

2008-02-01 11:17:27
"Terry" == Terry Ofner <tofner(_at_)comcast(_dot_)net> writes:


    Terry> When I select specific par elements with a predicate, as in
    Terry> the template below, I get the attribute name, attribute
    Terry> value, and the text node of the <par> element.

    Terry> <xsl:template match="par[(_at_)class='stem_mc']"> <!-- List the
    Terry> attribute names and values. --> <xsl:for-each select='@*'>
    Terry> attribute name: <xsl:value-of select="name()"/> attribute
    Terry> value: <xsl:value-of select="."/> </xsl:for-each>
    Terry> </xsl:template>


    Terry> I just wonder what is going on. Is it the "for-each
    Terry> select='@*'" or the "value-of select="." that is returning
    Terry> the text node of the par element?

No.

You are not matching the par elements which DON'T have a
class="stem_mc' attribute. So these get matched by the built-in
templates, which just write the text nodes.

-- 
Colin Adams
Preston Lancashire

--~------------------------------------------------------------------
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>
--~--