Re: [xml] Namespace axis fix



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

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

  okay,

If you have any objections to changing the direction of the namespace
axis,
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
...

Daniel

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 -
http://bugzilla.gnome.org/show_bug.cgi?id=61291
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='http://www.w3.org/1999/XSL/Transform'
version="1.0">
<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>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>

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

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

AAA -  "fish"  "xml"

CCC -

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"

CCC -



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




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