You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by David N Bertoni/CAM/Lotus <da...@us.ibm.com> on 2002/02/01 01:20:14 UTC

Re: Convert string to XPath with Xalan-C

You could use the evaluate() extension function, but if the XPath is
invalid, the processor will stop the transformation.  If you wanted more
control over whether or not processing will stop, you'd have to write your
own extension function and catch the appropriate exceptions.  See the
documentation for more information.

The better way to do this without extension functions is to use a
stylesheet to generate a new stylesheet that contains the XPath expression
as a static string.  You can then use that stylesheet.

Dave



                                                                                                              
                      Holger Flörke                                                                           
                      <floerke@doctron         To:      xalan-dev@xml.apache.org                              
                      ic.de>                   cc:                                                            
                                               Subject: Convert string to XPath with Xalan-C                  
                      01/31/2002 05:48                                                                        
                      AM                                                                                      
                      Please respond                                                                          
                      to xalan-dev                                                                            
                                                                                                              
                                                                                                              




Is it possible to test in an XSL(T)-stylesheet whether a string from the
XML source is a valid XPath or not? As far as I know there is no
possibility in the XSL(T)-standard. Maybe Xalan-C implements some extra
functions or can be cheated :^)

HolgeR

For example:

Document:
<A>
   <TEST me="//x"/>
   <TEST me=""/>
</A>

The XSL(T)-Stylesheet should complain the XPath in Attribute 'me' of the
second 'TEST' is illegal.

--
holger floerke                     d  o  c  t  r  o  n  i  c
email floerke@doctronic.de         information publishing + retrieval
phone +49 2222 9292 90             http://www.doctronic.de