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

RE: storing the result of a transformation in a param

Subject: RE: [xsl] storing the result of a transformation in a param and evaluating the content
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 23 Nov 2004 09:30:31 -0000
xpath 2.0 fragment param
> String-length only works if $content is a text node, on a result tree
> fragment, it returns false every time.
> 
> I need something that evaluates to true when a result tree fragment is
> present in the variable.
> 

The variable will always contain a result tree fragment: you are trying to
test, I think, whether the fragment (which is a document node) has any child
nodes. Since there are only two things you can do with an RTF in XSLT 1.0,
convert it to a string or copy it to another tree, there is no way of
distinguishing an RTF having a single empty element child from one that has
no children. (Both have a string value of "" - it's not true that
string-length works only on text nodes, but it is true that it gives you
zero if there are no text nodes, regardless of how many element nodes there
are.)

So: you can't do it without the xx:node-set extension.

Michael Kay
http://www.saxonica.com/

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.