On Thu, 17 Aug 2006, Tim Finney wrote:
> The id() function looks up elements with a given ID value.
> Unfortunately, all my IDs are in the XML namespace. At the moment I use
> the following which does not seem too efficient:
>
> fn:doc($uri)//@xml:id[. = $id]/..
>
> Is there a way to use id() with @xml:ids? If not, is there a good way to
> get a node with a particular @xml:id?
Using Saxon8 for example, the query
let $doc := document {
<doc>
<p xml:id="node1">one</p>
<p xml:id="node2">two</p>
</doc>
}
return $doc//id('node2')
==> <p xml:id="node2">two</p>
With ML Server 3.1 it returns the empty sequence.
Since xml:id has been a W3C recommendation for a year now, could support
for it be added as an RFE in MarkLogic Server?
David
--
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400318, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: [EMAIL PROTECTED] Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general