[xquery-talk] Strong data checking on @xml:id?

David Lee dlee at calldei.com
Fri Jun 8 12:21:59 PDT 2012


Yes that's because the id table is validating ...
Simple case is the XML is schema invalid.  It needs to be fixed.
Some processors will choke others may not.  But its still bad XML.


----------------------------------------
David A. Lee
dlee at calldei.com
http://www.xmlsh.org


> -----Original Message-----
> From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On
> Behalf Of G. Ken Holman
> Sent: Friday, June 08, 2012 2:48 PM
> To: talk at xquery.com
> Subject: Re: [xquery-talk] Strong data checking on @xml:id?
> 
> 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
> 
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk





More information about the talk mailing list