text()" vs. "node()"

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

Re: "*|@*|text()" vs. "node()"

Subject: Re: "*|@*|text()" vs. "node()"
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 4 Oct 2001 15:53:59 +0100
Re:  "*|@*|text()" vs. "node()"
> instead of <xsl:apply-templates select="*|@*|text()"/>, I think you just
> want <xsl:apply-templates> otherwise, you're applying the templates to the
> children of whatever matches the template first and not getting the original
> match.  

You have that (at best) backwards. <xsl:apply-templates/>  just matches
on children (not the current node, and not attributes). 
<xsl:apply-templates select="*|@*|text()"/>
matches on child elements and text nodes, but not comments or pi's and
also matches on attributes.


> Also, I think that it's going to match everything so all the
> children 3 levels nested and below are going to be repeated.

No.

> As far as the attribute, I don't believe you can have <xsl:choose>
> as a child of <xsl:attribute>.

Yes you can, why would you think not?

> Also, you can't have <xsl:attribute> without an opening
> element before it..  
That is immediate from the structure of XML. the xsl:template
element opens before xsl:attribute. there's nothing wrong with

<xsl:template match="@href">
   <xsl:attribute name="href">

> Also, I don't know if it would make a difference, but
> try <xsl:template match="*/@href"> instead of simply match="href"

You meant "@href" not "href". It does make a difference: it affects the
default priority, but it doesn't affect the nodes matched.

David


_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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


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-2013 All Rights Reserved.