From andrew.j.welch at gmail.com Tue Dec 4 07:26:37 2012 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 4 Dec 2012 15:26:37 +0000 Subject: [xquery-talk] Sequence of Nodes Comparison In-Reply-To: References: Message-ID: On 4 December 2012 15:14, Kunal Chauhan wrote: > Hi, > > I want to compare two list of nodes. > Comparison should be based on QName, attribute and value. > Node's position is sequence doesn't matter. > > for example, > List A > ABC > DEF > XYZ > > List B > DEF > XYZ > ABC > > > When I compare both the lists it should show equal. let $i := (ABC, DEF, XYZ) let $j := (DEF, XYZ, ABC) return every $x in $i satisfies some $y in $j satisfies deep-equal($x, $y) : ) -- Andrew Welch http://andrewjwelch.com From mike at saxonica.com Tue Dec 4 07:37:24 2012 From: mike at saxonica.com (Michael Kay) Date: Tue, 04 Dec 2012 15:37:24 +0000 Subject: [xquery-talk] Sequence of Nodes Comparison In-Reply-To: References: Message-ID: <50BE18B4.5000601@saxonica.com> let $i := (ABC, DEF, XYZ) let $j := (DEF, XYZ, ABC) return every $x in $i satisfies some $y in $j satisfies deep-equal($x, $y) : ) (a) that's O(n^2) (b) it will return true if the first list is empty and the second contains anything at all (or nothing). At the very least you need to check the lengths are equal; but even then, there's a potential problem with duplicates. Michael Kay Saxonica From mike at saxonica.com Wed Dec 5 00:49:50 2012 From: mike at saxonica.com (Michael Kay) Date: Wed, 05 Dec 2012 08:49:50 +0000 Subject: [xquery-talk] Sequence of Nodes Comparison In-Reply-To: References: Message-ID: <50BF0AAE.6090406@saxonica.com> On 05/12/2012 04:59, Kunal Chauhan wrote: > Hi, > > I tried the way you suggest, but it works for me in xquery editor. > when I integrate it with java it returns true all the time. > > don't know why it happens ? > Because you are doing something wrong. If you want help in discovering what you are doing wrong, you will need to tell us more precisely what you are doing. Michael Kay Saxonica From robby.pelssers at nxp.com Wed Dec 19 01:11:55 2012 From: robby.pelssers at nxp.com (Robby Pelssers) Date: Wed, 19 Dec 2012 09:11:55 +0000 Subject: [xquery-talk] The value does not conform to the lexical constraints defined for the xs:anyURI type Message-ID: Hi all, I tested following Xquery with Sedna and Zorba: declare function local:getPipUri($id as xs:string) as xs:anyURI { xs:anyURI(concat("http://www.nxp.com/pip/", $id)) }; local:getPipUri("CX24483 14LZ") Sedna throws an exception: 2012/12/19 10:07:09 database query/update failed (SEDNA Message: ERROR FORG0001 Invalid value for cast/constructor. Details: The value does not conform to the lexical constraints defined for the xs:anyURI type. Query line: 6, column:4 ) http://www.zorba-xquery.com/html/demo happy returns "http://www.nxp.com/pip/CX24483 14LZ" So how does the xs:anyURI cast work? Is the developer supposed to encode the String before passing it to xs:anyURI or is the anyURI function supposed to do this? Thx in advance, Robby From mike at saxonica.com Wed Dec 19 01:31:29 2012 From: mike at saxonica.com (Michael Kay) Date: Wed, 19 Dec 2012 09:31:29 +0000 Subject: [xquery-talk] The value does not conform to the lexical constraints defined for the xs:anyURI type In-Reply-To: References: Message-ID: <50D18971.5010306@saxonica.com> The validation rules for xs:anyURI in the XSD 1.0 specification are notoriously troublesome, and it is not surprising that different implementors interpret them differently. This is what XSD 1.0 says: The ?lexical space? of anyURI is finite-length character sequences which, when the algorithm defined in Section 5.4 of [XML Linking Language] is applied to them, result in strings which are legal URIs according to [RFC 2396], as amended by [RFC 2732]. Note: Spaces are, in principle, allowed in the ?lexical space? of anyURI, however, their use is highly discouraged (unless they are encoded by %20). The "Note" here suggests that Sedna is wrong to reject the value (it also suggests that your query is wrong to supply it, but that you should be able to get away with it). The "algorithm" referred to in this rule is basically the escaping of special characters such as space. Note that in XSD 1.1, the spec gives up trying to define what's valid in an xs:anyURI and what isn't - all strings are now valid in the lexical space of xs:anyURI. Michael Kay Saxonica On 19/12/2012 09:11, Robby Pelssers wrote: > Hi all, > > > I tested following Xquery with Sedna and Zorba: > > declare function local:getPipUri($id as xs:string) as xs:anyURI { > xs:anyURI(concat("http://www.nxp.com/pip/", $id)) > }; > > local:getPipUri("CX24483 14LZ") > > > Sedna throws an exception: > 2012/12/19 10:07:09 database query/update failed (SEDNA Message: ERROR FORG0001 > Invalid value for cast/constructor. > Details: The value does not conform to the lexical constraints defined for the xs:anyURI type. > Query line: 6, column:4 > ) > > > http://www.zorba-xquery.com/html/demo happy returns "http://www.nxp.com/pip/CX24483 14LZ" > > So how does the xs:anyURI cast work? Is the developer supposed to encode the String before passing it to xs:anyURI or is the anyURI function supposed to do this? > > Thx in advance, > Robby > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From benito at benibela.de Wed Dec 19 03:13:00 2012 From: benito at benibela.de (Benito van der Zander) Date: Wed, 19 Dec 2012 12:13:00 +0100 Subject: [xquery-talk] The value does not conform to the lexical constraints defined for the xs:anyURI type In-Reply-To: <50D18971.5010306@saxonica.com> References: <50D18971.5010306@saxonica.com> Message-ID: <50D1A13C.7070501@benibela.de> Hi, btw. has anyone a regular expression matching exactly the allowed anyURIs of XSD 1.0? I tried to make one by translating the BNF in RFC 2396 and 2732 to regex, by having a regex for every token, and substituting them everywhere the token is used in the BNF. But the resulting regex: ((((([a-zA-Z][a-zA-Z0-9+-.]*:)?((//(((([a-zA-Z0-9-_.!~*''();:&=+$,]|%[a-fA-F0-9]{2})*@)?((([a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?.)*[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?.?)|([0-9]+(.[0-9]+){3})|\[(([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?|([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?::([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?)(:[0-9]{1,3}(.[0-9]{1,3}){3})?\])(:[0-9]*)?)?|([a-zA-Z0-9-_.!~*''()$,;:@&=+]|%[a-fA-F0-9]{2})+)(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)?)|(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)))|(([a-zA-Z0-9-_.!~*''();@&=+$,]|%[a-fA-F0-9]{2})+(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)?))([?]([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*)?)|([a-zA-Z][a-zA-Z0-9+-.]*:([a-zA-Z0-9-_.!~*''();?:@&=+$,]|%[a-fA-F0-9]{2})(([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2}))*))?(#(([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*))? is just horrible. (and it might not even work so well with unicode) Benito On 12/19/2012 10:31 AM, Michael Kay wrote: > The validation rules for xs:anyURI in the XSD 1.0 specification are > notoriously troublesome, and it is not surprising that different > implementors interpret them differently. > > This is what XSD 1.0 says: > > > The ?lexical space? of anyURI is finite-length character sequences > which, when the algorithm defined in Section 5.4 of [XML Linking > Language] is applied to them, result in strings which are legal URIs > according to [RFC 2396], as amended by [RFC 2732]. > > Note: Spaces are, in principle, allowed in the ?lexical space? of > anyURI, however, their use is highly discouraged (unless they are > encoded by %20). > > > The "Note" here suggests that Sedna is wrong to reject the value (it > also suggests that your query is wrong to supply it, but that you > should be able to get away with it). > > The "algorithm" referred to in this rule is basically the escaping of > special characters such as space. > > Note that in XSD 1.1, the spec gives up trying to define what's valid > in an xs:anyURI and what isn't - all strings are now valid in the > lexical space of xs:anyURI. > > Michael Kay > Saxonica > > On 19/12/2012 09:11, Robby Pelssers wrote: >> Hi all, >> >> >> I tested following Xquery with Sedna and Zorba: >> >> declare function local:getPipUri($id as xs:string) as xs:anyURI { >> xs:anyURI(concat("http://www.nxp.com/pip/", $id)) >> }; >> >> local:getPipUri("CX24483 14LZ") >> >> >> Sedna throws an exception: >> 2012/12/19 10:07:09 database query/update failed (SEDNA Message: >> ERROR FORG0001 >> Invalid value for cast/constructor. >> Details: The value does not conform to the lexical constraints >> defined for the xs:anyURI type. >> Query line: 6, column:4 >> ) >> >> >> http://www.zorba-xquery.com/html/demo happy returns >> "http://www.nxp.com/pip/CX24483 14LZ" >> >> So how does the xs:anyURI cast work? Is the developer supposed to >> encode the String before passing it to xs:anyURI or is the anyURI >> function supposed to do this? >> >> Thx in advance, >> Robby >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk >> > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From mike at saxonica.com Wed Dec 19 03:41:17 2012 From: mike at saxonica.com (Michael Kay) Date: Wed, 19 Dec 2012 11:41:17 +0000 Subject: [xquery-talk] The value does not conform to the lexical constraints defined for the xs:anyURI type In-Reply-To: <50D1A13C.7070501@benibela.de> References: <50D18971.5010306@saxonica.com> <50D1A13C.7070501@benibela.de> Message-ID: <50D1A7DD.2010002@saxonica.com> Michael Sperberg-McQueen has defined types that match different flavours of URI in http://www.w3.org/2011/04/XMLSchema/TypeLibrary-URI-RFC3986.xsd and http://www.w3.org/2011/04/XMLSchema/TypeLibrary-IRI-RFC3987.xsd To see the way these complex regular expressions are constructed, view these documents at the raw XML level using (for example) curl. Michael Kay Saxonica On 19/12/2012 11:13, Benito van der Zander wrote: > Hi, > > btw. has anyone a regular expression matching exactly the allowed > anyURIs of XSD 1.0? > > I tried to make one by translating the BNF in RFC 2396 and 2732 to > regex, by having a regex for every token, and substituting them > everywhere the token is used in the BNF. > > But the resulting regex: > > ((((([a-zA-Z][a-zA-Z0-9+-.]*:)?((//(((([a-zA-Z0-9-_.!~*''();:&=+$,]|%[a-fA-F0-9]{2})*@)?((([a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?.)*[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?.?)|([0-9]+(.[0-9]+){3})|\[(([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?|([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?::([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?)(:[0-9]{1,3}(.[0-9]{1,3}){3})?\])(:[0-9]*)?)?|([a-zA-Z0-9-_.!~*''()$,;:@&=+]|%[a-fA-F0-9]{2})+)(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)?)|(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)))|(([a-zA-Z0-9-_.!~*''();@&=+$,]|%[a-fA-F0-9]{2})+(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)?))([?]([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*)?)|([a-zA-Z][a-zA-Z0-9+-.]*:([a-zA-Z0-9-_.!~*''();?:@&=+$,]|%[a-fA-F0-9]{2})(([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2}))*))?(#(([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*))? > > > is just horrible. > (and it might not even work so well with unicode) > > Benito > > > On 12/19/2012 10:31 AM, Michael Kay wrote: >> The validation rules for xs:anyURI in the XSD 1.0 specification are >> notoriously troublesome, and it is not surprising that different >> implementors interpret them differently. >> >> This is what XSD 1.0 says: >> >> >> The ?lexical space? of anyURI is finite-length character sequences >> which, when the algorithm defined in Section 5.4 of [XML Linking >> Language] is applied to them, result in strings which are legal URIs >> according to [RFC 2396], as amended by [RFC 2732]. >> >> Note: Spaces are, in principle, allowed in the ?lexical space? of >> anyURI, however, their use is highly discouraged (unless they are >> encoded by %20). >> >> >> The "Note" here suggests that Sedna is wrong to reject the value (it >> also suggests that your query is wrong to supply it, but that you >> should be able to get away with it). >> >> The "algorithm" referred to in this rule is basically the escaping of >> special characters such as space. >> >> Note that in XSD 1.1, the spec gives up trying to define what's valid >> in an xs:anyURI and what isn't - all strings are now valid in the >> lexical space of xs:anyURI. >> >> Michael Kay >> Saxonica >> >> On 19/12/2012 09:11, Robby Pelssers wrote: >>> Hi all, >>> >>> >>> I tested following Xquery with Sedna and Zorba: >>> >>> declare function local:getPipUri($id as xs:string) as xs:anyURI { >>> xs:anyURI(concat("http://www.nxp.com/pip/", $id)) >>> }; >>> >>> local:getPipUri("CX24483 14LZ") >>> >>> >>> Sedna throws an exception: >>> 2012/12/19 10:07:09 database query/update failed (SEDNA Message: >>> ERROR FORG0001 >>> Invalid value for cast/constructor. >>> Details: The value does not conform to the lexical constraints >>> defined for the xs:anyURI type. >>> Query line: 6, column:4 >>> ) >>> >>> >>> http://www.zorba-xquery.com/html/demo happy returns >>> "http://www.nxp.com/pip/CX24483 14LZ" >>> >>> So how does the xs:anyURI cast work? Is the developer supposed to >>> encode the String before passing it to xs:anyURI or is the anyURI >>> function supposed to do this? >>> >>> Thx in advance, >>> Robby >>> >>> _______________________________________________ >>> talk at x-query.com >>> http://x-query.com/mailman/listinfo/talk >>> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk >> > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From benito at benibela.de Wed Dec 19 04:11:12 2012 From: benito at benibela.de (Benito van der Zander) Date: Wed, 19 Dec 2012 13:11:12 +0100 Subject: [xquery-talk] The value does not conform to the lexical constraints defined for the xs:anyURI type In-Reply-To: <50D1A7DD.2010002@saxonica.com> References: <50D18971.5010306@saxonica.com> <50D1A13C.7070501@benibela.de> <50D1A7DD.2010002@saxonica.com> Message-ID: <50D1AEE0.4020308@benibela.de> >> http://www.w3.org/2011/04/XMLSchema/TypeLibrary-IRI-RFC3987.xsd So the newest regex is the union of ((([A-Za-z])[A-Za-z0-9+\-\.]*):((//(((([A-Za-z0-9\-\._~ -??-??-???- ????-????-????-????-????-????-????-????-????-????-????-????- ????-??!$&'()*+,;=:]|(%[0-9A-Fa-f][0-9A-Fa-f]))*@))?((\[((((([0-9A-Fa-f]{0,4}:)){6}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|(::(([0-9A-Fa-f]{0,4}:)){5}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|(([0-9A-Fa-f]{0,4})?::(([0-9A-Fa-f]{0,4}:)){4}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:))?[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:)){3}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,2}[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:)){2}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,3}[0-9A-Fa-f]{0,4}))?::[0-9A-Fa-f]{0,4}:(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,4}[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,5}[0-9A-Fa-f]{0,4}))?::[0-9A-Fa-f]{0,4})|((((([0-9A-Fa-f]{0,4}:)){0,6}[0-9A-Fa-f]{0,4}))?::))|(v[0-9A-Fa-f]+\.[A-Za-z0-9\-\._~!$&'()*+,;=:]+))\])|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))|(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=]))*)((:[0-9]*))?)((/(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))*))*)|(/(((([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))+((/(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))*))*))?)|((([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))+((/(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))*))*)|)((\?(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@])|[?-???-????-??/?])*))?((#((([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@])|/|\?))*))?) and (((//(((([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????- ????-????-????-????-????-????- ????-??!$&'()*+,;=:]|(%[0-9A-Fa-f][0-9A-Fa-f]))*@))?((\[((((([0-9A-Fa-f]{0,4}:)){6}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|(::(([0-9A-Fa-f]{0,4}:)){5}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|(([0-9A-Fa-f]{0,4})?::(([0-9A-Fa-f]{0,4}:)){4}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:))?[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:)){3}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,2}[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:)){2}(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,3}[0-9A-Fa-f]{0,4}))?::[0-9A-Fa-f]{0,4}:(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,4}[0-9A-Fa-f]{0,4}))?::(([0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4})|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))))|((((([0-9A-Fa-f]{0,4}:)){0,5}[0-9A-Fa-f]{0,4}))?::[0-9A-Fa-f]{0,4})|((((([0-9A-Fa-f]{0,4}:)){0,6}[0-9A-Fa-f]{0,4}))?::))|(v[0-9A-Fa-f]+\.[A-Za-z0-9\-\._~!$&'()*+,;=:]+))\])|(([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5]))\.([0-9]|([1-9][0-9])|(1([0-9]){2})|(2[0-4][0-9])|(25[0-5])))|(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=]))*)((:[0-9]*))?)((/(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))*))*)|(/(((([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))+((/(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))*))*))?)|(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??!$&'()*+,;=@]|(%[0-9A-Fa-f][0-9A-Fa-f]))+((/(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@]))*))*))?((\?(([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@])|[?-???-????-??/?])*))?((#((([A-Za-z0-9\-\._~ -??-??-???-????-????-????-????-????-????-????-????-????-????-????- ????-????-??]|(%[0-9A-Fa-f][0-9A-Fa-f])|[!$&'()*+,;=:@])|/|\?))*))?) But that is even worse! Benito On 12/19/2012 12:41 PM, Michael Kay wrote:> Michael Sperberg-McQueen has defined types that match> different flavours of URI in>> http://www.w3.org/2011/04/XMLSchema/TypeLibrary-URI-RFC3986.xsd>> and>> http://www.w3.org/2011/04/XMLSchema/TypeLibrary-IRI-RFC3987.xsd>> To see the way these complex regular expressions are constructed, view> these documents at the raw XML level using (for example) curl.>> Michael Kay> Saxonica>>> On 19/12/2012 11:13, Benito van der Zander wrote:>> Hi,>>>> btw. has anyone a regular expression matching exactly the allowed >> anyURIs of XSD 1.0?>>>> I tried to make one by translating the BNF in RFC 2396 and 2732 to >> regex, by having a regex for every token, and substituting them >> everywhere the token is used in the BNF.>>>> But the resulting regex:>>>> ((((([a-zA-Z][a-zA-Z0-9+-.]*:)?((//(((([a-zA-Z0-9-_.!~*''();:&=+$,]|%[a-fA-F0-9]{2})*@)?((([a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?.)*[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?.?)|([0-9]+(.[0-9]+){3})|\[(([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?|([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?::([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4})*)?)(:[0-9]{1,3}(.[0-9]{1,3}){3})?\])(:[0-9]*)?)?|([a-zA-Z0-9-_.!~*''()$,;:@&=+]|%[a-fA-F0-9]{2})+)(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)?)|(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)))|(([a-zA-Z0-9-_.!~*''();@&=+$,]|%[a-fA-F0-9]{2})+(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*(/([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*(;([a-zA-Z0-9-_.!~*''():@&=+$,]|%[a-fA-F0-9]{2})*)*)*)?))([?]([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*)?)|([a-zA-Z][a-zA-Z0-9+-.]*:([a-zA-Z0-9-_.!~*''();?:@&=+$,]|%[a-fA-F0-9]{2})(([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2}))*))?(#(([;/?:@&=+$,\][a-zA-Z0-9-_.!~*''()]|%[a-fA-F0-9]{2})*))? >>>>>> is just horrible.>> (and it might not even work so well with unicode)>>>> Benito>>>>>> On 12/19/2012 10:31 AM, Michael Kay wrote:>>> The validation rules for xs:anyURI in the XSD 1.0 specification are >>> notoriously troublesome, and it is not surprising that different >>> implementors interpret them differently.>>>>>> This is what XSD 1.0 says:>>>>>> >>> The ?lexical space? of anyURI is finite-length character sequences >>> which, when the algorithm defined in Section 5.4 of [XML Linking >>> Language] is applied to them, result in strings which are legal URIs >>> according to [RFC 2396], as amended by [RFC 2732].>>>>>> Note: Spaces are, in principle, allowed in the ?lexical space? of >>> anyURI, however, their use is highly discouraged (unless they are >>> encoded by %20).>>> >>>>>> The "Note" here suggests that Sedna is wrong to reject the value (it >>> also suggests that your query is wrong to supply it, but that you >>> should be able to get away with it).>>>>>> The "algorithm" referred to in this rule is basically the escaping >>> of special characters such as space.>>>>>> Note that in XSD 1.1, the spec gives up trying to define what's >>> valid in an xs:anyURI and what isn't - all strings are now valid in >>> the lexical space of xs:anyURI.>>>>>> Michael Kay>>> Saxonica>>>>>> On 19/12/2012 09:11, Robby Pelssers wrote:>>>> Hi all,>>>>>>>>>>>> I tested following Xquery with Sedna and Zorba:>>>>>>>> declare function local:getPipUri($id as xs:string) as xs:anyURI {>>>> xs:anyURI(concat("http://www.nxp.com/pip/", $id))>>>> };>>>>>>>> local:getPipUri("CX24483 14LZ")>>>>>>>>>>>> Sedna throws an exception:>>>> 2012/12/19 10:07:09 database query/update failed (SEDNA Message: >>>> ERROR FORG0001>>>> Invalid value for cast/constructor.>>>> Details: The value does not conform to the lexical constraints >>>> defined for the xs:anyURI type.>>>> Query line: 6, column:4>>>> )>>>>>>>>>>>> http://www.zorba-xquery.com/html/demo happy returns >>>> "http://www.nxp.com/pip/CX24483 14LZ">>>>>>>> So how does the xs:anyURI cast work? Is the developer supposed to >>>> encode the String before passing it to xs:anyURI or is the anyURI >>>> function supposed to do this?>>>>>>>> Thx in advance,>>>> Robby>>>>>>>> _______________________________________________>>>> talk at x-query.com>>>> http://x-query.com/mailman/listinfo/talk>>>>>>>>>> _______________________________________________>>> talk at x-query.com>>> http://x-query.com/mailman/listinfo/talk>>>>>>>>>>> _______________________________________________>> talk at x-query.com>> http://x-query.com/mailman/listinfo/talk>>>>>> _______________________________________________> talk at x-query.com> http://x-query.com/mailman/listinfo/talk> From robby.pelssers at nxp.com Wed Dec 19 06:21:21 2012 From: robby.pelssers at nxp.com (Robby Pelssers) Date: Wed, 19 Dec 2012 14:21:21 +0000 Subject: [xquery-talk] static error [err:XPST0051]: "xs:anySimpleType": not defined as atomic type Message-ID: Hi all, I was experimenting a bit to make my code more robust but I don't fully understand why the code below complains about the local:getOrElse function. Can someone shed some light on this matter? Thx in advance, Robby (: Taken the same approach as Scala we return options which are either none or some Example of a lookup map represented in XML SOT669 SOT78B SOT404 :) declare function local:getOrElse($map as element(map), $key as xs:string, $else as xs:anySimpleType) as xs:anySimpleType { let $option := local:get($map, $key) return (if (empty($option/some)) then $else else data($option/some)) }; declare function local:get($map as element(map), $key as xs:string) as element(option) { return (if (empty($map/entry[key=$key])) then else ) }; let $map := SOT669 SOT78B SOT404 return {local:getOrElse($map, "PH3330L", "test1")} {local:getOrElse($map, "INVALID", "test1")} From robby.pelssers at nxp.com Wed Dec 19 06:54:28 2012 From: robby.pelssers at nxp.com (Robby Pelssers) Date: Wed, 19 Dec 2012 14:54:28 +0000 Subject: [xquery-talk] static error [err:XPST0051]: "xs:anySimpleType": not defined as atomic type In-Reply-To: References: Message-ID: Ok... I managed to get something working. But not sure if it is such a smart idea... Any comments from the experts? http://robbypelssers.blogspot.nl/2012/12/using-options-in-xquery.html Cheers, Robby -----Original Message----- From: Robby Pelssers Sent: Wednesday, December 19, 2012 3:21 PM To: talk at x-query.com; Robby Pelssers Subject: static error [err:XPST0051]: "xs:anySimpleType": not defined as atomic type Hi all, I was experimenting a bit to make my code more robust but I don't fully understand why the code below complains about the local:getOrElse function. Can someone shed some light on this matter? Thx in advance, Robby (: Taken the same approach as Scala we return options which are either none or some Example of a lookup map represented in XML SOT669 SOT78B SOT404 :) declare function local:getOrElse($map as element(map), $key as xs:string, $else as xs:anySimpleType) as xs:anySimpleType { let $option := local:get($map, $key) return (if (empty($option/some)) then $else else data($option/some)) }; declare function local:get($map as element(map), $key as xs:string) as element(option) { return (if (empty($map/entry[key=$key])) then else ) }; let $map := SOT669 SOT78B SOT404 return {local:getOrElse($map, "PH3330L", "test1")} {local:getOrElse($map, "INVALID", "test1")} From ihe.onwuka at gmail.com Wed Dec 19 07:40:37 2012 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Wed, 19 Dec 2012 15:40:37 +0000 Subject: [xquery-talk] static error [err:XPST0051]: "xs:anySimpleType": not defined as atomic type In-Reply-To: References: Message-ID: On Wed, Dec 19, 2012 at 2:54 PM, Robby Pelssers wrote: > Ok... > > I managed to get something working. But not sure if it is such a smart idea... Any comments from the experts? > > http://robbypelssers.blogspot.nl/2012/12/using-options-in-xquery.html > Like most of the good things in Scala this originated in Standard ML (and anybody wondering whether learning Standard ML would short circuit their Scala learning curve would IMHO be right). http://www.standardml.org/Basis/option.html PS I am not an expert. From jidanni at jidanni.org Wed Dec 19 21:45:37 2012 From: jidanni at jidanni.org (jidanni at jidanni.org) Date: Thu, 20 Dec 2012 13:45:37 +0800 Subject: [xquery-talk] let's comment out a line in XQuery Message-ID: <87d2y5jmym.fsf@jidanni.org> Geez, all I wanted to do was comment out a line: (: 120.865225,24.181802 :) But now I have to make it (: 120.865225,24.181802 :) or else I get $ basex noise.xq > noise.kml Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq: [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found. From ms at basex.org Wed Dec 19 23:41:05 2012 From: ms at basex.org (Michael Seiferle) Date: Thu, 20 Dec 2012 08:41:05 +0100 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <87d2y5jmym.fsf@jidanni.org> References: <87d2y5jmym.fsf@jidanni.org> Message-ID: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> Hi jidanni, Your particular line does not cause an error here. Tried it with the BaseX live demo (online). Your query indicates it consists of at least 26 lines, could you provide the whole query, or even better an ssce? We are using comments in XQuery on a day to basis, so I hope you're only provided with a misleading error message :-) Best Michael Am 20.12.2012 um 06:45 schrieb jidanni at jidanni.org: > Geez, all I wanted to do was comment out a line: > (: 120.865225,24.181802 :) > But now I have to make it > (: 120.865225,24.181802 :) > or else I get > $ basex noise.xq > noise.kml > Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq: > [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Thu Dec 20 00:29:33 2012 From: mike at saxonica.com (Michael Kay) Date: Thu, 20 Dec 2012 08:29:33 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <87d2y5jmym.fsf@jidanni.org> References: <87d2y5jmym.fsf@jidanni.org> Message-ID: <50D2CC6D.1000601@saxonica.com> Clearly there are contexts in which commenting out a line of code will leave a query that is syntactically or semantically invalid. Why do you find this strange? Why do you expect us to be able to tell you why the remaining query throws an error, when you haven't shown us this query? Or is this a Christmas quiz: invent a query such that removing line 26 will cause this error? Michael Kay Saxonica On 20/12/2012 05:45, jidanni at jidanni.org wrote: > Geez, all I wanted to do was comment out a line: > (: 120.865225,24.181802 :) > But now I have to make it > (: 120.865225,24.181802 :) > or else I get > $ basex noise.xq > noise.kml > Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq: > [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From dlee at calldei.com Thu Dec 20 04:18:26 2012 From: dlee at calldei.com (David Lee) Date: Thu, 20 Dec 2012 12:18:26 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <50D2CC6D.1000601@saxonica.com> References: <87d2y5jmym.fsf@jidanni.org> <50D2CC6D.1000601@saxonica.com> Message-ID: <220256FDE771B74FB662165BC562CF594A501679@CH1PRD0811MB418.namprd08.prod.outlook.com> Since I am tired this morning :) Try perusing this tread for a lively discussion on XQuery comments arkmail.org/thread/cd2nyugalcffjf3o -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Michael Kay Sent: Thursday, December 20, 2012 3:30 AM To: talk at x-query.com Subject: Re: [xquery-talk] let's comment out a line in XQuery Clearly there are contexts in which commenting out a line of code will leave a query that is syntactically or semantically invalid. Why do you find this strange? Why do you expect us to be able to tell you why the remaining query throws an error, when you haven't shown us this query? Or is this a Christmas quiz: invent a query such that removing line 26 will cause this error? Michael Kay Saxonica On 20/12/2012 05:45, jidanni at jidanni.org wrote: > Geez, all I wanted to do was comment out a line: > (: 120.865225,24.181802 :) But now I have > to make it > (: 120.865225,24.181802 :) > or else I get > $ basex noise.xq > noise.kml > Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq: > [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From dlee at calldei.com Thu Dec 20 04:19:55 2012 From: dlee at calldei.com (David Lee) Date: Thu, 20 Dec 2012 12:19:55 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <220256FDE771B74FB662165BC562CF594A501679@CH1PRD0811MB418.namprd08.prod.outlook.com> References: <87d2y5jmym.fsf@jidanni.org> <50D2CC6D.1000601@saxonica.com> <220256FDE771B74FB662165BC562CF594A501679@CH1PRD0811MB418.namprd08.prod.outlook.com> Message-ID: <220256FDE771B74FB662165BC562CF594A501697@CH1PRD0811MB418.namprd08.prod.outlook.com> Arg so tired I can't copy/paste sorry http://markmail.org/thread/cd2nyugalcffjf3o -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of David Lee Sent: Thursday, December 20, 2012 7:18 AM To: Michael Kay; talk at x-query.com Subject: Re: [xquery-talk] let's comment out a line in XQuery Since I am tired this morning :) Try perusing this tread for a lively discussion on XQuery comments arkmail.org/thread/cd2nyugalcffjf3o -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Michael Kay Sent: Thursday, December 20, 2012 3:30 AM To: talk at x-query.com Subject: Re: [xquery-talk] let's comment out a line in XQuery Clearly there are contexts in which commenting out a line of code will leave a query that is syntactically or semantically invalid. Why do you find this strange? Why do you expect us to be able to tell you why the remaining query throws an error, when you haven't shown us this query? Or is this a Christmas quiz: invent a query such that removing line 26 will cause this error? Michael Kay Saxonica On 20/12/2012 05:45, jidanni at jidanni.org wrote: > Geez, all I wanted to do was comment out a line: > (: 120.865225,24.181802 :) But now I have > to make it > (: 120.865225,24.181802 :) > or else I get > $ basex noise.xq > noise.kml > Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise.xq: > [XPTY0004] Single item expected, (120.865225,24.181802, 120.865201,24.181712) found. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From jidanni at jidanni.org Thu Dec 20 07:39:22 2012 From: jidanni at jidanni.org (jidanni at jidanni.org) Date: Thu, 20 Dec 2012 23:39:22 +0800 Subject: [xquery-talk] let's comment out a line in XQuery References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> Message-ID: <87623wivh1.fsf@jidanni.org> I don't have a Senior Secondary Certificate of Education :-) but here goes anyway. basex: Debian's 7.3-1. $ basex noise0.xq |wc Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise0.xq: [XPTY0004] Single item expected, ( ALLOW ME TO COMMENT OUT THIS LINE, ...) found. 0 0 0 $ cat noise0.xq (: # Make a map of noisy neighbors, Xquery version. # Copyright : http://www.fsf.org/copyleft/gpl.html # Author : Dan Jacobson -- http://jidanni.org/ # Created On : Sat Jan 29 17:28:12 2011 # Last Modified On: Thu Dec 20 23:29:24 2012 # Update Count : 122 :) declare option output:omit-xml-declaration "no"; declare function local:fol($f){ (: just adds lines between the first point and the rest :) {$f/*} (lines) 0 { for $p at $c in $f/*:Placemark where $c > 1 return {concat($f/*:Placemark[$c]//*:name/text()," to ", $f/*:Placemark[ 1]//*:name/text())} {concat($f/*:Placemark[$c]//*:coordinates/text()," ", $f/*:Placemark[ 1]//*:coordinates/text())} } } ; {comment {"Made by noise.xq, will get OVERWRITTEN"}} ?? Noise http://jidanni.org/me/quiet.html {local:fol( ??? 1-3 Qingfu St. 1-3 (: ALLOW ME TO COMMENT OUT THIS LINE :) 120.865201,24.181712 (: 2012/12 Google satellite :) Luo Yuntian 120.868205,24.176483 Zhong Guilin 120.866934,24.152642 Maan Nong Zhuang 120.84368,24.17268 (: ??????007?-??????? :) )} {local:fol( ??? 1-6 Qingfu St. 1-6 120.866215,24.181668 Liu Shiqing 120.86981,24.19667 (: Approx :) Wu Yuxuan 120.86981,24.18811 Chen Chunlai 120.877008,24.187393 Chen Zhenfeng 120.87456,24.18333 Dazhong 120.872499,24.200025 Liu Jinxing 120.874624,24.193282 Zeng Pingzhu 120.868530,24.183716 )} From dlee at calldei.com Thu Dec 20 07:47:05 2012 From: dlee at calldei.com (David Lee) Date: Thu, 20 Dec 2012 15:47:05 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <87623wivh1.fsf@jidanni.org> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> Message-ID: <220256FDE771B74FB662165BC562CF594A501A76@CH1PRD0811MB418.namprd08.prod.outlook.com> As per the mailing list archive link I sent yesterday. Use this to comment out data inside XML literal constructors { (: ALLOW ME TO COMMENT OUT THIS LINE :) } ... ---------------------------------------- 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 jidanni at jidanni.org Sent: Thursday, December 20, 2012 10:39 AM To: ms at basex.org Cc: talk at x-query.com Subject: Re: [xquery-talk] let's comment out a line in XQuery I don't have a Senior Secondary Certificate of Education :-) but here goes anyway. basex: Debian's 7.3-1. $ basex noise0.xq |wc Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise0.xq: [XPTY0004] Single item expected, ( ALLOW ME TO COMMENT OUT THIS LINE, ...) found. 0 0 0 $ cat noise0.xq (: # Make a map of noisy neighbors, Xquery version. # Copyright : http://www.fsf.org/copyleft/gpl.html # Author : Dan Jacobson -- http://jidanni.org/ # Created On : Sat Jan 29 17:28:12 2011 # Last Modified On: Thu Dec 20 23:29:24 2012 # Update Count : 122 :) declare option output:omit-xml-declaration "no"; declare function local:fol($f){ (: just adds lines between the first point and the rest :) {$f/*} (lines) 0 { for $p at $c in $f/*:Placemark where $c > 1 return {concat($f/*:Placemark[$c]//*:name/text()," to ", $f/*:Placemark[ 1]//*:name/text())} {concat($f/*:Placemark[$c]//*:coordinates/text()," ", $f/*:Placemark[ 1]//*:coordinates/text())} } } ; {comment {"Made by noise.xq, will get OVERWRITTEN"}} ?? Noise http://jidanni.org/me/quiet.html {local:fol( ??? 1-3 Qingfu St. 1-3 (: ALLOW ME TO COMMENT OUT THIS LINE :) 120.865201,24.181712 (: 2012/12 Google satellite :) Luo Yuntian 120.868205,24.176483 Zhong Guilin 120.866934,24.152642 Maan Nong Zhuang 120.84368,24.17268 (: ??????007?-??????? :) )} {local:fol( ??? 1-6 Qingfu St. 1-6 120.866215,24.181668 Liu Shiqing 120.86981,24.19667 (: Approx :) Wu Yuxuan 120.86981,24.18811 Chen Chunlai 120.877008,24.187393 Chen Zhenfeng 120.87456,24.18333 Dazhong 120.872499,24.200025 Liu Jinxing 120.874624,24.193282 Zeng Pingzhu 120.868530,24.183716 )} _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Thu Dec 20 08:00:09 2012 From: mike at saxonica.com (Michael Kay) Date: Thu, 20 Dec 2012 16:00:09 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <87623wivh1.fsf@jidanni.org> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> Message-ID: <50D33609.7010504@saxonica.com> Your problem is the call concat($f/*:Placemark[$c]//*:coordinates/text(), ... The first argument selects more than one text node, but the arguments to concat() must be single items. Note that you haven't actually commented anything out. When you change the content of an element constructor from to (::) the content of the element will be a text node containing " (:", an empty b element, a text node containing ":) ", an empty element, and possibly (depending on boundary-space settings) a text node containing a single space. This is because comment delimiters are not recognized inside literal element content. The use of /text() in this way is generally a bad habit. Normally if you want the value of the coordinates element, it's best just to atomize the element. You should only use text() if you want to pick out the text nodes from among the other children of the element. Michael Kay Saxonica On 20/12/2012 15:39, jidanni at jidanni.org wrote: > I don't have a Senior Secondary Certificate of Education :-) but here > goes anyway. basex: Debian's 7.3-1. > $ basex noise0.xq |wc > Stopped at line 26, column 46 in /home/jidanni/mapping/kml/noise0.xq: > [XPTY0004] Single item expected, ( ALLOW ME TO COMMENT OUT THIS LINE, ...) found. > 0 0 0 > $ cat noise0.xq > (: > # Make a map of noisy neighbors, Xquery version. > # Copyright : http://www.fsf.org/copyleft/gpl.html > # Author : Dan Jacobson -- http://jidanni.org/ > # Created On : Sat Jan 29 17:28:12 2011 > # Last Modified On: Thu Dec 20 23:29:24 2012 > # Update Count : 122 > :) > declare option output:omit-xml-declaration "no"; > declare function local:fol($f){ > (: just adds lines between the first point and the rest :) > > {$f/*} > > (lines) > 0 > { > for $p at $c in $f/*:Placemark > where $c > 1 > return > > {concat($f/*:Placemark[$c]//*:name/text()," to ", > $f/*:Placemark[ 1]//*:name/text())} > > {concat($f/*:Placemark[$c]//*:coordinates/text()," ", > $f/*:Placemark[ 1]//*:coordinates/text())} > > > } > } > ; > > {comment {"Made by noise.xq, will get OVERWRITTEN"}} > > > ?? Noise > http://jidanni.org/me/quiet.html > {local:fol( > > ??? 1-3 Qingfu St. > > 1-3 > > (: ALLOW ME TO COMMENT OUT THIS LINE :) > 120.865201,24.181712 (: 2012/12 Google satellite :) > > > > Luo Yuntian > > 120.868205,24.176483 > > > > Zhong Guilin > > 120.866934,24.152642 > > > > Maan Nong Zhuang > > 120.84368,24.17268 (: ??????007?-??????? :) > > > )} > {local:fol( > > ??? 1-6 Qingfu St. > > 1-6 > > 120.866215,24.181668 > > > > Liu Shiqing > > 120.86981,24.19667 (: Approx :) > > > > Wu Yuxuan > > 120.86981,24.18811 > > > > Chen Chunlai > > 120.877008,24.187393 > > > > Chen Zhenfeng > > 120.87456,24.18333 > > > > Dazhong > > 120.872499,24.200025 > > > > Liu Jinxing > > 120.874624,24.193282 > > > > Zeng Pingzhu > > 120.868530,24.183716 > > > )} > > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From jidanni at jidanni.org Thu Dec 20 08:12:25 2012 From: jidanni at jidanni.org (jidanni at jidanni.org) Date: Fri, 21 Dec 2012 00:12:25 +0800 Subject: [xquery-talk] let's comment out a line in XQuery References: <220256FDE771B74FB662165BC562CF594A501A76@CH1PRD0811MB418.namprd08.prod.outlook.com> Message-ID: <871uekitxy.fsf@jidanni.org> OK. In my brain (which only has room for one comment syntax per language) I will now try to remember {(: comment :)()} as the REAL XQuery comment syntax (the one that is guaranteed not to fail, the one that gets even tough stains out), and any simplifications thereof e.g., (: comment :) as mere shortcuts that will sometimes fail. I hope that is fair, assuming I only want to remember one comment syntax. (No I don't want to use as that ends up in the laundry.) From dlee at calldei.com Thu Dec 20 08:25:33 2012 From: dlee at calldei.com (David Lee) Date: Thu, 20 Dec 2012 16:25:33 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <871uekitxy.fsf@jidanni.org> References: <220256FDE771B74FB662165BC562CF594A501A76@CH1PRD0811MB418.namprd08.prod.outlook.com> <871uekitxy.fsf@jidanni.org> Message-ID: <220256FDE771B74FB662165BC562CF594A501AD6@CH1PRD0811MB418.namprd08.prod.outlook.com> Sorry, you need to make a bit more room in your brain. The proper syntax is context specific. And I made a mistake in my example. double bad :) inside an element constructor you need this: {()(:comment:)} other places you use (: comment :) but realize that produces nothing, not the empty sequence so some places it wont work and you might need ()(:comment:) its actually quite easy once you learn the syntax. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: jidanni at jidanni.org [mailto:jidanni at jidanni.org] Sent: Thursday, December 20, 2012 11:12 AM To: David Lee Cc: ms at basex.org; talk at x-query.com Subject: Re: [xquery-talk] let's comment out a line in XQuery OK. In my brain (which only has room for one comment syntax per language) I will now try to remember {(: comment :)()} as the REAL XQuery comment syntax (the one that is guaranteed not to fail, the one that gets even tough stains out), and any simplifications thereof e.g., (: comment :) as mere shortcuts that will sometimes fail. I hope that is fair, assuming I only want to remember one comment syntax. (No I don't want to use as that ends up in the laundry.) From jidanni at jidanni.org Thu Dec 20 08:47:05 2012 From: jidanni at jidanni.org (jidanni at jidanni.org) Date: Fri, 21 Dec 2012 00:47:05 +0800 Subject: [xquery-talk] let's comment out a line in XQuery References: <220256FDE771B74FB662165BC562CF594A501AD6@CH1PRD0811MB418.namprd08.prod.outlook.com> Message-ID: <87wqwchdrq.fsf@jidanni.org> OK, I will try various combinations of these in various situations. I just wish Google searches wouldn't always just come up with (: :) when in fact one often needs "the heavy pliers" instead. DL> its actually quite easy once you learn the syntax. I'm sure it must be, but I just want to... http://www.google.com/search?q=Big+Daddy+Kane+I+get+the+job+done get the job done. From sokolov at ifactory.com Fri Dec 21 05:08:35 2012 From: sokolov at ifactory.com (Michael Sokolov) Date: Fri, 21 Dec 2012 08:08:35 -0500 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <50D33609.7010504@saxonica.com> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> <50D33609.7010504@saxonica.com> Message-ID: <50D45F53.50904@ifactory.com> On 12/20/2012 11:00 AM, Michael Kay wrote: > > Note that you haven't actually commented anything out. When you change > the content of an element constructor from > > > > to > > (::) So to achieve the intended effect (no nodes where is, not even a comment node), one would need: {(::)()} ? That's a lot of punctuation. I think this has been batted around here before, but would somebody mind refreshing us as to whether there is any good reason plain {} doesn't generate () (an empty sequence)? -Mike From dlee at calldei.com Fri Dec 21 06:32:28 2012 From: dlee at calldei.com (David Lee) Date: Fri, 21 Dec 2012 14:32:28 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <50D45F53.50904@ifactory.com> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> <50D33609.7010504@saxonica.com> <50D45F53.50904@ifactory.com> Message-ID: <220256FDE771B74FB662165BC562CF594A502274@CH1PRD0811MB418.namprd08.prod.outlook.com> ------------------ I think this has been batted around here before, but would somebody mind refreshing us as to whether there is any good reason plain {} doesn't generate () (an empty sequence)? --------------- If you want historical rationality you will have to ask someone else. If you want deductive logic ... { expr } parses expr ... it returns whatever expr is. If there is nothing there then thats nothing. () is not nothing, its something. So it would be silly and inconsistent if {} produced something rather than nothing. The only time that I can see that it is actually inconvenient ("annoying"?) that {} produces nothing rather then something is in this particular case with comments embedded within literal constructors. Buy why single out () as the something it should produce ? There is nothing special about the empty sequence that makes it the best candidate for a fillin for nothing. Also there is the other use of {} which is in functions declare function x () { }; Which is rightfully an error because there is no expression and should be. Although one could argue that it should be treated as declare function x () { ()}; But then one could argue that in C foo() { } should be treated as foo() { return NULL ; } But that would be silly now wouldn't it ? In the end I am not going to try to justify this rule in XQuery ... it just is the way it is. ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation dlee at marklogic.com Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com From sokolov at ifactory.com Fri Dec 21 06:38:09 2012 From: sokolov at ifactory.com (Mike Sokolov) Date: Fri, 21 Dec 2012 09:38:09 -0500 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <220256FDE771B74FB662165BC562CF594A502274@CH1PRD0811MB418.namprd08.prod.outlook.com> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> <50D33609.7010504@saxonica.com> <50D45F53.50904@ifactory.com> <220256FDE771B74FB662165BC562CF594A502274@CH1PRD0811MB418.namprd08.prod.outlook.com> Message-ID: <50D47451.1020508@ifactory.com> On 12/21/2012 09:32 AM, David Lee wrote: > ------------------ > I think this has been batted around here before, but would somebody mind > refreshing us as to whether there is any good reason plain {} doesn't > generate () (an empty sequence)? > --------------- > > If you want historical rationality you will have to ask someone else. > > > If you want deductive logic ... > > { expr } parses expr ... it returns whatever expr is. If there is nothing there then thats nothing. () is not nothing, its something. So it would be silly and inconsistent if {} produced something rather than nothing. > Actually I think () is the closest we have to null and void in xquery, so it seems consistent and logical to me :) > Also there is the other use of {} which is in functions > > declare function x () { }; > > > Which is rightfully an error because there is no expression and should be. > Although one could argue that it should be treated as > declare function x () { ()}; > Yes I would > But then one could argue that in C > > foo() { } > > should be treated as > foo() { return NULL ; } > > But that would be silly now wouldn't it ? > > Actually my compiler allows "void foo () { }" - why not? A function that does nothing could be very useful sometimes. "foo () { }" is bad because implicitly it is declared as returning int, yet does not return anything. From dlee at calldei.com Fri Dec 21 06:40:55 2012 From: dlee at calldei.com (David Lee) Date: Fri, 21 Dec 2012 14:40:55 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <50D47451.1020508@ifactory.com> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> <50D33609.7010504@saxonica.com> <50D45F53.50904@ifactory.com> <220256FDE771B74FB662165BC562CF594A502274@CH1PRD0811MB418.namprd08.prod.outlook.com> <50D47451.1020508@ifactory.com> Message-ID: <220256FDE771B74FB662165BC562CF594A5022CC@CH1PRD0811MB418.namprd08.prod.outlook.com> ------------- Actually my compiler allows "void foo () { }" - why not? A function that does nothing could be very useful sometimes. "foo () { }" is bad because implicitly it is declared as returning int, yet does not return anything. ----------- Which is why I used as an example foo() {} which in K&R C means int foo() {} not void foo() {} in XQuery declare function foo() {} is bad for precisely the same reason as functions *always* have a return type. (no void). But what should it be ? ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation dlee at marklogic.com Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com From ihe.onwuka at gmail.com Fri Dec 21 06:43:18 2012 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Fri, 21 Dec 2012 14:43:18 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <50D45F53.50904@ifactory.com> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> <50D33609.7010504@saxonica.com> <50D45F53.50904@ifactory.com> Message-ID: On Fri, Dec 21, 2012 at 1:08 PM, Michael Sokolov wrote: > On 12/20/2012 11:00 AM, Michael Kay wrote: >> >> >> Note that you haven't actually commented anything out. When you change the >> content of an element constructor from >> >> >> >> to >> >> (::) > > So to achieve the intended effect (no nodes where is, not even a > comment node), one would need: > > {(::)()} > > ? That's a lot of punctuation. > > I think this has been batted around here before, http://www.stylusstudio.com/xquerytalk/201207/003932.html From mike at saxonica.com Fri Dec 21 06:49:53 2012 From: mike at saxonica.com (Michael Kay) Date: Fri, 21 Dec 2012 14:49:53 +0000 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <50D45F53.50904@ifactory.com> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> <50D33609.7010504@saxonica.com> <50D45F53.50904@ifactory.com> Message-ID: <50D47711.8060906@saxonica.com> ... whether there is any good reason plain {} doesn't generate () (an empty sequence)? I'm not aware that the idea has ever been proposed and discussed in the WG. I've no idea whether it would find favour. Probably not; minor tweaking for minor usability benefits doesn't usually attract much enthusiasm. You might find someone in the WG has grand ideas to use the same syntax for something else, like an empty map or array, and wants to hold it in reserve for that, and on past experience that would probably win the argument. Michael Kay Saxonica From christian.gruen at gmail.com Fri Dec 21 06:55:47 2012 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Fri, 21 Dec 2012 15:55:47 +0100 Subject: [xquery-talk] [ANN] BaseX 7.5 -- The BaseXMas Edition Message-ID: Dear all, we are excited to announce the release of BaseX 7.5, aka the BaseXMas Edition: http://basex.org/downloads The latest features and changes are as follows: XQUERY UPDATE - bulk updates are now much faster than before - insert and replace operations take much less memory - databases can now be created via XQuery and db:create() GUI TEXT EDITOR - a fast and flexible search/replace panel has been added - error highlighting has been extended to XML files - the editor was improved for editing arbitrary text files XQUERY 3.0 - the code has been aligned with latest changes in the specs - HTML5 support has been updated WEB APPLICATIONS - new modules have been added: Request, Session, Sessions - logging has been revised and extended to HTTP requests - SSL support added, switched to Jetty 8 - all operation modes have been unified and simplified - RESTXQ elements added to simplify forwarding and redirects CORE FEATURES - improved stability of concurrent read/write operations - the INSPECT command performs database sanity checks - EXECUTE triggers the execution of command scripts Numerous other updates can be found in our documentation (http://docs.basex.org). Your feedback is welcome. Christian BaseX Team 2012 PS: We hope to see you all on the XMLPrague Conference 2013! If you haven?t registered yet, you are invited to join our BaseX User Meeting: http://lanyrd.com/2013/basex-users-meetup-xml-prague From sokolov at ifactory.com Fri Dec 21 07:11:09 2012 From: sokolov at ifactory.com (Mike Sokolov) Date: Fri, 21 Dec 2012 10:11:09 -0500 Subject: [xquery-talk] let's comment out a line in XQuery In-Reply-To: <220256FDE771B74FB662165BC562CF594A5022CC@CH1PRD0811MB418.namprd08.prod.outlook.com> References: <7FFDA618-AC2D-494A-9ACA-33A7D46EB515@basex.org> <87623wivh1.fsf@jidanni.org> <50D33609.7010504@saxonica.com> <50D45F53.50904@ifactory.com> <220256FDE771B74FB662165BC562CF594A502274@CH1PRD0811MB418.namprd08.prod.outlook.com> <50D47451.1020508@ifactory.com> <220256FDE771B74FB662165BC562CF594A5022CC@CH1PRD0811MB418.namprd08.prod.outlook.com> Message-ID: <50D47C0D.2020100@ifactory.com> On 12/21/2012 09:40 AM, David Lee wrote: > in XQuery > > declare function foo() {} > > is bad for precisely the same reason as functions *always* have a return type. > (no void). But what should it be ? > Again, empty-sequence() is the only logical choice. Better than an error in my book. From member at linkedin.com Fri Dec 21 15:39:06 2012 From: member at linkedin.com (=?UTF-8?Q?Christian_Gr=C3=BCn_via_LinkedIn?=) Date: Fri, 21 Dec 2012 23:39:06 +0000 (UTC) Subject: [xquery-talk] Join my network on LinkedIn Message-ID: <845810670.14020112.1356133146444.JavaMail.app@ela4-app2310.prod> LinkedIn ------------ Christian Gr?n has indicated you are a Friend ------------------------------------------ Since you are a person I trust, I wanted to invite you to join my network on LinkedIn. Accept invitation from Christian Gr?n http://www.linkedin.com/e/xnupbm-hazynsqq-6d/kDd-YG5BG4ZUACXjkyk-G9jZp24/blk/I384377797_12/3wOtCVFbmdxnSVFbm8JrnpKqlZJrmZzbmNJpjRQnOpBtn9QfmhBt71BoSd1p65Lr6lOfP8NnPsVdPsTcPgUcQALhRhbi2RKp6YLd3cNc3oTdPgNc34LrCBxbOYWrSlI/eml-comm_invm-b-in_ac-inv28/?hs=false&tok=3xGq4sF4XHUlw1 View profile of Christian Gr?n http://www.linkedin.com/e/xnupbm-hazynsqq-6d/rso/1401638/j1Xp/name/94457480_I384377797_12/?hs=false&tok=0NJzgrz23HUlw1 ------------------------------------------ You are receiving Invitation emails. This email was intended for Ihe Onwuka. Learn why this is included: http://www.linkedin.com/e/xnupbm-hazynsqq-6d/plh/http%3A%2F%2Fhelp%2Elinkedin%2Ecom%2Fapp%2Fanswers%2Fdetail%2Fa_id%2F4788/-GXI/?hs=false&tok=0vplFFC6XHUlw1 (c) 2012, LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jidanni at jidanni.org Sat Dec 22 15:09:58 2012 From: jidanni at jidanni.org (jidanni at jidanni.org) Date: Sun, 23 Dec 2012 07:09:58 +0800 Subject: [xquery-talk] let's comment out a line in XQuery References: <50D33609.7010504@saxonica.com> Message-ID: <87k3s91y61.fsf@jidanni.org> >>>>> "MK" == Michael Kay writes: MK> The use of /text() in this way is generally a bad habit. Thanks! I removed them and my program worked just as fine! (Not Cc'd so didn't notice your comment until now.) From jidanni at jidanni.org Thu Dec 27 02:03:59 2012 From: jidanni at jidanni.org (jidanni at jidanni.org) Date: Thu, 27 Dec 2012 18:03:59 +0800 Subject: [xquery-talk] Basex: using all of -i, -c and -q Message-ID: <87pq1vizg0.fsf@jidanni.org> I tried to use all of -i, -c, and -q, but in the end the only thing for me that worked was $ basex -q 'declare option db:parser "html"; doc("bla.html")' so maybe it is not possible. P.S., I tried to send this to the right list, alas, : host cytosin.uni-konstanz.de[134.34.240.61] said: 550 #5.1.0 Address rejected. (in reply to RCPT TO command)