[Mono-bugs] [Bug 443490] New: Duplicate results evaluating XPath expressions

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Nov 10 14:26:49 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=443490


           Summary: Duplicate results evaluating XPath expressions
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: em at nerd.ocracy.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=251127)
 --> (https://bugzilla.novell.com/attachment.cgi?id=251127)
Test case - C# source

Running an XPath query such as '//_:div//_:div//_:div', where '_' is mapped to
the XHTML namespace, with SelectNodes() leads to duplicate nodes for some
inputs.

No other implementations that I know of does this, and it is rather unexpected.

A sample program can be downloaded from
http://techn.ocracy.org/xpath-experiment/ (
http://techn.ocracy.org/xpath-experiment/archive/tip.tar.gz for a tarball).

It is a simple C# program with a minimal XHTML test file and the Makefile also
runs the same query with xmlstarlet for reference.

Executing 'make run' gives these results:

e1.1.1
e1.1.1.1
e1.1.1.1.1
e1.1.1.1.1
e1.1.1.1.1
e1.1.1.2
MATCHES: 6
e1.1.1
e1.1.1.1
e1.1.1.1.1
e1.1.1.2
MATCHES (distinct): 4
e1.1.1 e1.1.1.1 e1.1.1.1.1 e1.1.1.2
REFERENCE: 4

The first run shows the ids of the elements returned by a bare SelectNodes(),
the second run uses .Distinct() on these results and the third is the output
coming from xmlstarlet.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list