[xml] XPath Node Tests



Hi

Can you confirm the following is a bug, please?
(Using new libxml2-2.4.21, libxslt1-0.17)

It appears the processing-instruction node test returns all processing
instructions regardless of the literal argument.

If you agree it is a bug, I'll look into it and post a patch later this
afternoon.

Quick XSLT test to see if it will return the contents of the 'tuna' PI -

XML file a.xml:

<?xml version="1.0" encoding="iso-8859-1" standalone='yes'?>
<!-- This is my comment -->
<?gold return="no" fish="6"?>
<?tuna return="yes" fish="7"?>
<el1>
</el1>

XSLT Stylesheet b.xsl:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">

<xsl:output method="text"/>
<xsl:template match="/">
<xsl:value-of select="processing-instruction('tuna')"/>
</xsl:template>

</xsl:transform>

Run through xsltproc:
C:\libxml\libxslt-1.0.17\win32\dsp\xsltproc>xsltproc b.xsl a.xml
xsltproc b.xsl a.xml
return="no" fish="6"

Run through testxpath:
C:\libxml\libxml2-2.4.21\win32\dsp\testXPath>testxpath -i a.xml
"/processing-instruction('tuna')"
testxpath -i a.xml "/processing-instruction('tuna')"
Object is a Node Set :
Set contains 2 nodes:
1  PI gold
    content=return="no" fish="6"
2  PI tuna
    content=return="yes" fish="7"

Thanks,
Richard


_________________________________________________________
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]