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. ---------------------------------------- David A. Lee [email protected] http://www.xmlsh.org > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of David Sewell > Sent: Friday, June 08, 2012 1:55 PM > To: [email protected] > Subject: [xquery-talk] Strong data checking on @xml:id? > > Working within MarkLogic, I just got bitten by a server error caused by > lexically invalid @xml:id in the input data. Boiled down, this was the > offending query: > > let $in := <input xml:id="-ptr"/> > return element out { > attribute id { $in/@xml:id } > } > > MarkLogic complains: XDMP-LEXVAL: xs:ID("-ptr") -- Invalid lexical value > "-ptr" > > So it is obviously trying to cast '-ptr' as xs:ID and failing. But I > notice that Saxon doesn't throw an error in this case. Either processor > is happy if I wrap string() around $in/@xml:id. > > I'm just wondering if this is an implementation-dependent matter, or > what the specs might say about such a case. > > David S. > > -- > David Sewell, Editorial and Technical Manager > ROTUNDA, The University of Virginia Press > PO Box 400314, Charlottesville, VA 22904-4314 USA > Email: [email protected] Tel: +1 434 924 9973 > Web: http://rotunda.upress.virginia.edu/ > _______________________________________________ > [email protected] > http://x-query.com/mailman/listinfo/talk _______________________________________________ [email protected] http://x-query.com/mailman/listinfo/talk
