[xslt] xsltproc: no output for copy-of text nodes



Given the XML:

   <a>                      
     <b>Want this</b>       
     <c>Don't want this</c> 
   </a>

I get no output from xsltproc with the following stylesheet:

   <?xml version="1.0" encoding="utf-8"?>                              
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";    
                   version="1.0">                                      
                                                                       
     <xsl:output method="text"/>                                       
                                                                       
     <xsl:template match="//b/text()">                                 
       <xsl:copy-of select="."/>                                       
     </xsl:template>                                                   
                                                                       
     <xsl:template match="text()|@*"/>                                 
                                                                       
   </xsl:stylesheet>                                                   

   $ xsltproc --debug xsltproc-bug.xsl xsltproc-bug.xml   
   DOCUMENT                                               
   version=1.0                                            
   standalone=true                                        

Saxon and Xerces both output "Want this".  I get what I expect from
xsltproc if I use "//b//text()" instead.  I also get what I expect
with the original XPath using xmllint:

   / > ls //b/text()
   t--        9 Want this

Steve



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]