|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
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
|






