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:      [EMAIL PROTECTED]       
                       
                      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 [EMAIL PROTECTED]         information publishing + retrieval
phone +49 2222 9292 90             http://www.doctronic.de





Reply via email to