Re: [xml] Namespace axis fix

From: "Daniel Veillard" <veillard redhat com>
On Mon, Jun 24, 2002 at 12:43:05PM +0100, Richard Jinks wrote:

I've got a patch for xmlXPathNextNamespace() that fixes the problem with
not returning the default XML namespace, and reverses the namespace axis
that it is now in document order.


If you have any objections to changing the direction of the namespace
I'll post a patch that just fixes the default XML namespace bug.

  Which surprises me since I really though I fixed this a long time ago


You did fix a problem related to this, but there was a path through the code
that missed your fix.

Quick scan through the CVS changes -
Bug 61291, xpath.c version 1.150
This added the default XML namespace to the namespace axis, as you
remembered, but the problem I'd found was that this was only returned if the
node had any namespaces defined for it at all.

The test case included for bug 61291 didn't catch this because the node was
in the XSLT namespace as well as the XML namespace.

Test case to show this -

Stylesheet 195b.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl=''
<xsl:output method="text"/>
<xsl:template match="/XML_DATA//*">
<xsl:value-of select="name()"/>
<xsl:text> - </xsl:text>
<xsl:for-each select="namespace::*">
<xsl:text> &quot;</xsl:text>
<xsl:value-of select="name()"/>
<xsl:text>&quot; </xsl:text>

XML 195b.xml
<?xml version="1.0"?>
<AAA xmlns:fish="tuna"/>

Original output -
C:\libxml\libxslt-1.0.18.win32\util>xsltproc 195b.xsl 195b.xml

AAA -  "fish"  "xml"


Fixed output -
C:\libxml\libxslt-1.0.18.win32\util>xsltproc 195b.xsl 195b.xml

AAA -  "xml"  "fish"

CCC -  "xml"

Simulated output from before Bug 61291 -
xsltproc 195b.xsl 195b.xml

AAA -  "fish"


Do You Yahoo!?
Get your free address at

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