[xslt] Bug in exclude-result-prefixes?



I've found what I believe to be a bug in how exclude-result-prefixes
is handled.  Take the following stylesheet:

<?xml version= "1.0" standalone="no"?>

<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ns="http://my.namespace/"
  exclude-result-prefixes="ns">
  
 <xsl:template match="msg">
    <ns:output>
      <xsl:apply-templates />	
    </ns:output>
  </xsl:template>
  
</xsl:stylesheet>

as applied to the XML file:

<msg>Success</msg>

The output here should be something like:

<ns:output xmlns:ns="http://my.namespace/">Success</ns:output>

but xsltproc (I'm using 0.14) outputs nothing, probably because 'ns'
is specified as an an excluded prefix.  

I do not think this is this is the behavior the writers of the XSLT
spec had in mind :) My reading of section 7.1 is that
exclude-result-prefixes will prevent *extra* namespace nodes from
being added to the result element node.  I don't think it is supposed
to be used to supress result elements.


--Brent

-------------------------------------------------------------------------

"The programmer, like the poet, works only slightly removed from pure
 thought-stuff.  He builds his castles in the air, from air, creating
 by exertion of the imagination.  Few media of creation are so
 flexible, so easy to polish and rework, so readily capable of
 realizing grand conceptual structures."
                        -- Frederick Brooks, Jr., The Mythical Man Month




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