xsl-list
[Top] [All Lists]

RE: storing the result of a transformation in a param and evaluating the content

2004-11-23 02:30:31
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/



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