XQL 'id' function in XML::XQL

  • Thread starter Lars Kellogg-Stedman
  • Start date
L

Lars Kellogg-Stedman

After reading through the XQL specs, it is my impression that given the
following input:

<container>
<item id="foo">item 1</item>
<item id="bar">item 2</item>
</container>

The following code should work:

$doc = XML::DOM::parser->new->parse(...above text...);
$doc->xql("id('foo')");

Whereby "work" I mean it should return a reference to the <item
id="foo"/> node. Instead it always results in 0 matches. I've replaced
it with:

$doc->xql("//item[\@id='foo']");

Which does work, but I'm curious if (a) I've misunderstood the XQL spec,
or (b) if XML::XQL is broken.

Thanks,

-- Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,007
Messages
2,570,266
Members
46,865
Latest member
AveryHamme

Latest Threads

Top