From dsewell at virginia.edu Fri Jun 8 10:55:20 2012 From: dsewell at virginia.edu (David Sewell) Date: Fri, 8 Jun 2012 13:55:20 -0400 (EDT) Subject: [xquery-talk] Strong data checking on @xml:id? Message-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 := 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: dsewell at virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ From dlee at calldei.com Fri Jun 8 11:35:21 2012 From: dlee at calldei.com (David Lee) Date: Fri, 8 Jun 2012 18:35:21 +0000 Subject: [xquery-talk] Strong data checking on @xml:id? In-Reply-To: References: Message-ID: <220256FDE771B74FB662165BC562CF5940783E02@BY2PRD0810MB391.namprd08.prod.outlook.com> 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 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 David Sewell > Sent: Friday, June 08, 2012 1:55 PM > To: talk at xquery.com > 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 := > 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: dsewell at virginia.edu Tel: +1 434 924 9973 > Web: http://rotunda.upress.virginia.edu/ > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From gkholman at CraneSoftwrights.com Fri Jun 8 11:48:11 2012 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Fri, 08 Jun 2012 14:48:11 -0400 Subject: [xquery-talk] Strong data checking on @xml:id? In-Reply-To: <220256FDE771B74FB662165BC562CF5940783E02@BY2PRD0810MB391.n amprd08.prod.outlook.com> References: <220256FDE771B74FB662165BC562CF5940783E02@BY2PRD0810MB391.namprd08.prod.outlook.com> Message-ID: <7.0.1.0.2.20120608144607.02495eb0@wheresmymailserver.com> 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 { } return ( 'Result with ''abc'':',count($in/id('abc')) ), let $in := document { } return ( 'Result with ''-ptr'':',count($in/id('-ptr')) ) t:\ftemp>xquery david.xq 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 From dlee at calldei.com Fri Jun 8 12:21:59 2012 From: dlee at calldei.com (David Lee) Date: Fri, 8 Jun 2012 19:21:59 +0000 Subject: [xquery-talk] Strong data checking on @xml:id? In-Reply-To: <7.0.1.0.2.20120608144607.02495eb0@wheresmymailserver.com> References: <220256FDE771B74FB662165BC562CF5940783E02@BY2PRD0810MB391.namprd08.prod.outlook.com> <7.0.1.0.2.20120608144607.02495eb0@wheresmymailserver.com> Message-ID: <220256FDE771B74FB662165BC562CF5940783E4D@BY2PRD0810MB391.namprd08.prod.outlook.com> 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 { } > return ( 'Result with ''abc'':',count($in/id('abc')) ), > let $in := document { } > return ( 'Result with ''-ptr'':',count($in/id('-ptr')) ) > > t:\ftemp>xquery david.xq > 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 From mike at saxonica.com Fri Jun 8 16:00:06 2012 From: mike at saxonica.com (Michael Kay) Date: Sat, 09 Jun 2012 00:00:06 +0100 Subject: [xquery-talk] Strong data checking on @xml:id? In-Reply-To: References: Message-ID: <4FD283F6.2070908@saxonica.com> The relevant statement in the spec is XQuery 3.7.1.1 clause 5: "If the attribute name is xml:id, then xml:id processing is performed as defined in [XML ID]. This ensures that the attribute has the type xs:ID and that its value is properly normalized. If an error is encountered during xml:id processing, an implementation MAY raise a dynamic error [err:XQDY0091]." So yes, the effect is to some extent implementation-defined. Saxon never raises XQDY0091. It does apply normalize-space() to the value, but unless you are validating the result tree, it doesn't complain if the value isn't a valid NCName. I'm not sure why I made this decision; it's conformant with the spec, but my feeling today would be that validating the value (and reporting an error) would be preferable. Michael Kay Saxonica On 08/06/2012 18:55, David Sewell wrote: > 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 := > 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. > From christian.gruen at gmail.com Mon Jun 18 09:47:04 2012 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Mon, 18 Jun 2012 18:47:04 +0200 Subject: [xquery-talk] [ANN] BaseX 7.3 Message-ID: Hi everyone, we are glad to announce a great new release of BaseX, our XML database and XPath/XQuery 3.0 processor! Here are the latest features; - Many new internal XQuery Modules have been added, and existing ones have been revised to ensure long-term stability of your future XQuery applications: http://docs.basex.org/wiki/Module_Library - A new powerful Command API is provided to specify BaseX commands and scripts as XML: http://docs.basex.org/wiki/Commands#Basics - The full-text fuzzy index was extended to also support wildcard queries: http://docs.basex.org/wiki/Full-Text - The simple map operator of XQuery 3.0 gives you a compact syntax to process items of sequences: http://docs.basex.org/wiki/XQuery_3.0 - BaseX as Web Application can now start its own server instance: http://docs.basex.org/wiki/Web_Application - All command-line options will now be executed in the given order: http://docs.basex.org/wiki/Startup_Options - Charles Foster's latest XQJ Driver supports XQuery 3.0 and the Update and Full Text extensions: http://xqj.net/basex/ As usual, your feedback is welcome. More infos can be found on http://basex.org. For those of you in the Northern Hemisphere, we wish you a nice summer! No worries, we'll stay busy.. Christian BaseX Team, 2012 From elite.english at gmail.com Tue Jun 19 03:56:38 2012 From: elite.english at gmail.com (Alice Wei) Date: Tue, 19 Jun 2012 10:56:38 +0000 (UTC) Subject: [xquery-talk] Invitation to connect on LinkedIn Message-ID: <22158654.13198843.1340103398681.JavaMail.app@ela4-app0128.prod> LinkedIn ------------ I'd like to add you to my professional network on LinkedIn. - Alice Alice Wei Technical Consultant at Indiana University Bloomington, Indiana Area Confirm that you know Alice Wei: https://www.linkedin.com/e/xnupbm-h3muyo7o-28/isd/7546757883/m_IXhCbP/?hs=false&tok=1ClHTo3ERgPBg1 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/xnupbm-h3muyo7o-28/kDd-YG5BG4ZUACXjkyk-G9jZp24/goo/talk%40x-query%2Ecom/20061/I2558502205_1/?hs=false&tok=2vCMZQeY1gPBg1 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -------------- next part -------------- An HTML attachment was scrubbed... URL: