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

Re: accessing xml using node name

Subject: Re: accessing xml using node name
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 17 May 2006 17:51:59 +0100
equivalent node.name ie
   <xsl:value-of  select="self::node()/node()[number($columnRow)]"

That could be written more simply as

   <xsl:value-of  select="*[number($columnRow)]"


there's no need to start a path with self::node() as relative paths
always are taken relative to the current node (ie, self::node())

* isn't equivalent to node() in teh next step but I suspect that you
intend * (ie counting element position) if you use node() then the
osition will be affecteded by any indentation or comments in your
 source file.


        <xsl:with-param name="id"><xsl:value-of 
            select="$id"/></xsl:with-param>

You have several instances of this, it's generally a bad idea to use
param with-param or variable with content like this unless you really
need it. the above makes $id into a result tree fragment corresponding
to a root node with achild text node the string value of the old value
of $id. This is relatively expensive to construct and less useful as 4id
is no longer a node set so you can not use it in XPath steps.

        <xsl:with-param name="id" select="$id"/>

is simpler to type and makes $id have the same value as the old value of
$id so it's much more efficient and generally more useful.



           <xsl:value-of select="self::node()/node()[number($list)]"/>

typically your list is a comma separated list of values so number($list)
will be NaN and tge XPath will not select anything. You need to check if
it contains a , and if so just take the first number with
substring-before before using number().


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.