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

Re: Finding the current node type

Subject: Re: Finding the current node type
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 01 Aug 2007 16:13:42 +0200
Re:  Finding the current node type
Mark Anderson wrote:
Thanks Guys

In my application, I will only need to process a few hundred nodes and
about 20-30 of the type where I need to use the choose statement.

??
Sounds like you want a copy idiom with some template matches instead of xsl:choose (or remove the copy if you meant with the above that you want to remove all the things not in the xsl:choose)


I went with the <xsl:if test=self::speaker> option as I still use the
namespace (e.g. <xsl:if test=self::abc:speaker>). Whereas localname
returned the node name without the ns prefix

Correct, as already been stated in this thread. If you find yourself doing test="self::ns:speaker" or similar, it is almost always better to do xsl:apply-templates with xsl:template matching. XSLT code only rarely really needs xsl:choose or xsl:if statements. Note that apply-templates automatically does nothing when the selected node set is not there.


Cheers,
-- Abel Braaksma

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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.