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

Re: Selecting and printing certain nodes

Subject: Re: Selecting and printing certain nodes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 20 Feb 2004 17:06:52 GMT
xpath selecting certain nodes
> This prints out '$startDate' when I really want it to print the value of the
> xsl:param $startDate. Is there a way to do this in XSL?

No, you can't refer to the program variables from the source file unless
you have an extension element that makes an XPath parser available at
run time some systems do (saxon for example) but not all of them make
variable bindings available to the run time extension function.

ah I see you already are using dyn:evaluate so in that case you could
probably evaluate the string "$startDate" coming from the source.
But do you really want to polute your source files with the internal
variables used in the stylesheet. You wouldn't normally expect a file
read in to a compiled C program (say) to access the variables used in
that program, it's rather similar here.


Incidentally there is no need to have the if in

   <xsl:if test="@name"/>
        <xsl:value-of select="@name"/>
    </xsl:if>

if the attribute isn't there it's value will be "".

  This all work great. Now my question is can you think of a way to handle
  nested foreach statments?

it'll just work automatically due to the nested apply-templates, won't
it? I can't see any reason why not.


  Do I need to pass a variable which is an array or something

XSLT doesn't have arrays, it  has node sets which are just as useful,
but I don't see that you have pass anything other than your existing 
item node.

David


-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. 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
________________________________________________________________________

 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.