xsl-list
[Top] [All Lists]

Re: [xsl] Finding the current node type

2007-08-01 07:14:08
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

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