PhoneixS
PhoneixS

Reputation: 11016

XPath result with duplicates

I have the following xml:

<?xml version="1.0" encoding="UTF-8"?>
<centro>
  <contenidos>
    <contenido curso="1" value="a" />
    <contenido curso="1" value="b" />
    <contenido curso="1" value="c" />
    <contenido curso="1" value="d" />
  </contenidos>
</centro>

And the bellow XPath:

/centro/contenidos/contenido[@curso=1]

When I evaluate the XPath in XML Copy Editor program the results is:

<contenido curso="1" value="a"/>
<contenido curso="1" value="a"/><contenido curso="1" value="b"/>
<contenido curso="1" value="a"/><contenido curso="1" value="b"/><contenido curso="1" value="c"/>
<contenido curso="1" value="a"/><contenido curso="1" value="b"/><contenido curso="1" value="c"/><contenido curso="1" value="d"/>

I think it should return only the four elements, why it return this pyramid result? Is a problem with XML Copy Editor or the XPath?

Upvotes: 0

Views: 168

Answers (1)

Rolando Isidoro
Rolando Isidoro

Reputation: 5114

That behaviour is not the expected one for sure, like you state it should simple return the four nodes and not an incremental concatenation of each of them.

Searching for xpath at the XML Copy Editor bug tracker, there's no reference to your problem, so my advise would be for you to submit that one yourself and wait/hope for it to be fixed in a new release shortly.

Upvotes: 1

Related Questions