[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: understanding attributes and predicates

Subject: Re: understanding attributes and predicates
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: Fri, 01 Feb 2008 18:16:57 +0000
Re:  understanding attributes and predicates
>>>>> "Terry" == Terry Ofner <tofner@xxxxxxxxxxx> 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[@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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.