Retrieving XML node from a path specified in an attribute value of another node

后端 未结 3 704
甜味超标
甜味超标 2021-01-03 09:11

From this XML source :



  
    

        
3条回答
  •  失恋的感觉
    2021-01-03 09:40

    Owen,

    your solution making use of dyn:evaluate>() is fine, but does not work in browsers, see here:

    http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/201008/msg00126.html

    The problem with what you've got: ... is that it assumes elementName is only a single element's name. If it's an arbitrary XPath expression, the test will fail.

    Dimitrie's solution was not for general XPath parsing, and the handling of more than one node can simply be added to his solution by adding s, see the diff below:

    $ diff -u x.xsl y.xsl
    --- x.xsl       2010-08-13 14:53:42.000000000 +0200
    +++ y.xsl       2010-08-14 11:59:42.000000000 +0200
    @@ -40,15 +40,19 @@
    
        
         
    -      
    +     
    +      
    +     
         
         
    +     
           
             
             
    +        "."/>
           
    +     
         
        
    
    $ 
    
    

提交回复
热议问题