xsl-list
[Top] [All Lists]

Re: [xsl] Avoiding boneheaded mistakes in XSLT?

2010-12-29 07:42:44
1. In an XPath expression, using "something/node" where I wanted
"something/node()" [ditto text vs. text()]: always means zero
results and can drive you crazy if you don't notice the missing
parentheses;

But just fantasizing for a moment, here, wouldn't it be nice to have
a function what-is-this(), to which one could hand an expression and
be told what the processor knows it is supposed to be, so you can
compare that to what you think it is supposed to be?

Stuff kinda like:
  what-is-this( something/node ) => "sequence of 0 or more ns:node element 
nodes"
  what-is-this( something/node() ) => "sequence of 0 or more element, 
attribute, comment, text, or processing-instruction nodes"
  what-is-this( 1+1 ) => "xs:integer"
  what-is-this( $teiHeader ) => "variable holding a result tree fragment"

I'll bet oXygen's XSLT debugger (and perhaps others as well, I've
only used oXygen's) gives you this information somehow.

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