[xquery-talk] Strong data checking on @xml:id?
G. Ken Holman
gkholman at CraneSoftwrights.com
Fri Jun 8 11:48:11 PDT 2012
At 2012-06-08 18:35 +0000, David Lee wrote:
>I belive the issue is that of validation.
>MarkLogic is a validating XQuery parser so is validating xml:id
>against the standard XML schemas. "-ptr" is not a valid xml:id
>
>Saxon HE (I presume you are using HE), otoh, is not a validating
>XQuery engine.
Maybe so, but I did discover recently that Saxon HE does not load the
id() table when the token is not a valid xml:id value:
t:\ftemp>type david.xq
let $in := document { <input xml:id="abc"/> }
return ( 'Result with ''abc'':',count($in/id('abc')) ),
let $in := document { <input xml:id="-ptr"/> }
return ( 'Result with ''-ptr'':',count($in/id('-ptr')) )
t:\ftemp>xquery david.xq
<?xml version="1.0" encoding="UTF-8"?>Result with 'abc': 1 Result
with '-ptr': 0
t:\ftemp>
I hope this is helpful.
. . . . . . . . Ken
--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/
G. Ken Holman mailto:gkholman at CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers: http://www.CraneSoftwrights.com/legal
More information about the talk
mailing list