From swetakedia at gmail.com Sat Jan 2 01:10:36 2010 From: swetakedia at gmail.com (Sweta Kedia) Date: Fri Jan 1 11:30:18 2010 Subject: [xquery-talk] Substring of an attribute. Message-ID: <5cd259e51001011140v6daee04drc1976d161c93d90e@mail.gmail.com> Hello, I want to take substring from the value of attribute and compare it with other string.Here is the sample xml files and sample xquery code. This is first File. <*bvf:DocumentAndEntityInformationAbstract* id="*DIM820*" contextRef="* I2008_AccumulatedOtherComprehensiveIncomeMember*" unitRef="*USD*" decimals=" *-3*">62582000 1038608000 199904000 199904000 This is second File - <#> I am trying to take element name from first file and translating ":" into "-". Then i want to take attribute value of element and take substring of attribute affter "#" and compare with element name from first file. If the comparison is equal , I want all the elements. This is xquery code: for $x in fn:doc("C:/Users/A/Documents/Sweta/users/sweta231119791251796126671/Other/2008/Quarterly/2nd Quarterly/bvf-20081231/bvf-20081231.xml")//*[@contextRef and @unitRef] for $s in fn:doc("C:/Users/A/Documents/Sweta/users/sweta231119791251796126671/Other/2008/Quarterly/2nd Quarterly/bvf-20081231/bvf-20081231_pre.xml")/linkbase/presentationLink return if(compare($s/loc[substring-after(@xlink:href,'#')],translate(name($x),':','_'))=0) then $s/loc else count($s/loc) T*his query is giving error. Please suggest how can i do this. Thanks Sweta. * On Wed, Dec 23, 2009 at 1:30 AM, wrote: > Send talk mailing list submissions to > talk@x-query.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://x-query.com/mailman/listinfo/talk > or, via email, send a message with subject or body 'help' to > talk-request@x-query.com > > You can reach the person managing the list at > talk-owner@x-query.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of talk digest..." > > > Today's Topics: > > 1. Follow Up Re: [xquery-talk] [ANN] XML Prague 2010 Final Call > for Participation (CFP) (James Fuller) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 22 Dec 2009 18:27:49 +0100 > From: James Fuller > Subject: Follow Up Re: [xquery-talk] [ANN] XML Prague 2010 Final Call > for Participation (CFP) > To: Daniela Florescu > Cc: xquery-discuss > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-2 > > as promised, here is a more official followup from the University > about speakers presentations and published papers. > > * In Czech law copyright is always implicit and remains with the > original author, unless an explicit agreement (Copyright Transfer > Agreement) is signed by the Author. The copyright symbol has no real > meaning in legal terms so it being attached or not means naught. > > * as for licensing, If there is no written agreement about license > terms in Czech, authors are always giving non-exclusive rights to > publishers as default setting. > > * In last years proceedings you will see the following copyrights asserted > > Copyright (c) 2009 Ji?? Kosek, V?t Janota > Copyright (c) 2009 MATFYZPRESS, vydavatelstv? Matematicko-fyzik?ln? fakulty > > Copyright of individual articles remains in hands of original authors. > > MATFYZPRESS retains copyright only on the cover pages, whilst Mr. > Kosek and Mr. Janota retain copyright on the design and > ordering/layout of the articles. Once again, by czech law, the > copyright symbols themselves mean nothing and all rights would get > asserted based on authorship or separate signed agreements. > > hope that clears up any misunderstandings. > > regards, Jim Fuller > > > On Thu, Dec 17, 2009 at 6:56 PM, Daniela Florescu > wrote: > > James, Michael, > > > > thanks for your answers. > > > > I think my question wasn't clear. > > > > XML Prague has to take a clear decision about the status of the papers: > > (a) are they part of an informal proceedings (in which case they can be > > submitted > > somewhere else without infringing any copyright and affecting prior > > publication > > status), or (b) they are part of a copyrighted publication (in which > case > > they cannot). > > > > The Web site doesn't say either way, and that causes problems. > > [[ I understand from James's answer that (a) is what is meant to be, but > > it's not clear...]] > > [[ and unfortunately, being published "on the Web" can be interpreted > either > > way...]] > > > > For example, if a student submits a research proposal to XML Prague, and > > sends it > > in the same time to a copyrighted publication (like Sigmod), then Sigmod > > had serious > > grounds for rejecting the submission because of the lack of clarity of > the > > XML Prague > > web site about this issue. > > > > The students I am working with are worried about this. Copyrights are > > serious business > > in their world. > > > > Thanks, best regards > > Dana > > > > > > > > > > > > > > > > > > > > > > > > > > On Dec 17, 2009, at 1:33 AM, Michael Kay wrote: > > > >>> > >>> here is link to 2007 proceedings > >>> > >>> http://www.xmlprague.cz/2007/images/xmlprague2007.pdf > >>> > >>> to give you an idea. > >>> > >> > >> Having attended and spoken at several past events, but not being in any > >> way > >> involved in the organisation, I would say: concentrate on saying > something > >> that is going to be interesting to the audience, and not commercial; > don't > >> worry too much about the academic criteria of originality or full > >> citations > >> of previous related work. For example, if you were to talk on scripting > in > >> XQuery, present the current state of play, not the delta changes that > have > >> occurred in the three months since your last paper on the subject. > No-one > >> except other researchers in your own field wants to hear that kind of > >> paper, > >> and this is not primarily a conference where you are addressing other > >> researchers in your own field. > >> > >> It is (or has been in the past) a single-stream conference, which means > >> your > >> audience is less specialized. This also means that because everyone is > >> present at the same talks, speakers get a lot of opportunity to relate > >> their > >> work to other things that have been discussed in the conference, which > >> makes > >> it a more interactive experience. > >> > >> Michael Kay > >> > >> > > > > > > > ------------------------------ > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > > End of talk Digest, Vol 80, Issue 12 > ************************************ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100102/722426cc/attachment.htm From gkholman at CraneSoftwrights.com Fri Jan 1 17:28:15 2010 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Fri Jan 1 14:16:39 2010 Subject: [xquery-talk] Substring of an attribute. In-Reply-To: <5cd259e51001011140v6daee04drc1976d161c93d90e@mail.gmail.co m> References: <5cd259e51001011140v6daee04drc1976d161c93d90e@mail.gmail.com> Message-ID: <7.0.1.0.2.20100101171953.025b7d28@wheresmymailserver.com> At 2010-01-02 01:10 +0530, Sweta Kedia wrote: >I want to take substring from the value of attribute and compare it >with other string.Here is the sample xml files and sample xquery code. This is what you are asking for: substring-after(@xlink:href,'#') eq translate(name($x),':','_')] >This is first File. >... >This is second File >... >I am trying to take element name from first file and translating ":" >into "-". Then i want to take attribute value of element and >take substring of attribute affter "#" and compare with element name >from first file. >If the comparison is equal , I want all the elements. > >This is xquery code: >... >This query is giving error. Please suggest how can i do this. It would really help volunteers to know what the problem is you are having. And to give XML fragments volunteers can use that will work with your query. For example, your query has a reference to an element named linkbase which is not in the XML. But I've tried to recreate your example below ... I hope this helps. . . . . . . . . . . . . Ken T:\ftemp>type bvf-20081231.xml 62582000 1038608000 199904000 199904000 T:\ftemp>type bvf-20081231_pre.xml T:\ftemp>type sweta.xq declare namespace xlink = "http://www.w3.org/1999/xlink"; for $x in fn:doc("bvf-20081231.xml")//*[@contextRef and @unitRef] for $s in fn:doc("bvf-20081231_pre.xml")//presentationLink return if($s/loc[substring-after(@xlink:href,'#') eq translate(name($x),':','_')]) then $s/loc else count($s/loc) T:\ftemp>xquery sweta.xq 2 2 2 T:\ftemp> -- UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/q/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal From mike at saxonica.com Sat Jan 2 00:30:24 2010 From: mike at saxonica.com (Michael Kay) Date: Fri Jan 1 16:14:02 2010 Subject: [xquery-talk] Substring of an attribute. In-Reply-To: <5cd259e51001011140v6daee04drc1976d161c93d90e@mail.gmail.com> References: <5cd259e51001011140v6daee04drc1976d161c93d90e@mail.gmail.com> Message-ID: <98C4629028D34945BA2AA09B709F644C@Sealion> > This query is giving error. Hey, we all enjoy doing puzzles over the holiday. But puzzles are more fun when you give people clues. Just to make it a bit easier, could you tell us the error message? Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay _____ From: talk-bounces@x-query.com [mailto:talk-bounces@x-query.com] On Behalf Of Sweta Kedia Sent: 01 January 2010 19:41 To: talk@x-query.com Subject: [xquery-talk] Substring of an attribute. Hello, I want to take substring from the value of attribute and compare it with other string.Here is the sample xml files and sample xquery code. This is first File. 62582000 1038608000 199904000 199904000 This is second File - I am trying to take element name from first file and translating ":" into "-". Then i want to take attribute value of element and take substring of attribute affter "#" and compare with element name from first file. If the comparison is equal , I want all the elements. This is xquery code: for $x in fn:doc("C:/Users/A/Documents/Sweta/users/sweta231119791251796126671/Other/20 08/Quarterly/2nd Quarterly/bvf-20081231/bvf-20081231.xml")//*[@contextRef and @unitRef] for $s in fn:doc("C:/Users/A/Documents/Sweta/users/sweta231119791251796126671/Other/20 08/Quarterly/2nd Quarterly/bvf-20081231/bvf-20081231_pre.xml")/linkbase/presentationLink return if(compare($s/loc[substring-after(@xlink:href,'#')],translate(name($x),':',' _'))=0) then $s/loc else count($s/loc) This query is giving error. Please suggest how can i do this. Thanks Sweta. On Wed, Dec 23, 2009 at 1:30 AM, wrote: Send talk mailing list submissions to talk@x-query.com To subscribe or unsubscribe via the World Wide Web, visit http://x-query.com/mailman/listinfo/talk or, via email, send a message with subject or body 'help' to talk-request@x-query.com You can reach the person managing the list at talk-owner@x-query.com When replying, please edit your Subject line so it is more specific than "Re: Contents of talk digest..." Today's Topics: 1. Follow Up Re: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) (James Fuller) ---------------------------------------------------------------------- Message: 1 Date: Tue, 22 Dec 2009 18:27:49 +0100 From: James Fuller Subject: Follow Up Re: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) To: Daniela Florescu Cc: xquery-discuss Message-ID: Content-Type: text/plain; charset=ISO-8859-2 as promised, here is a more official followup from the University about speakers presentations and published papers. * In Czech law copyright is always implicit and remains with the original author, unless an explicit agreement (Copyright Transfer Agreement) is signed by the Author. The copyright symbol has no real meaning in legal terms so it being attached or not means naught. * as for licensing, If there is no written agreement about license terms in Czech, authors are always giving non-exclusive rights to publishers as default setting. * In last years proceedings you will see the following copyrights asserted Copyright (c) 2009 Ji?? Kosek, V?t Janota Copyright (c) 2009 MATFYZPRESS, vydavatelstv? Matematicko-fyzik?ln? fakulty Copyright of individual articles remains in hands of original authors. MATFYZPRESS retains copyright only on the cover pages, whilst Mr. Kosek and Mr. Janota retain copyright on the design and ordering/layout of the articles. Once again, by czech law, the copyright symbols themselves mean nothing and all rights would get asserted based on authorship or separate signed agreements. hope that clears up any misunderstandings. regards, Jim Fuller On Thu, Dec 17, 2009 at 6:56 PM, Daniela Florescu wrote: > James, Michael, > > thanks for your answers. > > I think my question wasn't clear. > > XML Prague has to take a clear decision about the status of the papers: > (a) are they part of an informal proceedings (in which case they can be > submitted > somewhere else without infringing any copyright and affecting prior > publication > status), or (b) they are part of a copyrighted publication (in which case > they cannot). > > The Web site doesn't say either way, and that causes problems. > [[ I understand from James's answer that (a) is what is meant to be, but > it's not clear...]] > [[ and unfortunately, being published "on the Web" can be interpreted either > way...]] > > For example, if a student submits a research proposal to XML Prague, and > sends it > in the same time to a copyrighted publication (like Sigmod), then Sigmod > had serious > grounds for rejecting the submission because of the lack of clarity of the > XML Prague > web site about this issue. > > The students I am working with are worried about this. Copyrights are > serious business > in their world. > > Thanks, best regards > Dana > > > > > > > > > > > > > On Dec 17, 2009, at 1:33 AM, Michael Kay wrote: > >>> >>> here is link to 2007 proceedings >>> >>> http://www.xmlprague.cz/2007/images/xmlprague2007.pdf >>> >>> to give you an idea. >>> >> >> Having attended and spoken at several past events, but not being in any >> way >> involved in the organisation, I would say: concentrate on saying something >> that is going to be interesting to the audience, and not commercial; don't >> worry too much about the academic criteria of originality or full >> citations >> of previous related work. For example, if you were to talk on scripting in >> XQuery, present the current state of play, not the delta changes that have >> occurred in the three months since your last paper on the subject. No-one >> except other researchers in your own field wants to hear that kind of >> paper, >> and this is not primarily a conference where you are addressing other >> researchers in your own field. >> >> It is (or has been in the past) a single-stream conference, which means >> your >> audience is less specialized. This also means that because everyone is >> present at the same talks, speakers get a lot of opportunity to relate >> their >> work to other things that have been discussed in the conference, which >> makes >> it a more interactive experience. >> >> Michael Kay >> >> > > ------------------------------ _______________________________________________ talk@x-query.com http://x-query.com/mailman/listinfo/talk End of talk Digest, Vol 80, Issue 12 ************************************ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100102/e427d8b0/attachment-0001.htm From mike at saxonica.com Mon Jan 4 08:43:59 2010 From: mike at saxonica.com (Michael Kay) Date: Mon Jan 4 00:19:05 2010 Subject: [xquery-talk] Substring of an attribute. In-Reply-To: <5cd259e51001032033t3650d4c0ue2353e9d7cf86f22@mail.gmail.com> References: <5cd259e51001011140v6daee04drc1976d161c93d90e@mail.gmail.com> <98C4629028D34945BA2AA09B709F644C@Sealion> <5cd259e51001032033t3650d4c0ue2353e9d7cf86f22@mail.gmail.com> Message-ID: <9402B6A828D74FACB7884EF5BC114C48@Sealion> _____ From: Sweta Kedia [mailto:swetakedia@gmail.com] Sent: 04 January 2010 04:33 To: Michael Kay Subject: Re: [xquery-talk] Substring of an attribute. Hi, The Error message I am getting is XPTY0004: A sequence of more than one item is not allowed as the first argument of compare() ("", "", ...) Thank you. That tells us exactly what is wrong: there is more than one $s/loc element, and you can't compare them all at once. However, you haven't made it clear what output you want, for example in the case where one element satisfies the condition and other elements do not. I can't tell you how to correct your code because you haven't explained the requirements clearly. You could replace compare($s/loc[EXP], translate(...))=0 by $s/loc[EXP]=translate(...) -- that would test whether ANY of the $s/loc elements satisfies the condition. But I don't know if that's the right logic for you. Michael Kay (P.S. You replied off list, I'm sure that was unintentional). 2010/1/2 Michael Kay > This query is giving error. Hey, we all enjoy doing puzzles over the holiday. But puzzles are more fun when you give people clues. Just to make it a bit easier, could you tell us the error message? Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay _____ From: talk-bounces@x-query.com [mailto:talk-bounces@x-query.com] On Behalf Of Sweta Kedia Sent: 01 January 2010 19:41 To: talk@x-query.com Subject: [xquery-talk] Substring of an attribute. Hello, I want to take substring from the value of attribute and compare it with other string.Here is the sample xml files and sample xquery code. This is first File. 62582000 1038608000 199904000 199904000 This is second File - <> I am trying to take element name from first file and translating ":" into "-". Then i want to take attribute value of element and take substring of attribute affter "#" and compare with element name from first file. If the comparison is equal , I want all the elements. This is xquery code: for $x in fn:doc("C:/Users/A/Documents/Sweta/users/sweta231119791251796126671/Other/20 08/Quarterly/2nd Quarterly/bvf-20081231/bvf-20081231.xml")//*[@contextRef and @unitRef] for $s in fn:doc("C:/Users/A/Documents/Sweta/users/sweta231119791251796126671/Other/20 08/Quarterly/2nd Quarterly/bvf-20081231/bvf-20081231_pre.xml")/linkbase/presentationLink return if(compare($s/loc[substring-after(@xlink:href,'#')],translate(name($x),':',' _'))=0) then $s/loc else count($s/loc) This query is giving error. Please suggest how can i do this. Thanks Sweta. On Wed, Dec 23, 2009 at 1:30 AM, wrote: Send talk mailing list submissions to talk@x-query.com To subscribe or unsubscribe via the World Wide Web, visit http://x-query.com/mailman/listinfo/talk or, via email, send a message with subject or body 'help' to talk-request@x-query.com You can reach the person managing the list at talk-owner@x-query.com When replying, please edit your Subject line so it is more specific than "Re: Contents of talk digest..." Today's Topics: 1. Follow Up Re: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) (James Fuller) ---------------------------------------------------------------------- Message: 1 Date: Tue, 22 Dec 2009 18:27:49 +0100 From: James Fuller Subject: Follow Up Re: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) To: Daniela Florescu Cc: xquery-discuss Message-ID: Content-Type: text/plain; charset=ISO-8859-2 as promised, here is a more official followup from the University about speakers presentations and published papers. * In Czech law copyright is always implicit and remains with the original author, unless an explicit agreement (Copyright Transfer Agreement) is signed by the Author. The copyright symbol has no real meaning in legal terms so it being attached or not means naught. * as for licensing, If there is no written agreement about license terms in Czech, authors are always giving non-exclusive rights to publishers as default setting. * In last years proceedings you will see the following copyrights asserted Copyright (c) 2009 Ji?? Kosek, V?t Janota Copyright (c) 2009 MATFYZPRESS, vydavatelstv? Matematicko-fyzik?ln? fakulty Copyright of individual articles remains in hands of original authors. MATFYZPRESS retains copyright only on the cover pages, whilst Mr. Kosek and Mr. Janota retain copyright on the design and ordering/layout of the articles. Once again, by czech law, the copyright symbols themselves mean nothing and all rights would get asserted based on authorship or separate signed agreements. hope that clears up any misunderstandings. regards, Jim Fuller On Thu, Dec 17, 2009 at 6:56 PM, Daniela Florescu wrote: > James, Michael, > > thanks for your answers. > > I think my question wasn't clear. > > XML Prague has to take a clear decision about the status of the papers: > (a) are they part of an informal proceedings (in which case they can be > submitted > somewhere else without infringing any copyright and affecting prior > publication > status), or (b) they are part of a copyrighted publication (in which case > they cannot). > > The Web site doesn't say either way, and that causes problems. > [[ I understand from James's answer that (a) is what is meant to be, but > it's not clear...]] > [[ and unfortunately, being published "on the Web" can be interpreted either > way...]] > > For example, if a student submits a research proposal to XML Prague, and > sends it > in the same time to a copyrighted publication (like Sigmod), then Sigmod > had serious > grounds for rejecting the submission because of the lack of clarity of the > XML Prague > web site about this issue. > > The students I am working with are worried about this. Copyrights are > serious business > in their world. > > Thanks, best regards > Dana > > > > > > > > > > > > > On Dec 17, 2009, at 1:33 AM, Michael Kay wrote: > >>> >>> here is link to 2007 proceedings >>> >>> http://www.xmlprague.cz/2007/images/xmlprague2007.pdf >>> >>> to give you an idea. >>> >> >> Having attended and spoken at several past events, but not being in any >> way >> involved in the organisation, I would say: concentrate on saying something >> that is going to be interesting to the audience, and not commercial; don't >> worry too much about the academic criteria of originality or full >> citations >> of previous related work. For example, if you were to talk on scripting in >> XQuery, present the current state of play, not the delta changes that have >> occurred in the three months since your last paper on the subject. No-one >> except other researchers in your own field wants to hear that kind of >> paper, >> and this is not primarily a conference where you are addressing other >> researchers in your own field. >> >> It is (or has been in the past) a single-stream conference, which means >> your >> audience is less specialized. This also means that because everyone is >> present at the same talks, speakers get a lot of opportunity to relate >> their >> work to other things that have been discussed in the conference, which >> makes >> it a more interactive experience. >> >> Michael Kay >> >> > > ------------------------------ _______________________________________________ talk@x-query.com http://x-query.com/mailman/listinfo/talk End of talk Digest, Vol 80, Issue 12 ************************************ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100104/b25efb35/attachment-0001.htm From andrew.j.welch at gmail.com Tue Jan 5 16:35:04 2010 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue Jan 5 08:27:03 2010 Subject: [xquery-talk] comments Message-ID: <74a894af1001050835h57d45ceegaa544f5de3e9ec27@mail.gmail.com> Hi, This xquery: (: comment one :)

{ (: comment two :) 1 to 10 }

produces this result: (: comment one :)

1 2 3 4 5 6 7 8 9 10

The fact that the first comment appears in the output seems odd to me... is that meant to happen, and if so what is the correct way to put a comment there? thanks andrew From gkholman at CraneSoftwrights.com Tue Jan 5 11:45:29 2010 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Tue Jan 5 08:37:20 2010 Subject: [xquery-talk] comments In-Reply-To: <74a894af1001050835h57d45ceegaa544f5de3e9ec27@mail.gmail.co m> References: <74a894af1001050835h57d45ceegaa544f5de3e9ec27@mail.gmail.com> Message-ID: <7.0.1.0.2.20100105114405.0262de40@wheresmymailserver.com> At 2010-01-05 16:35 +0000, Andrew Welch wrote: >This xquery: > > > (: comment one :) >

> { > (: comment two :) > 1 to 10 > } >

> > >produces this result: > > > (: comment one :) >

1 2 3 4 5 6 7 8 9 10

> > >The fact that the first comment appears in the output seems odd to >me... is that meant to happen, and if so what is the correct way to >put a comment there? I actually bring this up explicitly in my class: {() (: comment one :)} The comment has to be in an expression evaluation, and the expression cannot be the empty string, so when I want to do what you need I use the empty sequence expression. I hope this helps. . . . . . . . . . . Ken -- UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/q/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal From andrew.j.welch at gmail.com Tue Jan 5 16:57:39 2010 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue Jan 5 08:48:49 2010 Subject: [xquery-talk] comments In-Reply-To: <7.0.1.0.2.20100105114405.0262de40@wheresmymailserver.com> References: <74a894af1001050835h57d45ceegaa544f5de3e9ec27@mail.gmail.com> <7.0.1.0.2.20100105114405.0262de40@wheresmymailserver.com> Message-ID: <74a894af1001050857ga347f18sc96750e122aec2f8@mail.gmail.com> 2010/1/5 G. Ken Holman : > At 2010-01-05 16:35 +0000, Andrew Welch wrote: >> >> This xquery: >> >> >> ?(: comment one :) >> ?

>> ?{ >> ? ?(: comment two :) >> ? ?1 to 10 >> ?} >> ?

>> >> >> produces this result: >> >> >> ?(: comment one :) >> ?

1 2 3 4 5 6 7 8 9 10

>> >> >> The fact that the first comment appears in the output seems odd to >> me... is that meant to happen, and if so what is the correct way to >> put a comment there? > > I actually bring this up explicitly in my class: > > ?{() (: comment one :)} > > The comment has to be in an expression evaluation, and the expression cannot > be the empty string, so when I want to do what you need I use the empty > sequence expression. Thanks Ken. Do you know if this a quirk of the language or is there a good reason for it? From mike at saxonica.com Tue Jan 5 16:58:16 2010 From: mike at saxonica.com (Michael Kay) Date: Tue Jan 5 08:49:27 2010 Subject: [xquery-talk] comments In-Reply-To: <74a894af1001050835h57d45ceegaa544f5de3e9ec27@mail.gmail.com> References: <74a894af1001050835h57d45ceegaa544f5de3e9ec27@mail.gmail.com> Message-ID: <9672B9C56C564BB68050F9D6124EFF37@Sealion> Everything within curly braces is parsed as XQuery code, everything not in curly braces is literal text. So if you want a comment, put it within curly braces. However, {(: comment :)} is not valid, because the thing within the curly braces must be an expression. It would have to be {(: comment :)()}. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Andrew Welch > Sent: 05 January 2010 16:35 > To: xquery-discuss > Subject: [xquery-talk] comments > > Hi, > > This xquery: > > > (: comment one :) >

> { > (: comment two :) > 1 to 10 > } >

> > > produces this result: > > > (: comment one :) >

1 2 3 4 5 6 7 8 9 10

> > > The fact that the first comment appears in the output seems > odd to me... is that meant to happen, and if so what is the > correct way to put a comment there? > > thanks > andrew > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From gkholman at CraneSoftwrights.com Tue Jan 5 12:00:38 2010 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Tue Jan 5 08:53:28 2010 Subject: [xquery-talk] comments In-Reply-To: <74a894af1001050857ga347f18sc96750e122aec2f8@mail.gmail.com > References: <74a894af1001050835h57d45ceegaa544f5de3e9ec27@mail.gmail.com> <7.0.1.0.2.20100105114405.0262de40@wheresmymailserver.com> <74a894af1001050857ga347f18sc96750e122aec2f8@mail.gmail.com> Message-ID: <7.0.1.0.2.20100105115903.025fe080@wheresmymailserver.com> At 2010-01-05 16:57 +0000, Andrew Welch wrote: >2010/1/5 G. Ken Holman : > > At 2010-01-05 16:35 +0000, Andrew Welch wrote: > >> The fact that the first comment appears in the output seems odd to > >> me... is that meant to happen, and if so what is the correct way to > >> put a comment there? > > > > I actually bring this up explicitly in my class: > > > > {() (: comment one :)} > > > > The comment has to be in an expression evaluation, and the > expression cannot > > be the empty string, so when I want to do what you need I use the empty > > sequence expression. > >Thanks Ken. Do you know if this a quirk of the language or is there a >good reason for it? I wouldn't call it a "quirk" because it simply falls out of the syntax. You want a comment, and in XQuery you cannot use because that constructs a comment node. So you have to have it in an expression. So that leads you to using the brace brackets for evaluating an expression, in which you place the comment. But, the comment is removed from the expression evaluation and all that is left is the expression to be evaluated, which cannot be the empty string. So it all makes sense, and I think it is reasonable. It is just that it doesn't come immediately to mind, which is why it is explicitly part of my lecture. I hope this helps. . . . . . . . . . Ken -- UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/q/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal From davidc at nag.co.uk Tue Jan 5 17:04:42 2010 From: davidc at nag.co.uk (David Carlisle) Date: Tue Jan 5 08:55:58 2010 Subject: [xquery-talk] comments In-Reply-To: <74a894af1001050857ga347f18sc96750e122aec2f8@mail.gmail.com> (message from Andrew Welch on Tue, 5 Jan 2010 16:57:39 +0000) References: <74a894af1001050835h57d45ceegaa544f5de3e9ec27@mail.gmail.com> <7.0.1.0.2.20100105114405.0262de40@wheresmymailserver.com> <74a894af1001050857ga347f18sc96750e122aec2f8@mail.gmail.com> Message-ID: <201001051704.o05H4gl4016809@glenlivet.nag.co.uk> > Thanks Ken. Do you know if this a quirk of the language or is there a > good reason for it? whether the reasoning is good or bad it essentially mirrors the reasoning on attribute value templates in xslt (which is the model for the {..} syntax for expressions in element content anyway, one would guess). in xslt 2 has an attribute with value (:xxxx:) has an attribute with value an empty string. David From john.snelson at oracle.com Wed Jan 6 16:01:52 2010 From: john.snelson at oracle.com (John Snelson) Date: Wed Jan 6 07:58:15 2010 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: References: Message-ID: <4B44B3F0.7020108@oracle.com> Pavel, I think this is something that the XQuery Working Group needs to consider fixing in the next revision of XQuery 1.1. Please can you raise this as a bug against the specification on the W3C bugzilla, to make sure the working groups attention is directed to it. http://www.w3.org/Bugs/Public/ John Pavel Minaev wrote: > With the introduction of inline functions and function item type to > XQuery 1.1, I hoped that we'll finally get a decent looping construct > in form of inline recursive functions; e.g.: > > let $fib := function($n as xs:integer) { > if ($n < 3) then 1 else $fib($n-1) + $fib($n+2) > } > return $fib(10) > > The above doesn't work as is because let-bindings in XQuery cannot be > recursive, and therefore the inline function cannot reference $fib. > The usual workaround for that is to make the function take itself as > an argument, i.e.: > > let $fib := function($fib as ???, $n as xs:integer) { > if ($n < 3) then 1 else $fib($n-1) + $fib($n+2) > } > return $fib($fib, 10) > > But then the problem is with the declared type of the function. So far > as I can see, there's no way to declare an XQuery function type that > references itself in any way. Is that right? It is, of course, > possible to use item() as the type, and let the implementation do the > runtime check (or optimize it out), but this isn't very neat... > > I wonder if some way of defining recursive bindings, where the binding > itself is in the scope of its initializer - specifically for recursive > functions - has been considered, similar to "let rec" of OCaml? It's > obvious why this isn't safe to refer to the binding in its initializer > in the most general case, but the special case of directly binding an > inline function is both perfectly safe, and should become fairly > common. > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk -- John Snelson, Oracle Corporation http://snelson.org.uk/john Berkeley DB XML: http://oracle.com/database/berkeley-db/xml XQilla: http://xqilla.sourceforge.net From int19h at gmail.com Wed Jan 6 09:39:02 2010 From: int19h at gmail.com (Pavel Minaev) Date: Wed Jan 6 09:34:06 2010 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: <4B44B3F0.7020108@oracle.com> References: <4B44B3F0.7020108@oracle.com> Message-ID: I have created bug 8662: http://www.w3.org/Bugs/Public/show_bug.cgi?id=8662 As a side note, I'm personally leaning towards preferring a special syntax for function to call itself - it just feels like this is what I'd be using 99% of all time, and for that other 1% there's always the hack of passing mutual recursive functions as item() arguments to each other. Rather than having a magic variable name like $this, however, I would propose having a magic function - I called it "recurse" in bug description as I couldn't think of anything better, but perhaps "iterate" or something similar might be more appropriate. The gist is this: 1) It is only in-scope within function bodies (inline or no). Referencing it elsewhere is a _static_ error. 2) Where available, it looks like a plain global function in the usual namespace (http://www.w3.org/2005/xpath-functions). This means that it can be called with the usual syntax, but also turned into a function item using #. 3) Where available, parameter types and return type exactly match those of the function to which the innermost enclosing body belongs (inline or no). Again, arity mismatch in a call is a _static_ error (as it is for any normal function). So, the original example would look as follows with this syntax: function($n as xs:integer) as xs:integer { if ($n < 3) then 1 else recurse($n-1) + recurse($n-2) }(10) Thoughts? On Wed, Jan 6, 2010 at 8:01 AM, John Snelson wrote: > Pavel, > > I think this is something that the XQuery Working Group needs to consider > fixing in the next revision of XQuery 1.1. Please can you raise this as a > bug against the specification on the W3C bugzilla, to make sure the working > groups attention is directed to it. > > http://www.w3.org/Bugs/Public/ > > John > > Pavel Minaev wrote: >> >> With the introduction of inline functions and function item type to >> XQuery 1.1, I hoped that we'll finally get a decent looping construct >> in form of inline recursive functions; e.g.: >> >> ? ? let $fib := function($n as xs:integer) { >> ? ? ? ?if ($n < 3) then 1 else $fib($n-1) + $fib($n+2) >> ? ? } >> ? ? return $fib(10) >> >> The above doesn't work as is because let-bindings in XQuery cannot be >> recursive, and therefore the inline function cannot reference $fib. >> The usual workaround for that is to make the function take itself as >> an argument, i.e.: >> >> ? ? let $fib := function($fib as ???, $n as xs:integer) { >> ? ? ? ?if ($n < 3) then 1 else $fib($n-1) + $fib($n+2) >> ? ? } >> ? ? return $fib($fib, 10) >> >> But then the problem is with the declared type of the function. So far >> as I can see, there's no way to declare an XQuery function type that >> references itself in any way. Is that right? It is, of course, >> possible to use item() as the type, and let the implementation do the >> runtime check (or optimize it out), but this isn't very neat... >> >> I wonder if some way of defining recursive bindings, where the binding >> itself is in the scope of its initializer - specifically for recursive >> functions - has been considered, similar to "let rec" of OCaml? It's >> obvious why this isn't safe to refer to the binding in its initializer >> in the most general case, but the special case of directly binding an >> inline function is both perfectly safe, and should become fairly >> common. >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk > > > -- > John Snelson, Oracle Corporation ? ? ? ? ? ?http://snelson.org.uk/john > Berkeley DB XML: ? ? ? ? ? ?http://oracle.com/database/berkeley-db/xml > XQilla: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?http://xqilla.sourceforge.net > From anujk.harcourtian at gmail.com Thu Jan 7 11:28:20 2010 From: anujk.harcourtian at gmail.com (anuj kumar) Date: Wed Jan 6 21:39:27 2010 Subject: [xquery-talk] XQuery issue regarding creating table of contents(TOC) dynamically. Message-ID: Hi All, Wish you all a very happy and prosperous new year 2010. I nee your help regarding following issue: I have an xml of the form

(a)- first level

(1)- second level

(2)- second level

(A)- third level

(B)- third level

(3)- second level

(b)- first level

A change in the designator(Designators may be in alpha, numeric, roman, alpha-numeric, etc bounded or unbounded by brackets) format must be used as basis for identifying the primary level. Designators in sequence or series must be treated as primary level text of the same level. For example: (a)-first level (b)-first level (c)-first level I have to create the following output xml out of the above input xml: (a)- first level (1)- second level (2)- second level (A)- third level (B)- third level (3)- second level (b)- first level Pleae advise, how to do this? Thanks in advance. Regards, Anuj Kumar Innodata Isogen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100107/41285fbe/attachment.htm From jmdyck at ibiblio.org Wed Jan 6 22:42:06 2010 From: jmdyck at ibiblio.org (Michael Dyck) Date: Wed Jan 6 22:19:56 2010 Subject: [xquery-talk] XQuery issue regarding creating table of contents(TOC) dynamically. In-Reply-To: References: Message-ID: <4B45823E.6080504@ibiblio.org> anuj kumar wrote: > > I have an xml of the form > >

(a)- first level

>

(1)- second level

>

(2)- second level

>

(A)- third level

>

(B)- third level

>

(3)- second level

>

(b)- first level

>
> > A change in the designator (Designators may be in alpha, numeric, roman, > alpha-numeric, etc bounded or unbounded by brackets) format must be used > as basis for identifying the primary level. Designators in sequence or > series must be treated as primary level text of the same level. > For example: > (a)-first level > (b)-first level > (c)-first level Hm. Consider the input:

(a)- ..

(b)- ..

(c)- ..

(d)- ..

(e)- ..

(f)- ..

(g)- ..

(h)- ..

(i)- ..

In the last

, how are you supposed to know whether the "i" is alpha (and thus first level) or roman (and thus second level)? And when designators are alpha-numeric, what constitutes a "change in format"? (What defines "designators in sequence"?) -Michael From anujk.harcourtian at gmail.com Thu Jan 7 12:38:03 2010 From: anujk.harcourtian at gmail.com (anuj kumar) Date: Wed Jan 6 22:45:20 2010 Subject: [xquery-talk] XQuery issue regarding creating table of contents(TOC) dynamically. In-Reply-To: <4B45823E.6080504@ibiblio.org> References: <4B45823E.6080504@ibiblio.org> Message-ID: On Thu, Jan 7, 2010 at 12:12 PM, Michael Dyck wrote: > anuj kumar wrote: > >> >> I have an xml of the form >> >>

(a)- first level

>>

(1)- second level

>>

(2)- second level

>>

(A)- third level

>>

(B)- third level

>>

(3)- second level

>>

(b)- first level

>> >> A change in the designator (Designators may be in alpha, numeric, roman, >> alpha-numeric, etc bounded or unbounded by brackets) format must be used >> as basis for identifying the primary level. Designators in sequence or >> series must be treated as primary level text of the same level. >> For example: >> (a)-first level >> (b)-first level >> (c)-first level >> > > Hm. Consider the input: > >

(a)- ..

>

(b)- ..

>

(c)- ..

>

(d)- ..

>

(e)- ..

>

(f)- ..

>

(g)- ..

>

(h)- ..

>

(i)- ..

>
> In the last

, how are you supposed to know whether the "i" is alpha (and > thus first level) or roman (and thus second level)? > And when designators are alpha-numeric, what constitutes a "change in > format"? (What defines "designators in sequence"?) > > -Michael > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > ok, first one is very good question. I didn't think about it. Thanks for your observation. For the time being we will leave it. Let's come to your second question, if designators are alpha-numeric then change in format may be like only numeric or only alpha. Your third question: designators in sequence means a,b,c .. or A,B,C.. or 1,2,3.. etc. -- Regards, Anuj Kumar -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100107/33f4ae4e/attachment.htm From mike at saxonica.com Thu Jan 7 09:16:33 2010 From: mike at saxonica.com (Michael Kay) Date: Thu Jan 7 00:51:43 2010 Subject: [xquery-talk] XQuery issue regarding creating table ofcontents(TOC) dynamically. In-Reply-To: References: Message-ID: <2F544A0869C84ED6B956CAFE70C37D5D@Sealion> It's not going to be easy and I'm not going to try and write the code for you, but here's an approach. You need to do a recursive walk through the siblings. On each step, pass the current "full hierarchic section number" as a sequence, for example ("a", "2", "B"). If the "designator" of the next element is the successor of the last item in this sequence, or if it is the start of a new (nested) sequence, then you can construct the next section number and continue the recursion. If the next designator is the successor of an item in the hierarchic section number other than the last, then you can exit one level of recursion and try again. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay _____ From: talk-bounces@x-query.com [mailto:talk-bounces@x-query.com] On Behalf Of anuj kumar Sent: 07 January 2010 05:58 To: talk@x-query.com Cc: gkholman@cranesoftwrights.com Subject: [xquery-talk] XQuery issue regarding creating table ofcontents(TOC) dynamically. Hi All, Wish you all a very happy and prosperous new year 2010. I nee your help regarding following issue: I have an xml of the form

(a)- first level

(1)- second level

(2)- second level

(A)- third level

(B)- third level

(3)- second level

(b)- first level

A change in the designator(Designators may be in alpha, numeric, roman, alpha-numeric, etc bounded or unbounded by brackets) format must be used as basis for identifying the primary level. Designators in sequence or series must be treated as primary level text of the same level. For example: (a)-first level (b)-first level (c)-first level I have to create the following output xml out of the above input xml: (a)- first level (1)- second level (2)- second level (A)- third level (B)- third level (3)- second level (b)- first level Pleae advise, how to do this? Thanks in advance. Regards, Anuj Kumar Innodata Isogen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100107/5a137027/attachment.htm From gkholman at CraneSoftwrights.com Thu Jan 7 09:06:34 2010 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Thu Jan 7 06:08:37 2010 Subject: [xquery-talk] Re: XQuery issue regarding creating table of contents(TOC) dynamically. In-Reply-To: References: Message-ID: <7.0.1.0.2.20100107085608.026a4c80@wheresmymailserver.com> At 2010-01-07 11:28 +0530, anuj kumar wrote: >I have an xml of the form >... >A change in the designator(Designators may be in alpha, numeric, >roman, alpha-numeric, >etc bounded or unbounded by brackets) format must be used as basis >for identifying the primary level. I've implemented this so you can use regular expressions to determine the level indications. >Designators in sequence or series must be treated as primary level >text of the same level. For example: >(a)-first level >(b)-first level >(c)-first level > >I have to create the following output xml out of the above input xml: >... >Pleae advise, how to do this? You don't share with us what you have tried and what has not worked for you. I have a complete solution below. I found it easier to think first in XSLT because of the grouping facilities that are available, and then to just transliterate that into XQuery for a pure-XQuery solution. Note that readers may find it interesting to have to do the following in XQuery: ({elements-expression})/* ... in order to create a sibling relationship between a copy of nodes so that the recursive use of the following-sibling axis would not access the original nodes. Simply referencing the nodes isn't sufficient because the nodes retain their original location in the original tree. I hope this helps. . . . . . . . . . . . . Ken T:\ftemp>type anuj.xml

(a)- first level

(1)- second level

(2)- second level

(A)- third level

(B)- third level

(3)- second level

(b)- first level

T:\ftemp>call xslt2 anuj.xml anuj.xsl (a)- first level (1)- second level (2)- second level (A)- third level (B)- third level (3)- second level (b)- first level T:\ftemp>call xquery anuj.xq (a)- first level (1)- second level (2)- second level (A)- third level (B)- third level (3)- second level (b)- first level T:\ftemp>type anuj.xsl ^\([a-z]\) ^\([\d+]\) ^\([A-Z]\) <xsl:copy-of select="node()"/> <xsl:copy-of select="node()"/> T:\ftemp>type anuj.xq declare namespace a = "urn:X-anuj"; declare variable $patterns as element(patterns) := ^\([a-z]\) ^\([\d+]\) ^\([A-Z]\) ; declare function a:parent( $population, $pattern, $relationship ) { if( $population ) then (: only do something if there is something to do :) if( not($pattern) ) then (: no more depth :) for $each in $population return element {$relationship} {{$each/node()}} else (: process next level of depth :) for $level in $population[matches(.,$pattern)] return element {$relationship} { {$level/node()}, a:parent( ( {$level/following-sibling::* except $level/following-sibling::*[matches(.,$pattern)][1]/ (self::* | following-sibling::* ) } )/* (:create a new tree of children:), $pattern/following-sibling::*[1] (:the next pattern:), 'child' ) } else () }; {a:parent( doc('anuj.xml')/doc/p, $patterns/pattern[1], 'parent' )} T:\ftemp>rem Done! -- UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/q/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal From jesusrodriguesv at gmail.com Thu Jan 7 16:38:31 2010 From: jesusrodriguesv at gmail.com (Jesus Rodrigues) Date: Thu Jan 7 10:31:25 2010 Subject: [xquery-talk] SXXP0003 Message-ID: <77e589831001071038i25c243a9rf7efce8bd27798ca@mail.gmail.com> Dear all, How avoid this messagem at console? Error on line 1 column 1347 SXXP0003: Error reported by XML parser: Invalid byte 2 of 2-byte UTF-8 sequence. This problem is showed when I have some problem at xml read. Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100107/84001456/attachment.htm From Geert.Josten at daidalos.nl Thu Jan 7 19:42:41 2010 From: Geert.Josten at daidalos.nl (Geert Josten) Date: Thu Jan 7 10:35:37 2010 Subject: [xquery-talk] SXXP0003 In-Reply-To: <77e589831001071038i25c243a9rf7efce8bd27798ca@mail.gmail.com> References: <77e589831001071038i25c243a9rf7efce8bd27798ca@mail.gmail.com> Message-ID: <0260356C6DFE754BA6FA48E659A143384700BF32B8@helios.olympus.borgus.nl> Hi Jesus, Messages like these are typically observed when your parser thinks it is receiving a UTF-8 encoded document, while it is actually something else. Does your xml contain an XML declaration containing the correct encoding? Or are you setting the wrong encoding programmatically perhaps? Kind regards, Geert > Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Jesus Rodrigues > Sent: donderdag 7 januari 2010 19:39 > To: talk@x-query.com > Subject: [xquery-talk] SXXP0003 > > > Dear all, > > How avoid this messagem at console? > > Error on line 1 column 1347 > SXXP0003: Error reported by XML parser: Invalid byte 2 of > 2-byte UTF-8 sequence. > > This problem is showed when I have some problem at xml read. > > > Regards > > From andrew.j.welch at gmail.com Thu Jan 7 18:45:35 2010 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Thu Jan 7 10:38:24 2010 Subject: [xquery-talk] SXXP0003 In-Reply-To: <77e589831001071038i25c243a9rf7efce8bd27798ca@mail.gmail.com> References: <77e589831001071038i25c243a9rf7efce8bd27798ca@mail.gmail.com> Message-ID: <74a894af1001071045gbb2b0a7s6e2342a28fdb391@mail.gmail.com> You usually get that when you parse latin1 or cp1252 (or other) as UTF8. Either: a) correct the encoding in the xml prolog (or add a prolog with the correct encoding) or b) convert the XML to UTF-8. (you could do that using a tool like Notepad++) cheers andrew 2010/1/7 Jesus Rodrigues : > > Dear all, > > How avoid this messagem at console? > > Error on line 1 column 1347 > ? SXXP0003: Error reported by XML parser: Invalid byte 2 of 2-byte UTF-8 > sequence. > > This problem is showed when I have some problem at xml read. > > > Regards > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From gkholman at CraneSoftwrights.com Thu Jan 7 14:03:23 2010 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Thu Jan 7 11:02:03 2010 Subject: [xquery-talk] [Announce] Upcoming hands-on XSLT/XQuery training in Europe and US - XQuery-Talk Message-ID: <7.0.1.0.2.20100107140309.026a9320@CraneSoftwrights.com> Registration is now open for two publicly-subscribed deliveries of our hands-on XSLT/XQuery training coming up, one in Europe and one in the US. These are the most in-depth configurations of Crane's XSLT and XQuery training classes, covering the use of every element, every attribute, every keyword and every function of both XSLT/XPath 1.0 and 2.0 and XQuery 1.0 with more detail and more exercises than other available configurations of our material. Prague, Czech Republic - March 15-19, 2010 http://www.CraneSoftwrights.com/index.html#Crane201003CZ A post-conference tutorial for XML Prague 2010 - http://XMLPrague.cz Practical Transformation Using XSLT, XQuery and XPath (5 days): http://www.CraneSoftwrights.com/training/ptuxq/ptuxqsyl.htm Venue - Residence Retezov?, Prague - class size limited to a total of only 6 students http://www.retezova.com/?id=618 Instructor/author: http://www.CraneSoftwrights.com/bio/gkholman.htm Early-bird date for discounted registration: February 15, 2010 http://www.CraneSoftwrights.com/forms/register.htm#prices San Carlos, California - April 26-30, 2010 http://www.CraneSoftwrights.com/index.html#Crane201004MLC Practical Transformation Using XSLT, XQuery and XPath (5 days): http://www.CraneSoftwrights.com/training/ptuxq/ptuxqsyl.htm Venue - Mark Logic Corporation headquarters, San Carlos, CA http://www.marklogic.com/company/contact.html Instructor/author: http://www.CraneSoftwrights.com/bio/gkholman.htm Early-bird date for discounted registration: April 5, 2010 http://www.CraneSoftwrights.com/forms/register.htm#prices We also have a number of other private corporate deliveries between now and then in the US and India. If you are interested in having us teach publicly or privately anywhere in the world, please review our syllabi and all of our upcoming events at: http://www.CraneSoftwrights.com/schedule.htm#calendar I look forward to answering any questions you may have off-list, please. Thanks! . . . . . . . . . . . . . . Ken cc: XML Dev, XQuery-Talk, XSL List, XML-Doc, XML-L, Mark Logic Developer list p.s. apologies for multiply-received copies of this announcement through the different lists; all of Crane's announcements include "[Announce]" in the subject line for filtering them away -- UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/q/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal From jesusrodriguesv at gmail.com Fri Jan 8 07:23:46 2010 From: jesusrodriguesv at gmail.com (Jesus Rodrigues) Date: Fri Jan 8 00:55:20 2010 Subject: [xquery-talk] SXXP0003 In-Reply-To: <74a894af1001071045gbb2b0a7s6e2342a28fdb391@mail.gmail.com> References: <77e589831001071038i25c243a9rf7efce8bd27798ca@mail.gmail.com> <74a894af1001071045gbb2b0a7s6e2342a28fdb391@mail.gmail.com> Message-ID: <77e589831001080123x42f57450yaeb961e764d990e7@mail.gmail.com> Hi, This is a now problem, some xml read have this problem and I convert the xml to uft-8. I would like to avoid this message (SXXP0003 ...) at the console, because I read a many files. Is possible set any parameter at saxon to avoid the error message at the console? Regards 2010/1/7 Andrew Welch > You usually get that when you parse latin1 or cp1252 (or other) as UTF8. > > Either: > > a) correct the encoding in the xml prolog (or add a prolog with the > correct encoding) > > or > > b) convert the XML to UTF-8. (you could do that using a tool like > Notepad++) > > cheers > andrew > > 2010/1/7 Jesus Rodrigues : > > > > Dear all, > > > > How avoid this messagem at console? > > > > Error on line 1 column 1347 > > SXXP0003: Error reported by XML parser: Invalid byte 2 of 2-byte UTF-8 > > sequence. > > > > This problem is showed when I have some problem at xml read. > > > > > > Regards > > > > _______________________________________________ > > talk@x-query.com > > http://x-query.com/mailman/listinfo/talk > > > > > > -- > Andrew Welch > http://andrewjwelch.com > Kernow: http://kernowforsaxon.sf.net/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100108/ca29f5e5/attachment.htm From mike at saxonica.com Fri Jan 8 09:35:03 2010 From: mike at saxonica.com (Michael Kay) Date: Fri Jan 8 01:06:22 2010 Subject: [xquery-talk] SXXP0003 In-Reply-To: <77e589831001080123x42f57450yaeb961e764d990e7@mail.gmail.com> References: <77e589831001071038i25c243a9rf7efce8bd27798ca@mail.gmail.com><74a894af1001071045gbb2b0a7s6e2342a28fdb391@mail.gmail.com> <77e589831001080123x42f57450yaeb961e764d990e7@mail.gmail.com> Message-ID: <5CE2586DCAC24B8599D43D713A9B7B62@Sealion> There are plenty of ways of changing the way Saxon reports error messages - if you want help on this, please use the Saxon help list. However, there is no way of avoiding the error: if your input is not well-formed XML, Saxon will not process it. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay _____ From: talk-bounces@x-query.com [mailto:talk-bounces@x-query.com] On Behalf Of Jesus Rodrigues Sent: 08 January 2010 09:24 To: talk@x-query.com Subject: Re: [xquery-talk] SXXP0003 Hi, This is a now problem, some xml read have this problem and I convert the xml to uft-8. I would like to avoid this message (SXXP0003 ...) at the console, because I read a many files. Is possible set any parameter at saxon to avoid the error message at the console? Regards 2010/1/7 Andrew Welch You usually get that when you parse latin1 or cp1252 (or other) as UTF8. Either: a) correct the encoding in the xml prolog (or add a prolog with the correct encoding) or b) convert the XML to UTF-8. (you could do that using a tool like Notepad++) cheers andrew 2010/1/7 Jesus Rodrigues : > > Dear all, > > How avoid this messagem at console? > > Error on line 1 column 1347 > SXXP0003: Error reported by XML parser: Invalid byte 2 of 2-byte UTF-8 > sequence. > > This problem is showed when I have some problem at xml read. > > > Regards > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100108/a28774b4/attachment.htm From sahoo.byomokesh at gmail.com Fri Jan 8 16:03:43 2010 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Fri Jan 8 02:03:55 2010 Subject: [xquery-talk] TOC Problem Message-ID: <373764c61001080233w6dc37b65ud76c7856be77a8c@mail.gmail.com> Hi, I want create TOC from XML file using XQuery. Here find the below Input XML, requirement output. xml === Contents ForewordvFen AcknowledgmentsxxJean Dandelin Abbreviationsxiii 1 Room for Manoeuvre3Jean Daudelin PART ONE
THE OTTAWA GAME
2 Raising Our Game31 Wendy Dobson
Requird Output ============== Cover Title Page Copyright Page Contents Foreword Acknowledgments Abbreviations 1 Room for Manoeuvre and the Paradox of Globalization PART ONE THE OTTAWA GAME 2 Raising Our Game: Canada among Nations =========== Please advice. Thanks Byomokesh From mike at saxonica.com Fri Jan 8 10:45:56 2010 From: mike at saxonica.com (Michael Kay) Date: Fri Jan 8 02:16:00 2010 Subject: [xquery-talk] TOC Problem In-Reply-To: <373764c61001080233w6dc37b65ud76c7856be77a8c@mail.gmail.com> References: <373764c61001080233w6dc37b65ud76c7856be77a8c@mail.gmail.com> Message-ID: <3A63DB220F8F4406AEDFEF5BD0E70F2D@Sealion> Your input has 1 Room for Manoeuvre and you want the output to be 1 Room for Manoeuvre and the Paradox of Globalization That could be tricky. Apart from that kind of detail, which I'm sure is just carelessness in your posting, it's hard to see exactly what your problem is. If you explain why you are finding this difficult, then it might be easier to help you. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Byomokesh Sahoo > Sent: 08 January 2010 10:34 > To: talk@x-query.com > Subject: [xquery-talk] TOC Problem > > Hi, > > I want create TOC from XML file using XQuery. Here find the > below Input XML, requirement output. > > xml > === > > > > > Contents > Forewordv< > Tocauthor>Fen > Acknowledgmentsxx > Jean > Dandelin > Abbreviationsxiii > > 1 Room for > Manoeuvre3Jean > Daudelin > > PART ONE
THE OTTAWA > GAME
> 2 Raising Our > Game31 Wendy > Dobson
> > Requird Output > ============== > > > Cover > > > > Title Page > > > > Copyright Page > > > > Contents > > > > Foreword > > Acknowledgments src="xhtml/acknowledgment.html"/> id="iabbre-ct" playOrder="7"> Abbreviations > id="ich01" playOrder="8"> > 1 Room for Manoeuvre and the Paradox of > Globalization > > > > PART ONE THE OTTAWA GAME > > > > 2 Raising Our Game: Canada among Nations > > > =========== > > Please advice. > > Thanks > Byomokesh > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From sahoo.byomokesh at gmail.com Fri Jan 8 16:43:38 2010 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Fri Jan 8 02:43:13 2010 Subject: [xquery-talk] TOC Problem In-Reply-To: <3A63DB220F8F4406AEDFEF5BD0E70F2D@Sealion> References: <373764c61001080233w6dc37b65ud76c7856be77a8c@mail.gmail.com> <3A63DB220F8F4406AEDFEF5BD0E70F2D@Sealion> Message-ID: <373764c61001080313j71ad170flaf4d8a3a291531e5@mail.gmail.com> Hi, Sorry. It was typo error. I want transform from one xml to another xml format. I have analyzed and noticeed some doubts here. 1. delete and 2. value should be come based on the Title Text. Example. Cover -- id="cover", chapter text should come <.. id="ch01"> (Look the Tag and 3. wrote: > Your input has > > 1 Room for Manoeuvre > > and you want the output to be > > 1 Room for Manoeuvre and the Paradox of Globalization > > That could be tricky. > > Apart from that kind of detail, which I'm sure is just carelessness in your > posting, it's hard to see exactly what your problem is. If you explain why > you are finding this difficult, then it might be easier to help you. > > Regards, > > Michael Kay > http://www.saxonica.com/ > http://twitter.com/michaelhkay > > > >> -----Original Message----- >> From: talk-bounces@x-query.com >> [mailto:talk-bounces@x-query.com] On Behalf Of Byomokesh Sahoo >> Sent: 08 January 2010 10:34 >> To: talk@x-query.com >> Subject: [xquery-talk] TOC Problem >> >> Hi, >> >> I want create TOC from XML file using XQuery. Here find the >> below Input XML, requirement output. >> >> xml >> === >> >> >> >> >> Contents >> Forewordv< >> Tocauthor>Fen >> Acknowledgmentsxx >> Jean >> Dandelin >> Abbreviationsxiii >> >> 1 Room for >> Manoeuvre3Jean >> Daudelin >> >> PART ONE
THE OTTAWA >> GAME
>> 2 Raising Our >> Game31 Wendy >> Dobson
>> >> Requird Output >> ============== >> >> >> Cover >> >> >> >> Title Page >> >> >> >> Copyright Page >> >> >> >> Contents >> >> >> >> Foreword >> >> Acknowledgments > src="xhtml/acknowledgment.html"/> > id="iabbre-ct" playOrder="7"> Abbreviations >> > id="ich01" playOrder="8"> >> 1 Room for Manoeuvre and the Paradox of >> Globalization >> >> >> >> PART ONE THE OTTAWA GAME >> >> >> >> 2 Raising Our Game: Canada among Nations >> >> >> =========== >> >> Please advice. >> >> Thanks >> Byomokesh >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk > > From christian.gruen at gmail.com Sun Jan 10 22:32:59 2010 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Sun Jan 10 13:22:50 2010 Subject: [xquery-talk] [ANN] BaseX 6.0 Message-ID: Dear all, we are glad to announce the release of BaseX 6.0. It offers a bunch of new features, such as: - a full implementation of XQuery Update, reaching 100% in the W3C Test Suite. - an enhanced client/server architecture with ACID-safe transactions, user and password management and transaction logging. - extended XQuery Full Text features, supporting TF/IDF scoring, stop word lists, fuzzy querying, etc. - the improved creation of index structures, using constant memory. - optimizations to increase the use of index structures and iterative query processing. BaseX is open-source. It is developed by the DBIS Group at University of Konstanz. Please find more information at http://basex.org/ All the best, Christian Gr?n BaseX Team From sahoo.byomokesh at gmail.com Mon Jan 11 13:37:43 2010 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Sun Jan 10 23:42:14 2010 Subject: [xquery-talk] Hide Text using XQuery Message-ID: <373764c61001110007n7122f86dsa095ce84e1dd3f9@mail.gmail.com> Dear All, I am doing transformation xml to xml using xquery. Here find the below my xml, ouput and xqy file. I have tried but i could not find how i will delete and create ID attribute as it as a same content. (eg. Forward for forward, content for conent). XML ====

ForewordvFen

Output ===== Foreword my xqy ====== let $ad := doc("file:///d:/Byomokesh/PubXML/xquery/sample.xml") let $ad2 := $ad//text for $r in $ad2 return {data($r)} Thanks Byomokesh From mike at saxonica.com Mon Jan 11 09:26:06 2010 From: mike at saxonica.com (Michael Kay) Date: Mon Jan 11 00:58:58 2010 Subject: [xquery-talk] Hide Text using XQuery In-Reply-To: <373764c61001110007n7122f86dsa095ce84e1dd3f9@mail.gmail.com> References: <373764c61001110007n7122f86dsa095ce84e1dd3f9@mail.gmail.com> Message-ID: <82066EDCC9CE46318E34619B23844DBF@Sealion> Perhaps you want something like let $ad := doc("file:///d:/Byomokesh/PubXML/xquery/sample.xml") for $r in $ad//text return {data($r)} Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Byomokesh Sahoo > Sent: 11 January 2010 08:08 > To: talk@x-query.com > Subject: [xquery-talk] Hide Text using XQuery > > Dear All, > > I am doing transformation xml to xml using xquery. Here find > the below my xml, ouput and xqy file. I have tried but i > could not find how i will delete and create ID > attribute as it as a same content. > (eg. Forward for forward, content for conent). > > XML > ==== >

ForewordvFen

> > Output > ===== > > Foreword > > my xqy > ====== > > let $ad := doc("file:///d:/Byomokesh/PubXML/xquery/sample.xml") > let $ad2 := $ad//text > for $r in $ad2 > return > {data($r)} > > > Thanks > Byomokesh > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From sahoo.byomokesh at gmail.com Mon Jan 11 16:04:49 2010 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Mon Jan 11 02:05:56 2010 Subject: [xquery-talk] Hide Text using XQuery In-Reply-To: <82066EDCC9CE46318E34619B23844DBF@Sealion> References: <373764c61001110007n7122f86dsa095ce84e1dd3f9@mail.gmail.com> <82066EDCC9CE46318E34619B23844DBF@Sealion> Message-ID: <373764c61001110234s12c05edbpdab6a92e670755d8@mail.gmail.com> Hi, How it will remove v this element text. Output is coming like this.. Foreword??v Required Output ============ Foreword Thanks Byomokesh On Mon, Jan 11, 2010 at 2:56 PM, Michael Kay wrote: > Perhaps you want something like > > let $ad := doc("file:///d:/Byomokesh/PubXML/xquery/sample.xml") > for $r in $ad//text > return {data($r)} > > Regards, > > Michael Kay > http://www.saxonica.com/ > http://twitter.com/michaelhkay > > > >> -----Original Message----- >> From: talk-bounces@x-query.com >> [mailto:talk-bounces@x-query.com] On Behalf Of Byomokesh Sahoo >> Sent: 11 January 2010 08:08 >> To: talk@x-query.com >> Subject: [xquery-talk] Hide Text using XQuery >> >> Dear All, >> >> I am doing transformation xml to xml using xquery. Here find >> the below my xml, ouput and xqy file. I have tried but i >> could not find how i will delete and create ID >> attribute as it as a same content. >> (eg. Forward for forward, content for conent). >> >> XML >> ==== >>

ForewordvFen or>

>> >> Output >> ===== >> >> Foreword >> >> my xqy >> ====== >> >> let $ad := doc("file:///d:/Byomokesh/PubXML/xquery/sample.xml") >> let $ad2 := $ad//text >> for $r ?in $ad2 >> return >> {data($r)} >> >> >> Thanks >> Byomokesh >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk > > From mike at saxonica.com Mon Jan 11 11:04:21 2010 From: mike at saxonica.com (Michael Kay) Date: Mon Jan 11 02:34:53 2010 Subject: [xquery-talk] Hide Text using XQuery In-Reply-To: <373764c61001110234s12c05edbpdab6a92e670755d8@mail.gmail.com> References: <373764c61001110007n7122f86dsa095ce84e1dd3f9@mail.gmail.com><82066EDCC9CE46318E34619B23844DBF@Sealion> <373764c61001110234s12c05edbpdab6a92e670755d8@mail.gmail.com> Message-ID: <795A2780DB634A659171092767DD5758@Sealion> Ah, I see. Simplest solution is let $ad := doc("file:///d:/Byomokesh/PubXML/xquery/sample.xml") for $r in $ad//text return {$r/text()} but that's not very robust if there's extra whitespace or comments in the source: slightly safer is to replace $r/text() in both places by string-join($r/text(), '') to allow for the possibility of multiple text nodes. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Byomokesh Sahoo > Sent: 11 January 2010 10:35 > To: talk@x-query.com > Subject: Re: [xquery-talk] Hide Text using XQuery > > Hi, > > How it will remove v this element text. > > Output is coming like this.. > > Foreword??v > > Required Output > ============ > > Foreword > > > Thanks > Byomokesh > > > > On Mon, Jan 11, 2010 at 2:56 PM, Michael Kay > wrote: > > Perhaps you want something like > > > > let $ad := doc("file:///d:/Byomokesh/PubXML/xquery/sample.xml") > > for $r in $ad//text > > return {data($r)} > > > > Regards, > > > > Michael Kay > > http://www.saxonica.com/ > > http://twitter.com/michaelhkay > > > > > > > >> -----Original Message----- > >> From: talk-bounces@x-query.com > >> [mailto:talk-bounces@x-query.com] On Behalf Of Byomokesh Sahoo > >> Sent: 11 January 2010 08:08 > >> To: talk@x-query.com > >> Subject: [xquery-talk] Hide Text using XQuery > >> > >> Dear All, > >> > >> I am doing transformation xml to xml using xquery. Here find the > >> below my xml, ouput and xqy file. I have tried but i could > not find > >> how i will delete and create ID attribute as it as a same > >> content. > >> (eg. Forward for forward, content for conent). > >> > >> XML > >> ==== > >>

ForewordvFen > or>

> >> > >> Output > >> ===== > >> > >> Foreword > >> > >> my xqy > >> ====== > >> > >> let $ad := doc("file:///d:/Byomokesh/PubXML/xquery/sample.xml") > >> let $ad2 := $ad//text > >> for $r ?in $ad2 > >> return > >> {data($r)} > >> > >> > >> Thanks > >> Byomokesh > >> _______________________________________________ > >> talk@x-query.com > >> http://x-query.com/mailman/listinfo/talk > > > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From andrew.eisenberg at us.ibm.com Mon Jan 11 18:38:21 2010 From: andrew.eisenberg at us.ibm.com (Andrew Eisenberg) Date: Mon Jan 11 15:22:19 2010 Subject: [xquery-talk] More Implementations of XQuery Update Facility Requested Message-ID: Back in August, the XML Query Working Group announced the availability of version 1.0.0 of the XQuery Update Facility Test Suite [1]. This test suite reflects the XQuery Update Facility 1.0 Candidate Recommendation [2] that was published on June 9. We are pleased to have received results for BaseX, MXQuery, Saxon-EE, xDB, and Zorba [3]. We are still looking for implementations that support the Update Facility Static Typing Feature and implementations that support XQueryX. We'd like to encourage implementors of these features to submit their results to us, so that we can advance XQuery Update Facility to W3C Recommendation. -- Andrew [1] XQuery Update Facility Test Suite http://dev.w3.org/2007/xquery-update-10-test-suite/ [2] XQuery Update Facility 1.0 http://www.w3.org/TR/2009/CR-xquery-update-10-20090609/ [3] XQuery Update Test Suite Result Summary http://dev.w3.org/2007/xquery-update-10-test-suite/results/XQUTSReportSimple.html http://dev.w3.org/2007/xquery-update-10-test-suite/results/XQUTSReport.html -------------------- Andrew Eisenberg IBM 4 Technology Park Drive Westford, MA 01886 andrew.eisenberg@us.ibm.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100111/e8784f11/attachment.htm From anujk.harcourtian at gmail.com Tue Jan 12 11:14:09 2010 From: anujk.harcourtian at gmail.com (anuj kumar) Date: Mon Jan 11 21:19:45 2010 Subject: [xquery-talk] Re: XQuery issue regarding creating table of contents(TOC) dynamically. In-Reply-To: <7.0.1.0.2.20100107085608.026a4c80@wheresmymailserver.com> References: <7.0.1.0.2.20100107085608.026a4c80@wheresmymailserver.com> Message-ID: Hi Ken, Thanks a lot for your reply. I think your approach and code might help me in implementing the same for my requirement which is somewhat complex than the sample i had explained in the mail. Regards, Anuj On Thu, Jan 7, 2010 at 7:36 PM, G. Ken Holman wrote: > At 2010-01-07 11:28 +0530, anuj kumar wrote: > >> I have an xml of the form >> ... >> >> A change in the designator(Designators may be in alpha, numeric, roman, >> alpha-numeric, >> etc bounded or unbounded by brackets) format must be used as basis for >> identifying the primary level. >> > > I've implemented this so you can use regular expressions to determine the > level indications. > > Designators in sequence or series must be treated as primary level text of >> the same level. For example: >> (a)-first level >> (b)-first level >> (c)-first level >> >> I have to create the following output xml out of the above input xml: >> ... >> >> Pleae advise, how to do this? >> > > You don't share with us what you have tried and what has not worked for > you. > > I have a complete solution below. I found it easier to think first in XSLT > because of the grouping facilities that are available, and then to just > transliterate that into XQuery for a pure-XQuery solution. > > Note that readers may find it interesting to have to do the following in > XQuery: > > ({elements-expression})/* > > ... in order to create a sibling relationship between a copy of nodes so > that the recursive use of the following-sibling axis would not access the > original nodes. Simply referencing the nodes isn't sufficient because the > nodes retain their original location in the original tree. > > I hope this helps. > > . . . . . . . . . . . . Ken > > > T:\ftemp>type anuj.xml > > >

(a)- first level

>

(1)- second level

>

(2)- second level

>

(A)- third level

>

(B)- third level

>

(3)- second level

>

(b)- first level

>
> T:\ftemp>call xslt2 anuj.xml anuj.xsl > > > > > (a)- first level > > (1)- second level > > > (2)- second level > > (A)- third level > > > (B)- third level > > > > (3)- second level > > > > (b)- first level > > > T:\ftemp>call xquery anuj.xq > > > > > (a)- first level > > (1)- second level > > > (2)- second level > > (A)- third level > > > (B)- third level > > > > (3)- second level > > > > (b)- first level > > > T:\ftemp>type anuj.xsl > > version="2.0"> > > > > > > ^\([a-z]\) > ^\([\d+]\) > ^\([A-Z]\) > > > > > > > > > > > > > > > > > > > > > > > > > <xsl:copy-of select="node()"/> > > > > > > group-starting-with="*[matches(.,$pattern)]"> > > <xsl:copy-of select="node()"/> > > select="current-group()[position()>1]"/> > select="$pattern/following-sibling::*[1]"/> > > > > > > > > > > > > T:\ftemp>type anuj.xq > declare namespace a = "urn:X-anuj"; > > declare variable $patterns as element(patterns) := > > ^\([a-z]\) > ^\([\d+]\) > ^\([A-Z]\) > ; > > declare function a:parent( $population, $pattern, $relationship ) > { > if( $population ) > then > (: only do something if there is something to do :) > if( not($pattern) ) > then > (: no more depth :) > for $each in $population return > element {$relationship} {{$each/node()}} > else > (: process next level of depth :) > for $level in $population[matches(.,$pattern)] > return > element {$relationship} > { > {$level/node()}, > a:parent( ( > {$level/following-sibling::* except > $level/following-sibling::*[matches(.,$pattern)][1]/ > (self::* | > following-sibling::* ) > } > )/* (:create a new tree of children:), > $pattern/following-sibling::*[1] (:the next pattern:), > 'child' ) > } > else () > }; > > {a:parent( doc('anuj.xml')/doc/p, $patterns/pattern[1], 'parent' > )} > > > T:\ftemp>rem Done! > > > -- > UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 > XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 > XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 > Vote for your XML training: http://www.CraneSoftwrights.com/q/i/ > Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ > Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video > Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 > Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 > G. Ken Holman mailto:gkholman@CraneSoftwrights.com > Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc > Legal business disclaimers: http://www.CraneSoftwrights.com/legal > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Regards, Anuj Kumar M: +91-9582472866 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100112/e1ea1c31/attachment.htm From sahoo.byomokesh at gmail.com Wed Jan 13 14:32:51 2010 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Wed Jan 13 00:35:46 2010 Subject: [xquery-talk] TOC Problem Message-ID: <373764c61001130102v340a8ceew32d89c7a1f992309@mail.gmail.com> Hi, How I will get ouput using XQuery. xml === Contents ForewordvFen AcknowledgmentsxxJean Dandelin Abbreviationsxiii 1 Room for Manoeuvre3Jean Daudelin PART ONE
THE OTTAWA GAME
2 Raising Our Game31 Wendy Dobson
================================================================================================================= ================================================================================================================ Contents Foreword Acknowledgments Abbreviations 1 Room for Manoeuvre PART ONE THE OTTAWA GAME 2 Raising Our Game: Canada among Nations Thanks Byomokesh From ricardo.queiros at gmail.com Wed Jan 13 16:30:35 2010 From: ricardo.queiros at gmail.com (=?ISO-8859-1?Q?Ricardo_Queir=F3s?=) Date: Wed Jan 13 08:21:04 2010 Subject: [xquery-talk] XATA - a XML Conference Message-ID: <6cec8a991001130830o6c808834y53d31a95d6999f82@mail.gmail.com> XATA - XML, APPLICATIONS AND ASSOCIATED TECHNOLOGIES 2010 ====================================================== http://www.eseig.ipp.pt/conferencias/xata2010/ From 19 to 20 May, 2010 - ESEIG, IPP CALL FOR PAPERS The main goal of the eighth national conference XATA 2010 is the creation of a space for the discussion about XML, its different usages and all the associated technologies. This XATA edition will be hold in Escola Superior de Estudos Industriais e de Gest?o, a school from Instituto Polit?cnico do Porto, in Vila do Conde, Portugal. The conference is open to technicians and interested users in this subject, coming from the academic or the industrial world. We invite you to send an article proposal for posterior presentation in the conference, or just participating in the conference. Articles should be written in English but the presentations can be done in Portuguese, Galician, Spanish or English. Articles should not exceed 12 pages. Small articles should not exceed 6 pages. The articles should comply with Lecture Notes in Computer Science layout rules and be submitted electronically (check hyperlink to EasyChair in the conference website). CONFERENCE SUBJECTS * Semantic Web and Classification Structures in XML * Methodologies for Specification in XML * XML and Databases * XML-Mining * Querying languages for XML * Web Services -- Architectures and Practical Cases * WEB Technologies - Web 2.0, AJAX, XHTML, HTML5 * XML Applications - Digital Libraries based in XML - E-learning based in XML - Workflow and Document management * Edition of XML - XML Generic Editors - XML Editors for specific schemas - XML Visualization Tools * XML Document Processors * XML Standards - XML, XSL, SGML, LMNL, XSL-FO, XTM, RDF, XQuery, Topic Maps, SVG, MathML, OWL, UBL, XSD, TexMECS, RNG and others) * Other languages for document annotation/serialization IMPORTANT DATES * March, 1 - Deadline for contributions submission * March, 31 - Acceptance notification * April, 15 - Camera Ready version submission * May, 19-20 - XATA 2010 STEERING COMMITTEE * Cristina Ribeiro (FEUP, INESC Porto) * Gabriel David (FEUP, INESC Porto) * Jo?o Correia Lopes (FEUP, INESC Porto) * Jos? Carlos Ramalho (Program Chair - DI/UM) * Jos? Paulo Leal (FCUP) * Pedro Henriques (DI/UM) SCIENTIFIC COMMITTEE * Ademar Aguiar (FEUP, INESC Porto) * Alberto Rodrigues da Silva (IST, INESC-ID) * Alberto Sim?es (ESEIG/IPP) * Alda Lopes Gan?arski (Institut National des T?l?communications) * Ana Paula Afonso (DI/FC/UL) * Benedita Malheiro (ISEP) * Cristina Ribeiro (FEUP, INESC Porto) * Daniela da Cruz (DI/UM) * Francisco Couto (DI/FC/UL) * Gabriel David (FEUP, INESC Porto) * Giovani Librelotto (UFSM) * Jo?o Correia Lopes (FEUP, INESC Porto) * Jo?o Moura Pires (FCT/UNL) * Jos? Carlos Ramalho (DI/UM) * Jos? Jo?o Almeida (DI/UM) * Jos? Paulo Leal (DCC/FCUP) * Luis Ferreira (EST/IPCA) * Lu?s Carri?o (DI/FC/UL) * Manolo Ramos (UVigo) * Marta Jacinto (ITIJ) * Miguel Ferreira (DSI/UM) * Nuno Horta (IST/IT) * Paulo Marques (DEI/UC) * Pedro Rangel Henriques (DI/UM) * Ricardo Queir?s (ESEIG/IPP) * Rui Lopes (DI/FC/UL) * Salvador Abreu (DI/UE) * Stephane Gan?arski (LIP6, University P. & M. Curie Paris 6) * Xavier G?mez Guinovart (UVigo) ORGANIZING COMMITTEE * Alberto Sim?es (ESEIG/IPP) * Lu?s Correia (ESEIG/IPP) * M?rio Pinto (ESEIG/IPP) * Ricardo Queir?s (ESEIG/IPP) -- Ricardo Queir?s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100113/e9f3b737/attachment.htm From kenneth.dougherty at sdigovsolutions.com Wed Jan 13 13:15:25 2010 From: kenneth.dougherty at sdigovsolutions.com (Kenneth Dougherty) Date: Wed Jan 13 10:04:29 2010 Subject: [xquery-talk] trying to search in one document with an element pulled in as a variable from another document Message-ID: <5B15E7518B0341E19454B9B9117999DE@sdigovsolutions.com> Hello, I would appreciate any help with the following problem. Situation: An XML document may contain any number of boilerplates dependent on various factors. These boilerplates will be located within certain elements, depending on the type of boilerplate being used. Often, if said element is used, it must have a certain boilerplate associated with it. Goal: To create a report for technical writers that will search their XML and report to them which boilerplates are missing. Methodology: In an attempt to avoid hard coding each situation, the idea is to pull in information from one document and use it to determine which elements to search in the other document. Here is the relevant section of the file [list.gent] containing the information that will be used to search the other file ************************************************ warranty information wrntyref The warranty starts on the date found in block 23 of DA Form 2408-9, Equipment Control Record. C:\svn_sdi_skeleton_creator\BOILERPLATES\GIM\ginfowp\warrant y_ information.gent Required by Standard ************************************************ The relevant section of the xquery is as follows. An explanation will follow. Note: $production in //production does not require a doc function as it pulls in the correct document from a java program. [Or rather the java program pulls in the xquery and supplies the document for it.] ************************************************

Required boilerplates

The following boilerplates are required, but are missing.

{ for $production in //production, $search-for in doc("list.gent")//boilerplate let $searchtag := $search-for/location_in_TM let $tagname := //production//$searchtag return( for $elementsearch in //$tagname where not(contains(data($elementsearch), data($search-for/string_search))) return { , (:don't forget comma or error result :) , , , } ) }
boilerplate name reason location wpno xpath
{$search-for/location_in_TM}{data($search-for/reason)}{data($search-for/location_of_bp)}{data($elementsearch/ancestor::*/@wpno)}{$elementsearch/string-join(ancestor-or-self::* /f:name-and-position(.), '/')}
************************************************ Explanation: I apologize if anything above is a bit of a mess. I'm still new to xquery and probably not writing the code in the most efficient method. 1. for $production in //production, $search-for in doc("list.gent")//boilerplate This section is meant to search through both documents. The writer's xml itself is too large to include here. I believe the only relevant information is that production is the root element. From the list.gent "wrntyref" is the element that will be searched for in the XML. Wrntyref is an optional descendant of production. It has a set xpath from production, but that xpath is irrelevant as the goal is to use any element taken from list/location_in_TM and process it against the XML being used by the writers. 2. let $searchtag := $search-for/location_in_TM is to get the value from location_in_TM from list.gent and place it in a variable. 3. let $tagname := //production//$searchtag is my attempt to create an xpath using the root of the writer's xml and the variable $searchtag. 4. The second FWR within the first Return was the only way I could guess to process each occurrence of the value taken in location_in_TM [and stored in $searchtag] and process it for each occurrence in the writer's xml. **** Result: The following output was achieved. ************************************************ boilerplate name reason location wrntyref Required by Standard C:\svn_sdi_skeleton_creator\BOILERPLATES\GIM\ginfowp\warranty_ information.gent [following is a continuation of first line] wpno xpath list[1]/required_boilerplates[1]/boilerplate[1]/location_in_TM[1] ************************************************ The xpath is derived from the following function declare function f:name-and-position($n as element()) as xs:string { concat(name($n), '[', 1+count($n/preceding-sibling::*[node-name(.) = node-name($n)]), ']') }; The function works correctly as proven in use elsewhere, but the xpath shown is incorrect. It is pointing to the list.gent file instead of the writer's XML. Since $elementsearch is also used in the where statement, this means the same problem is also occurring there. **** Questions: 1. How do I write the xquery so that $elementsearch is pointing to the correct [the writer's] XML? 2. Is there a better method I should be looking at instead? Thanks for your time and help. Thank you, ? Kenneth Dougherty From mail at martin-probst.com Thu Jan 14 07:18:52 2010 From: mail at martin-probst.com (Martin Probst) Date: Wed Jan 13 21:54:15 2010 Subject: [xquery-talk] trying to search in one document with an element pulled in as a variable from another document In-Reply-To: <5B15E7518B0341E19454B9B9117999DE@sdigovsolutions.com> References: <5B15E7518B0341E19454B9B9117999DE@sdigovsolutions.com> Message-ID: <6dca08521001132218v7119e280pcc27e4dc5e1c1b65@mail.gmail.com> > let $searchtag := $search-for/location_in_TM > let $tagname := //production//$searchtag I'm not quite sure what you are trying to achieve here, but //foo//$bar does certainly not work. If you want to look for elements that have a name which you don't know statically (i.e. it's in a variable), you should write: let $searchtag := $search-for/location_in_TM let $tags := //production//*[name(.) = $searchtag] (: or node-name(.) if you use namespaces :) Basically you use a predicate on any node, and within that you check for the name of the current context node (name(.)) to equal whatever you are looking for. You can also compare against multiple names (i.e. $searchtags) at the same time, that might help with performance. > 1. How do I write the xquery so that $elementsearch is pointing to the > correct [the writer's] XML? I'm guessing what you want is for $element in //*[name(.) = $searchtag] I don't quite understand what you are trying to achieve with $tagname, this appears redundant. Regards, Martin From kenneth.dougherty at sdigovsolutions.com Thu Jan 14 11:23:07 2010 From: kenneth.dougherty at sdigovsolutions.com (Kenneth Dougherty) Date: Thu Jan 14 08:18:35 2010 Subject: [xquery-talk] trying to search in one document with an element pulled in as a variable from another document In-Reply-To: <6dca08521001132218v7119e280pcc27e4dc5e1c1b65@mail.gmail.com> References: <5B15E7518B0341E19454B9B9117999DE@sdigovsolutions.com> <6dca08521001132218v7119e280pcc27e4dc5e1c1b65@mail.gmail.com> Message-ID: <0F3AB27C97034036B288B433ED00F0F8@sdigovsolutions.com> Hi Martin, Thank you very much for the help. The solution worked. [Also, $tagname was redundant, as you pointed out.] Thank you, Kenneth Dougherty -----Original Message----- From: Martin Probst [mailto:mail@martin-probst.com] Sent: Thursday, January 14, 2010 1:19 AM To: Kenneth Dougherty Cc: talk@x-query.com Subject: Re: [xquery-talk] trying to search in one document with an element pulled in as a variable from another document > let $searchtag := $search-for/location_in_TM > let $tagname := //production//$searchtag I'm not quite sure what you are trying to achieve here, but //foo//$bar does certainly not work. If you want to look for elements that have a name which you don't know statically (i.e. it's in a variable), you should write: let $searchtag := $search-for/location_in_TM let $tags := //production//*[name(.) = $searchtag] (: or node-name(.) if you use namespaces :) Basically you use a predicate on any node, and within that you check for the name of the current context node (name(.)) to equal whatever you are looking for. You can also compare against multiple names (i.e. $searchtags) at the same time, that might help with performance. > 1. How do I write the xquery so that $elementsearch is pointing to the > correct [the writer's] XML? I'm guessing what you want is for $element in //*[name(.) = $searchtag] I don't quite understand what you are trying to achieve with $tagname, this appears redundant. Regards, Martin From nuno.lopes at deri.org Thu Jan 14 17:29:34 2010 From: nuno.lopes at deri.org (Nuno Lopes) Date: Thu Jan 14 09:21:23 2010 Subject: [xquery-talk] declaring a variable of an imported schema type Message-ID: Hello all, I'm trying to declare a variable to be of a type that is imported from an XML schema definition. So far what I've been doing is something like: let $var := validate { element {$type} { $value } } ... and it works although is a bit cumbersome. Is there an easier way to do this, ie, without using the validate {} ? Thanks, -- Nuno Lopes From mike at saxonica.com Thu Jan 14 18:04:05 2010 From: mike at saxonica.com (Michael Kay) Date: Thu Jan 14 09:50:56 2010 Subject: [xquery-talk] declaring a variable of an imported schema type In-Reply-To: References: Message-ID: <4DBFF8AD191D4942B57D7032061AAFD3@Sealion> The validate{} expression will take untyped data, validate it against the schema, and return typed data. If your data has already been validated, you don't need to do this, you only need to declare its type. Typically this is done using the "as" clause. For example let $invoice as schema-element(my:invoice) := doc('invoice.xml')/* return ... This will fail if doc() doesn't do the validation; how you control whether or not doc() does validation is processor-specific, and will often involve some kind of configuration options. In Saxon, for example, when you set -val:strict on the command line, all input documents will be validated. (In Altova, I believe validation happens if and only if there is an xsi:schemaLocation attribute within the document itself.) Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Nuno Lopes > Sent: 14 January 2010 17:30 > To: talk@x-query.com > Cc: Nuno Lopes > Subject: [xquery-talk] declaring a variable of an imported schema type > > Hello all, > > I'm trying to declare a variable to be of a type that is > imported from an XML schema definition. > > So far what I've been doing is something like: > > let $var := validate { element {$type} { $value } } ... > > and it works although is a bit cumbersome. > Is there an easier way to do this, ie, without using the validate {} ? > > Thanks, > -- > Nuno Lopes > > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From nuno.lopes at deri.org Thu Jan 14 18:38:17 2010 From: nuno.lopes at deri.org (Nuno Lopes) Date: Thu Jan 14 10:24:30 2010 Subject: [xquery-talk] declaring a variable of an imported schema type In-Reply-To: <4DBFF8AD191D4942B57D7032061AAFD3@Sealion> References: <4DBFF8AD191D4942B57D7032061AAFD3@Sealion> Message-ID: In this case I would like to create a new element of that type, ie, one that is not read from the input file, so I guess the validation is required. Thank you for the reply. -- Nuno Lopes On 14 Jan 2010, at 18:04, Michael Kay wrote: > > The validate{} expression will take untyped data, validate it against the > schema, and return typed data. > > If your data has already been validated, you don't need to do this, you only > need to declare its type. Typically this is done using the "as" clause. For > example > > let $invoice as schema-element(my:invoice) := doc('invoice.xml')/* > return ... > > This will fail if doc() doesn't do the validation; how you control whether > or not doc() does validation is processor-specific, and will often involve > some kind of configuration options. In Saxon, for example, when you set > -val:strict on the command line, all input documents will be validated. (In > Altova, I believe validation happens if and only if there is an > xsi:schemaLocation attribute within the document itself.) > > Regards, > > Michael Kay > http://www.saxonica.com/ > http://twitter.com/michaelhkay > > > >> -----Original Message----- >> From: talk-bounces@x-query.com >> [mailto:talk-bounces@x-query.com] On Behalf Of Nuno Lopes >> Sent: 14 January 2010 17:30 >> To: talk@x-query.com >> Cc: Nuno Lopes >> Subject: [xquery-talk] declaring a variable of an imported schema type >> >> Hello all, >> >> I'm trying to declare a variable to be of a type that is >> imported from an XML schema definition. >> >> So far what I've been doing is something like: >> >> let $var := validate { element {$type} { $value } } ... >> >> and it works although is a bit cumbersome. >> Is there an easier way to do this, ie, without using the validate {} ? >> >> Thanks, >> -- >> Nuno Lopes >> >> >> >> >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk > From wcandillon at gmail.com Fri Jan 15 13:46:35 2010 From: wcandillon at gmail.com (William Candillon) Date: Fri Jan 15 04:05:19 2010 Subject: [xquery-talk] First XQuery Meetup at Zurich, March 11th 2010 Message-ID: <43b5c44e1001150446g6c872490n23ececf7c04f3e42@mail.gmail.com> Hello XQuery lovers! The first Zurich XQuery Meetup will be held in a prestigious location in the heart of the city, ETH Dozentenfoyer, March 11th 2010. More details at http://xquery.pbworks.com/Zurich-Meetup. Registration is done on the wiki. The meetup is just before XML Prague (March 13th and 14th) so feel free to stop by Zurich if you are on your way to Prague ;-) Best regards, William From vyacheslav.sedov at gmail.com Sat Jan 16 21:52:21 2010 From: vyacheslav.sedov at gmail.com (Vyacheslav Sedov) Date: Sat Jan 16 10:40:51 2010 Subject: [xquery-talk] "XQuery 1.1 was not enabled when invoking Saxon" Message-ID: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> well - i tried google but got nothing From mike at saxonica.com Sat Jan 16 19:05:17 2010 From: mike at saxonica.com (Michael Kay) Date: Sat Jan 16 10:53:39 2010 Subject: [xquery-talk] "XQuery 1.1 was not enabled when invoking Saxon" In-Reply-To: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> References: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> Message-ID: <46C43E606ACE40638D6A6178F664AC98@Sealion> Saxon questions are best asked on the saxon-help list. And with any question, it's best to say what you were trying to achieve, and what you did, and how it failed. The error message means that your query does something that's allowed in XQuery 1.1 but not in 1.0, but you didn't say you wanted to use XQuery 1.1. You need to have version 1.1 specified in the version declaration in the query prolog, and to request XQuery 1.1 processing on the command line or via the API. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Vyacheslav Sedov > Sent: 16 January 2010 18:52 > To: talk@x-query.com > Subject: [xquery-talk] "XQuery 1.1 was not enabled when > invoking Saxon" > > well - i tried google but got nothing > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From liam at w3.org Sat Jan 16 14:58:08 2010 From: liam at w3.org (Liam R E Quin) Date: Sat Jan 16 11:45:56 2010 Subject: [xquery-talk] "XQuery 1.1 was not enabled when invoking Saxon" In-Reply-To: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> References: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> Message-ID: <1263671888.15486.15.camel@desktop.barefootcomputing.com> On Sat, 2010-01-16 at 21:52 +0300, Vyacheslav Sedov wrote: > well - i tried google but got nothing This is a bit of an odd message. You stood in a field, burned the finest cedar-wood, sacrificed five pigeons and called Saxon! in a loud voice, and the XQuery 1.1 specification did not suddenly get published as a W3C Recommendation as a result? To be less flippant, XQuery 1.1 does not yet exists -- there is a draft, but no actual final language. Saxon PE 9.2, acording to Mike Kay's web page [1] does have some XQuery 1.1 features, and if you are using those you need to check your support contract (since Saxon PE is a commercial product). Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org www.advogato.org From mike at saxonica.com Sat Jan 16 21:05:52 2010 From: mike at saxonica.com (Michael Kay) Date: Sat Jan 16 12:48:17 2010 Subject: [xquery-talk] "XQuery 1.1 was not enabled when invoking Saxon" In-Reply-To: <1263671888.15486.15.camel@desktop.barefootcomputing.com> References: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> <1263671888.15486.15.camel@desktop.barefootcomputing.com> Message-ID: <84033FB014054D589493040F8C1BD5CF@Sealion> > > To be less flippant, XQuery 1.1 does not yet exists -- there > is a draft, but no actual final language. Saxon PE 9.2, > acording to Mike Kay's web page [1] does have some XQuery 1.1 > features, and if you are using those you need to check your > support contract (since Saxon PE is a commercial product). Indeed, the reason that Saxon makes you jump through several hoops before you can use XQuery 1.1 features is to ensure that you don't do it without thinking twice about it: the specification may change, the product may change, and your queries may stop working. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From vyacheslav.sedov at gmail.com Sun Jan 17 01:22:02 2010 From: vyacheslav.sedov at gmail.com (Vyacheslav Sedov) Date: Sat Jan 16 14:02:36 2010 Subject: [xquery-talk] "XQuery 1.1 was not enabled when invoking Saxon" In-Reply-To: <84033FB014054D589493040F8C1BD5CF@Sealion> References: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> <1263671888.15486.15.camel@desktop.barefootcomputing.com> <84033FB014054D589493040F8C1BD5CF@Sealion> Message-ID: <7ab7cbac1001161422q74d14115u4c4d21cdd0d7cde6@mail.gmail.com> i just want to learn about new XQuery 1.1 features - i got this message from trial version of OxygenXML but did not find something for XQuery 1.1 in Options... BTW i start to learn XSLT 1.0 from draft too in previous millenium - do you remenber "sort" in draft was as attribute (not as xsl:sort element)? ;) so i think it ok if something will change - i am metaprogramming fan so syntax changes not problem at all for me for me main problem when nothing changes - at this "stalled" time i think about death as "act of creation" for now i have not money nor for OxygenXML nor for SaxonEE - what about possibility to get license "on trust"? 2010/1/17 Michael Kay : >> >> To be less flippant, XQuery 1.1 does not yet exists -- there >> is a draft, but no actual final language. ?Saxon PE 9.2, >> acording to Mike Kay's web page [1] does have some XQuery 1.1 >> features, and if you are using those you need to check your >> support contract (since Saxon PE is a commercial product). > > Indeed, the reason that Saxon makes you jump through several hoops before > you can use XQuery 1.1 features is to ensure that you don't do it without > thinking twice about it: the specification may change, the product may > change, and your queries may stop working. > > Regards, > > Michael Kay > http://www.saxonica.com/ > http://twitter.com/michaelhkay > > From mike at saxonica.com Sat Jan 16 22:36:40 2010 From: mike at saxonica.com (Michael Kay) Date: Sat Jan 16 14:16:55 2010 Subject: [xquery-talk] "XQuery 1.1 was not enabled when invoking Saxon" In-Reply-To: <7ab7cbac1001161422q74d14115u4c4d21cdd0d7cde6@mail.gmail.com> References: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> <1263671888.15486.15.camel@desktop.barefootcomputing.com> <84033FB014054D589493040F8C1BD5CF@Sealion> <7ab7cbac1001161422q74d14115u4c4d21cdd0d7cde6@mail.gmail.com> Message-ID: <96F01C41E8604D52B1370BABB3334BA0@Sealion> > > i just want to learn about new XQuery 1.1 features - i got > this message from trial version of OxygenXML but did not find > something for XQuery 1.1 in Options... Oxygen enables Saxon-EE features, so you should be able to use this. I haven't actually got the latest version of Oxygen installed, so I can't point you to the right buttons to press. I suggest you ask them for advice. They are always very ready to help. It does help to say what you are doing when you raise a question on a forum. If you had said you were using Oxygen, we could have wasted less time. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > > BTW i start to learn XSLT 1.0 from draft too in previous > millenium - do you remenber "sort" in draft was as attribute > (not as xsl:sort element)? ;) > > so i think it ok if something will change - i am > metaprogramming fan so syntax changes not problem at all for me > > for me main problem when nothing changes - at this "stalled" > time i think about death as "act of creation" > > for now i have not money nor for OxygenXML nor for SaxonEE - > what about possibility to get license "on trust"? > > 2010/1/17 Michael Kay : > >> > >> To be less flippant, XQuery 1.1 does not yet exists -- there is a > >> draft, but no actual final language. ?Saxon PE 9.2, > acording to Mike > >> Kay's web page [1] does have some XQuery 1.1 features, and > if you are > >> using those you need to check your support contract (since > Saxon PE > >> is a commercial product). > > > > Indeed, the reason that Saxon makes you jump through several hoops > > before you can use XQuery 1.1 features is to ensure that > you don't do > > it without thinking twice about it: the specification may > change, the > > product may change, and your queries may stop working. > > > > Regards, > > > > Michael Kay > > http://www.saxonica.com/ > > http://twitter.com/michaelhkay > > > > From george at oxygenxml.com Mon Jan 18 10:39:17 2010 From: george at oxygenxml.com (George Cristian Bina) Date: Mon Jan 18 00:02:51 2010 Subject: [xquery-talk] "XQuery 1.1 was not enabled when invoking Saxon" In-Reply-To: <96F01C41E8604D52B1370BABB3334BA0@Sealion> References: <7ab7cbac1001161052k52037601r7f4287a42c16eec8@mail.gmail.com> <1263671888.15486.15.camel@desktop.barefootcomputing.com> <84033FB014054D589493040F8C1BD5CF@Sealion> <7ab7cbac1001161422q74d14115u4c4d21cdd0d7cde6@mail.gmail.com> <96F01C41E8604D52B1370BABB3334BA0@Sealion> Message-ID: <4B541E35.10703@oxygenxml.com> oXygen does not enable the XQuery 1.1 support of Saxon EE. We will add this as an option in the next release, in a couple of months. Best Regards, George -- George Cristian Bina XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Michael Kay wrote: >> i just want to learn about new XQuery 1.1 features - i got >> this message from trial version of OxygenXML but did not find >> something for XQuery 1.1 in Options... > > Oxygen enables Saxon-EE features, so you should be able to use this. > > I haven't actually got the latest version of Oxygen installed, so I can't > point you to the right buttons to press. I suggest you ask them for advice. > They are always very ready to help. > > It does help to say what you are doing when you raise a question on a forum. > If you had said you were using Oxygen, we could have wasted less time. > > Regards, > > Michael Kay > http://www.saxonica.com/ > http://twitter.com/michaelhkay > > >> BTW i start to learn XSLT 1.0 from draft too in previous >> millenium - do you remenber "sort" in draft was as attribute >> (not as xsl:sort element)? ;) >> >> so i think it ok if something will change - i am >> metaprogramming fan so syntax changes not problem at all for me >> >> for me main problem when nothing changes - at this "stalled" >> time i think about death as "act of creation" >> >> for now i have not money nor for OxygenXML nor for SaxonEE - >> what about possibility to get license "on trust"? >> >> 2010/1/17 Michael Kay : >>>> To be less flippant, XQuery 1.1 does not yet exists -- there is a >>>> draft, but no actual final language. Saxon PE 9.2, >> acording to Mike >>>> Kay's web page [1] does have some XQuery 1.1 features, and >> if you are >>>> using those you need to check your support contract (since >> Saxon PE >>>> is a commercial product). >>> Indeed, the reason that Saxon makes you jump through several hoops >>> before you can use XQuery 1.1 features is to ensure that >> you don't do >>> it without thinking twice about it: the specification may >> change, the >>> product may change, and your queries may stop working. >>> >>> Regards, >>> >>> Michael Kay >>> http://www.saxonica.com/ >>> http://twitter.com/michaelhkay >>> >>> > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From elharo at ibiblio.org Tue Jan 19 07:16:07 2010 From: elharo at ibiblio.org (Elliotte Rusty Harold) Date: Tue Jan 19 03:35:28 2010 Subject: [xquery-talk] Lookup tables or equivalent Message-ID: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> Simple problem. I want an XQuery function that turns an English month name string such "February" into the equivalent number such as 2. Is there any prettier way to do this than if-then-else nested 12 levels deep? E.g. a switch statement or a map or some such? -- Elliotte Rusty Harold elharo@ibiblio.org From adam.retter at googlemail.com Tue Jan 19 12:21:50 2010 From: adam.retter at googlemail.com (Adam Retter) Date: Tue Jan 19 03:41:07 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> Message-ID: index-of(("January", "February", "March", "April"), "February") 2010/1/19 Elliotte Rusty Harold : > Simple problem. I want an XQuery ?function that turns an English month > name string such ?"February" into the equivalent number such as 2. > > Is there any prettier way to do this than if-then-else nested 12 > levels deep? E.g. a switch statement or a map or some such? > > -- > Elliotte Rusty Harold > elharo@ibiblio.org > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Adam Retter skype :adam.retter http://www.adamretter.org.uk From dlee at calldei.com Tue Jan 19 07:24:46 2010 From: dlee at calldei.com (David Lee) Date: Tue Jan 19 03:44:02 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> Message-ID: <3FFFCA9AA2394E25B5D33E99CDBCE959@DLEEI7> declare variable $months := ("Janurary","Feburary","March","April","May","June","July","August","September","October","November","December"); fn:index-of($months,"March") ---------------------------------------------------- David A. Lee dlee@calldei.com http://www.calldei.com http://www.xmlsh.org -------------------------------------------------- From: "Elliotte Rusty Harold" Sent: Tuesday, January 19, 2010 7:16 AM To: Subject: [xquery-talk] Lookup tables or equivalent > Simple problem. I want an XQuery function that turns an English month > name string such "February" into the equivalent number such as 2. > > Is there any prettier way to do this than if-then-else nested 12 > levels deep? E.g. a switch statement or a map or some such? > > -- > Elliotte Rusty Harold > elharo@ibiblio.org > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From davidc at nag.co.uk Tue Jan 19 13:01:59 2010 From: davidc at nag.co.uk (David Carlisle) Date: Tue Jan 19 04:20:48 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: (message from Adam Retter on Tue, 19 Jan 2010 12:21:50 +0000) References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> Message-ID: <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> Others have suggested strings and index-of. An alternative, more xml-oriented, version would be .../February/count(preceding-sibling::*)+1 or to avoid the possibly linear sibling count, .../February/number(@n) David From elharo at ibiblio.org Tue Jan 19 08:10:59 2010 From: elharo at ibiblio.org (Elliotte Rusty Harold) Date: Tue Jan 19 04:29:24 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> Message-ID: <654a2bb31001190510q26a1dffboe0ba6876d87add31@mail.gmail.com> These all look good. What if we generalize the problem? Given an ordered list of N values (not necessarily strings) map each one to another value (not necessarily a number). I suppose you could use two elements. E.g. ... ... Then use the position of the key to select the right value. -- Elliotte Rusty Harold elharo@ibiblio.org From dlee at calldei.com Tue Jan 19 08:39:19 2010 From: dlee at calldei.com (David Lee) Date: Tue Jan 19 05:39:15 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> Message-ID: <79FE2D552D064F5D8257DF55FF5E9E81@DLEEI7> This solution gets a little more tedious if the month name comes as data instead of hard-coded in the xquery. E,g you have to do something like let $months := ... , $month := "March" (: or some extracted value :) return $months/*[node-name(.) eq $month]/count(preceding-sibling::*)+1 This is why I wouldn't put key values as element names. It also limits you to valid element names. I would use attributes or values as key values. When I start getting complicated maps I generate a xml structure like this Value ... This gives you atomic types for keys and (almost) any xdm value value for the value. Having keys be non-strings or numbers gets a bit trickier and difficult to generalize. You have to start defining what equality is in something like key value value Defining equality for is generally not a generically answerable question. Whereas using atomic values for keys is comparable universally with "eq" ---------------------------------------------------- David A. Lee dlee@calldei.com http://www.calldei.com http://www.xmlsh.org -------------------------------------------------- From: "David Carlisle" Sent: Tuesday, January 19, 2010 8:01 AM To: ; Subject: Re: [xquery-talk] Lookup tables or equivalent > > Others have suggested strings and index-of. An alternative, more > xml-oriented, version would be > > .../February/count(preceding-sibling::*)+1 > > > or to avoid the possibly linear sibling count, > > n="4"/>.../February/number(@n) > > > David > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From mike at saxonica.com Tue Jan 19 13:39:03 2010 From: mike at saxonica.com (Michael Kay) Date: Tue Jan 19 05:41:45 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> Message-ID: index-of(("January", "February", ...), $m) Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Elliotte Rusty Harold > Sent: 19 January 2010 12:16 > To: talk@x-query.com > Subject: [xquery-talk] Lookup tables or equivalent > > Simple problem. I want an XQuery function that turns an > English month name string such "February" into the > equivalent number such as 2. > > Is there any prettier way to do this than if-then-else nested > 12 levels deep? E.g. a switch statement or a map or some such? > > -- > Elliotte Rusty Harold > elharo@ibiblio.org > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From adam.retter at googlemail.com Tue Jan 19 13:42:37 2010 From: adam.retter at googlemail.com (Adam Retter) Date: Tue Jan 19 05:42:20 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190510q26a1dffboe0ba6876d87add31@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> <654a2bb31001190510q26a1dffboe0ba6876d87add31@mail.gmail.com> Message-ID: > These all look good. What if we generalize the problem? Given an > ordered list of N values (not necessarily strings) map each one to > another value (not necessarily a number). index-of(...) would still be a valid solution as it can operate on a sequence of any atomic type, not just strings - http://www.w3.org/TR/xpath-functions/#func-index-of > I suppose you could use two elements. E.g. > > ... > ... > > Then use the position of the key to select the right value. > > -- > Elliotte Rusty Harold > elharo@ibiblio.org > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Adam Retter skype :adam.retter http://www.adamretter.org.uk From mike at saxonica.com Tue Jan 19 13:46:36 2010 From: mike at saxonica.com (Michael Kay) Date: Tue Jan 19 05:49:13 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> Message-ID: <7925BAC3F59C429A99905466EA4421AF@Sealion> index-of(("January", "February", ...), $m) Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Elliotte Rusty Harold > Sent: 19 January 2010 12:16 > To: talk@x-query.com > Subject: [xquery-talk] Lookup tables or equivalent > > Simple problem. I want an XQuery function that turns an > English month name string such "February" into the > equivalent number such as 2. > > Is there any prettier way to do this than if-then-else nested > 12 levels deep? E.g. a switch statement or a map or some such? > > -- > Elliotte Rusty Harold > elharo@ibiblio.org > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Tue Jan 19 13:49:40 2010 From: mike at saxonica.com (Michael Kay) Date: Tue Jan 19 05:52:12 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> Message-ID: <5341C03733164424852D31AABB6C3FD9@Sealion> index-of(("January", "February", ...), $m) Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Elliotte Rusty Harold > Sent: 19 January 2010 12:16 > To: talk@x-query.com > Subject: [xquery-talk] Lookup tables or equivalent > > Simple problem. I want an XQuery function that turns an > English month name string such "February" into the > equivalent number such as 2. > > Is there any prettier way to do this than if-then-else nested > 12 levels deep? E.g. a switch statement or a map or some such? > > -- > Elliotte Rusty Harold > elharo@ibiblio.org > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Tue Jan 19 13:51:55 2010 From: mike at saxonica.com (Michael Kay) Date: Tue Jan 19 05:55:06 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> Message-ID: index-of(("January", "February", ...), $m) Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Elliotte Rusty Harold > Sent: 19 January 2010 12:16 > To: talk@x-query.com > Subject: [xquery-talk] Lookup tables or equivalent > > Simple problem. I want an XQuery function that turns an > English month name string such "February" into the > equivalent number such as 2. > > Is there any prettier way to do this than if-then-else nested > 12 levels deep? E.g. a switch statement or a map or some such? > > -- > Elliotte Rusty Harold > elharo@ibiblio.org > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From john.snelson at oracle.com Tue Jan 19 14:13:51 2010 From: john.snelson at oracle.com (John Snelson) Date: Tue Jan 19 06:13:33 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190510q26a1dffboe0ba6876d87add31@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> <654a2bb31001190510q26a1dffboe0ba6876d87add31@mail.gmail.com> Message-ID: <4B55BE1F.4030807@oracle.com> The solutions we've seen have all more than likely been linear searches (an implementation could do better but I think it's unlikely). Using either XML structure (for string based keys/values), or the closure facilities of higher order functions (XQuery 1.1 WD, works with keys / values of any type), it is also possible to build binary search trees like a red/black tree. I don't know of any publicly available XQuery modules which implement that yet, but I've written one myself that uses XQuery 1.1 higher order functions. John Elliotte Rusty Harold wrote: > These all look good. What if we generalize the problem? Given an > ordered list of N values (not necessarily strings) map each one to > another value (not necessarily a number). > > I suppose you could use two elements. E.g. > > ... > ... > > Then use the position of the key to select the right value. > -- John Snelson, Oracle Corporation http://snelson.org.uk/john Berkeley DB XML: http://oracle.com/database/berkeley-db/xml XQilla: http://xqilla.sourceforge.net From davidc at nag.co.uk Tue Jan 19 14:22:49 2010 From: davidc at nag.co.uk (David Carlisle) Date: Tue Jan 19 06:21:50 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <79FE2D552D064F5D8257DF55FF5E9E81@DLEEI7> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> <79FE2D552D064F5D8257DF55FF5E9E81@DLEEI7> Message-ID: <201001191422.o0JEMnqR026061@glenlivet.nag.co.uk> > This is why I wouldn't put key values as element names. It also limits you > to valid element names. > I would use attributes or values as key values. so would I probably, but it wouldn't look as interesting in a mailing list reply. > When I start getting complicated maps I generate a xml structure like this > > Value > ... > yes definitely: that was probably the main point of my reply (but perhaps obsured by the coding style I chose:-) that in xquery you can use xml structure to make more interesting mapping structures, you are not restricted to integer indexed indexing into lists of strings. David From mike at saxonica.com Tue Jan 19 14:24:57 2010 From: mike at saxonica.com (Michael Kay) Date: Tue Jan 19 06:23:46 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <654a2bb31001190510q26a1dffboe0ba6876d87add31@mail.gmail.com> References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com><201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> <654a2bb31001190510q26a1dffboe0ba6876d87add31@mail.gmail.com> Message-ID: <0CF74FB28C2B4A0492EA88DF2E6B3177@Sealion> > > These all look good. What if we generalize the problem? Given > an ordered list of N values (not necessarily strings) map > each one to another value (not necessarily a number). > Use an XML lookup table ... Saxon-EE will generally implement the lookup $data/item[@code=$c] by building an index. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From davidc at nag.co.uk Tue Jan 19 14:26:20 2010 From: davidc at nag.co.uk (David Carlisle) Date: Tue Jan 19 06:26:10 2010 Subject: [xquery-talk] Lookup tables or equivalent In-Reply-To: <4B55BE1F.4030807@oracle.com> (message from John Snelson on Tue, 19 Jan 2010 14:13:51 +0000) References: <654a2bb31001190416p2d74d48dy2adb3143064acd35@mail.gmail.com> <201001191301.o0JD1xtQ023754@glenlivet.nag.co.uk> <654a2bb31001190510q26a1dffboe0ba6876d87add31@mail.gmail.com> <4B55BE1F.4030807@oracle.com> Message-ID: <201001191426.o0JEQKuH026689@glenlivet.nag.co.uk> > The solutions we've seen have all more than likely been linear searches > (an implementation could do better but I think it's unlikely) That was one reason I sugested switching to elements rather than string sequences as (perhaps) it is more likely that they get indexed (in xslt you could force indexing with xsl:key) but I didn't mention that as it's not clear which processeors would index what, especially if the actual data only has length 12. David From elharo at ibiblio.org Wed Jan 20 08:20:16 2010 From: elharo at ibiblio.org (Elliotte Rusty Harold) Date: Wed Jan 20 05:20:15 2010 Subject: [xquery-talk] xsl:copy equivalent in XQuery Message-ID: <654a2bb31001200520p13e60e7i57b394be1695f70a@mail.gmail.com>
foo

bar

other random text and elements
into this
foo

bar

other random text and elements
That is, I just want to add the div around the content, but preserve everything else. This is straight-forward in XSLT. Is it as hard in XQuery as it seems to me? Or am I missing something obvious? What I need is an equivalent of the xsl:copy function. -- Elliotte Rusty Harold elharo@ibiblio.org From wolfgang at exist-db.org Wed Jan 20 14:34:56 2010 From: wolfgang at exist-db.org (Wolfgang Meier) Date: Wed Jan 20 05:34:23 2010 Subject: [xquery-talk] xsl:copy equivalent in XQuery In-Reply-To: <654a2bb31001200520p13e60e7i57b394be1695f70a@mail.gmail.com> References: <654a2bb31001200520p13e60e7i57b394be1695f70a@mail.gmail.com> Message-ID: <19f274051001200534x495682a3o78debabb74dc0af7@mail.gmail.com> How about: let $quote :=
foo

bar

other random text and elements
return
{$quote/@*}
{$quote/node()}
If you need to apply several transformations like this, using a recursive function might work best: declare function local:filter($node as node()) { typeswitch ($node) case element(blockquote) return
{$node/@*}
{$node/node()}
case element() return element { node-name($node) } { for $child in $node/node() return local:transform($child) } default return $node }; From james.fuller.2007 at gmail.com Wed Jan 20 14:44:06 2010 From: james.fuller.2007 at gmail.com (James Fuller) Date: Wed Jan 20 05:43:29 2010 Subject: [xquery-talk] xsl:copy equivalent in XQuery In-Reply-To: <654a2bb31001200520p13e60e7i57b394be1695f70a@mail.gmail.com> References: <654a2bb31001200520p13e60e7i57b394be1695f70a@mail.gmail.com> Message-ID: Hello Elliotte, you might find my article on Advanced XQuery useful http://www.ibm.com/developerworks/edu/x-dw-x-advxquery.html .. if u cant be bothered with IBM logon I have a pdf on my site here http://www.ibm.com/developerworks/edu/x-dw-x-advxquery.html hth, James Fuller On Wed, Jan 20, 2010 at 2:20 PM, Elliotte Rusty Harold wrote: >
> foo >

bar

> > other random text and elements > >
> > > into this > >
> foo >

bar

> > other random text and elements >
>
> > That is, I just want to add the div around the content, but preserve > everything else. > > This is straight-forward in XSLT. Is it as hard in XQuery as it seems > to me? Or am I missing something obvious? What I need is an equivalent > of the xsl:copy function. > > -- > Elliotte Rusty Harold > elharo@ibiblio.org > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From davidc at nag.co.uk Wed Jan 20 13:48:17 2010 From: davidc at nag.co.uk (David Carlisle) Date: Wed Jan 20 05:47:40 2010 Subject: [xquery-talk] xsl:copy equivalent in XQuery In-Reply-To: <654a2bb31001200520p13e60e7i57b394be1695f70a@mail.gmail.com> References: <654a2bb31001200520p13e60e7i57b394be1695f70a@mail.gmail.com> Message-ID: <4B5709A1.2010708@nag.co.uk> On 20/01/2010 13:20, Elliotte Rusty Harold wrote: >
> foo >

bar

> > other random text and elements > >
> > > into this > >
> foo >

bar

> > other random text and elements >
>
> > That is, I just want to add the div around the content, but preserve > everything else. > > This is straight-forward in XSLT. Is it as hard in XQuery as it seems > to me? Or am I missing something obvious? What I need is an equivalent > of the xsl:copy function. > there isn't xsl;copy but there is xsl:element name="{name()}" which is more or less the same thing. let $s :=
stuff
more
return element {node-name($s)} {$s/@*,
{$s/node()}
} ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From james.fuller.2007 at gmail.com Wed Jan 20 16:04:14 2010 From: james.fuller.2007 at gmail.com (James Fuller) Date: Wed Jan 20 07:01:49 2010 Subject: [xquery-talk] xsl:copy equivalent in XQuery In-Reply-To: References: <654a2bb31001200520p13e60e7i57b394be1695f70a@mail.gmail.com> Message-ID: sorry, as a few pointed out, made a mistake with the pdf version http://www.webcomposite.com/resource/pdf/x-advxquery-pdf.pdf hth, James Fuller On Wed, Jan 20, 2010 at 2:44 PM, James Fuller wrote: > Hello Elliotte, > > you might find my article on Advanced XQuery useful > > http://www.ibm.com/developerworks/edu/x-dw-x-advxquery.html > > .. if u cant be bothered with IBM logon I have a pdf on my site here > > http://www.ibm.com/developerworks/edu/x-dw-x-advxquery.html > > hth, James Fuller > > On Wed, Jan 20, 2010 at 2:20 PM, Elliotte Rusty Harold > wrote: >>
>> foo >>

bar

>> >> other random text and elements >> >>
>> >> >> into this >> >>
>> foo >>

bar

>> >> other random text and elements >>
>>
>> >> That is, I just want to add the div around the content, but preserve >> everything else. >> >> This is straight-forward in XSLT. Is it as hard in XQuery as it seems >> to me? Or am I missing something obvious? What I need is an equivalent >> of the xsl:copy function. >> >> -- >> Elliotte Rusty Harold >> elharo@ibiblio.org >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk >> > From mfoster at mcgrathsystems.com Wed Jan 20 14:12:59 2010 From: mfoster at mcgrathsystems.com (Mike Foster) Date: Wed Jan 20 11:08:39 2010 Subject: [xquery-talk] XQuery Application Architect--St. Louis, MO Message-ID: <19400F45A6AF88489DC63683C5E20A6312278765@mcgrath-exch.hosting.corp.mcgrathsystems.com> Skipped content of type multipart/related-------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Foster .vcf Type: text/x-vcard Size: 624 bytes Desc: Michael Foster .vcf Url : http://x-query.com/pipermail/talk/attachments/20100120/30025317/MichaelFoster-0001.vcf From vyacheslav.sedov at gmail.com Wed Jan 20 22:47:05 2010 From: vyacheslav.sedov at gmail.com (Vyacheslav Sedov) Date: Wed Jan 20 11:39:10 2010 Subject: [xquery-talk] XQuery Application Architect--St. Louis, MO In-Reply-To: <19400F45A6AF88489DC63683C5E20A6312278765@mcgrath-exch.hosting.corp.mcgrathsystems.com> References: <19400F45A6AF88489DC63683C5E20A6312278765@mcgrath-exch.hosting.corp.mcgrathsystems.com> Message-ID: <7ab7cbac1001201147x1d63fa53vb36cd033e68df9ce@mail.gmail.com> excellent i know one man - author of first 100% based on metaprogramming xquery-based CMF (see http://describer.schematronic.org/) - he is one of eXist-db.org developers his name Evgeny Gazdovsky (see http://exist-db.org/credits.html), his family is very poor so you can save some money and get great developer with clear mind and bright future - i wish it work for me but have not money even to hire housekeeper 2010/1/20 Mike Foster > > Hello, > > I hope everyone is doing well.? I have a current opening with my client in St. Louis, MO for an Application Architect.? Please let me know if you or anyone you may know would be interested.? Not a fit? E-mail me your resume and I will try my best to find a?closer fit!!? Below is the job description: > > > Application Architect > > > > Currently our client in the St. Louis, MO area is searching for an individual will responsible for all software development related to XQuery / Mark Logic functionality. In this role, this Engineering Professional will work closely with internal and external teams using Java/J2EE, XQuery, and will also be developing new XQuery applications for ongoing data sets.? Additionally, this individual will be an ?expert? in these technologies and will act as a mentor and internal resource for expertise in these technologies within the company. > > Qualified applicants will have a very strong working knowledge of and hands-on experience with, W3C XML initiatives, specifically XML Query, XSL & Mark Logic's XML server, along with strong analysis skills & attention to detail. > Knowledge of development using ClearCase, Java & Perl are preferred. > Candidates must have experience with XQuery, XPath & XSL programming in a mission-critical, high-performance, secure Linux environment. > Up to 10% travel will be required. > This person must be a good communicator and work very well independently as well as a member of a high performing team. > > Additional Responsibilities: > > Partners with product development team (web development, content development and tech leads on shared services) to help drive product specification and provide guidance. > Constructs and implement the technical design for the organization's presence on the Internet. Owns the technical design of Web applications and write technical specifications, including information architecture, data design, and technical details. > Works with product team to define software products by consulting during specification stage, performing research, developing prototypes or proofs-of-concept, and acting as an expert technical contributor. Should be able to code if necessary with the development teams. > Contributes to general development efforts by producing documentation and training materials and conducting training sessions. > Develops and maintain expertise in a wide range of industry technologies including emerging Internet technologies. Generate proposals for the management team and conduct presentation/training sessions for the development teams. Participate in standards, organizations and industry groups. > Works with the development teams to ensure implementation of the product vision. Provide communication and integration point to other parts of Engineering, IT, and System organization including other architects to identify and address any issues or impact those projects might have on those areas. > Focuses on web-specific technologies and scenarios and apply best practices, patterns, and oftentimes reference architectures around delivering web-native experiences with software. Should drive for uniformity across products to keep the technology / products simple, flexible, scalable and maintainable. > Sometimes responsible for creating original Web site content. > Responsible for ascertaining system volume and analyzing traffic patterns. > Is able to easily switch?from being strategic to tactical. > Is on top of the new and emerging technologies. > > > > Requirements: > > Over 8-12 years of experience in product development, primarily around thin client UI development with 4-5 years in an architecture role round Web 2.0, Java, J2EE, RDBMS and Web Content Management Solutions and community features. > Good understanding of web browser design and W3C standards compliance/adoption, developing smart clients for targeted environments (Windows, Linux .NET/ Java SE/ME).? Proficient in XHTML, CSS, AJAX, JavaScript, DHTML, DOM scripting, Xquery,xsl style sheets, templating engines > Good understanding of content syndication and aggregation scenarios and technologies such as RSS and ATOM, and data interconnectivity with web services APIs either via SOAP, REST for rich and loosely coupled functionality. > Good understanding of Search Engine optimizations, taxonomy development and management, semantic tagging and content engineering. > Exceptional knowledge of various Web development languages is required. > Well versed around session and state management, instrumentation, caching design, security and identity, smart client and mobile to web topologies, user experience patterns and practices, performance and scalability considerations,?service-oriented architecture, and very importantly, peer-to-peer architecture and design. > Well versed with composite application designs and the associated patterns such as dependency Injection (inversion of control) and associated frameworks. > Knowledgeable on open source technologies and emerging Internet technologies. > Knowledge of technologies such as Adobe Flash, Flex, native XML databases, web content management system, publishing background is an added bonus. > > > > Be sure to attach an MS Word (.doc) version of your resume along with 3 Professional references to be considered! > > McGrath Systems > Where people and performance meet. > > Join the team at McGrath Systems! We are staffing leaders employing people in various Technical, Engineering, Information Technology, Aerospace & Defense, Manufacturing, Energy, and Accounting & Finance positions throughout the Continental US. If you are looking for a great opportunity, competitive wage and a career path to success, call us right now! We offer comprehensive benefits to include medical, dental, 401k as well as periodic bonuses!!! > 3 > > Ranked 2nd fastest growing privately held company - 2008 Philadelphia 100 > > Top 10 Local Recruiting Firm?2006, 2007 & 2008 - Philadelphia Business Journal > > To see more opportunities visit us at: > > www.mcgrathsystems.com > > > > Thank you, > > > Mike Foster, CIR > Senior Technical Recruiter > > McGrath Systems > Where People and Performance Meet > > 1777 Sentry Parkway West | Suite 110 | Gwynedd Hall > Blue Bell, PA? 19422 > P: 610.238.5306 ext: 227 | F: 610.238.5308| www.mcgrathsystems.com > > Facebook Me!!! > > Follow me on Twitter!!! > > LinkedIn Profile!!! > > 2010 Emerging Business of the Year - Philadelphia Chamber of Commerce > > Ranked one of the fastest growing privately held companies 2008 & 2009 - Philadelphia 100 > > > > P?Please consider the environment before printing this e-mail > > > > This message is for the named person's use only. It may contain confidential, proprietary or legally privileged material. No confidentiality or privilege is waived by any accidental or unintentional transmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient and reply immediately to the sender to inform person of error. > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From jakob.fix at gmail.com Thu Jan 21 15:42:28 2010 From: jakob.fix at gmail.com (Jakob Fix) Date: Thu Jan 21 06:40:49 2010 Subject: [xquery-talk] XML/Xquery programmer job at Paris, France Message-ID: Hi, some readers on this list may be interested to know that there's a job opening at the OECD in Paris, France, for an XML Web programmer who should, among other things, be knowledgable of XSLT, Xquery and friends. For the full details, please see here: http://www.oecd.org/hrm/vacancies (job number 3418). Thanks, Jakob. PS: You may contact me off-list if you are interested in more information. No recruiters please. From andrew.j.welch at gmail.com Thu Jan 21 14:58:23 2010 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Thu Jan 21 06:56:06 2010 Subject: [xquery-talk] format-date Message-ID: <74a894af1001210658l6d19d89cw8b4031a6d3ca4b90@mail.gmail.com> XQuery appears to lacking a format-date() function... for example to get "21st Jan 2010" I would use: format-date(xs:date('2010-01-21'), '[D1o] [MNn,*-3] [Y0001]') Do I need to do that manually in XQuery? thanks -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From davidc at nag.co.uk Thu Jan 21 15:08:00 2010 From: davidc at nag.co.uk (David Carlisle) Date: Thu Jan 21 07:05:45 2010 Subject: [xquery-talk] format-date In-Reply-To: <74a894af1001210658l6d19d89cw8b4031a6d3ca4b90@mail.gmail.com> References: <74a894af1001210658l6d19d89cw8b4031a6d3ca4b90@mail.gmail.com> Message-ID: <4B586DD0.5020704@nag.co.uk> On 21/01/2010 14:58, Andrew Welch wrote: > XQuery appears to lacking a format-date() function... for example to > get "21st Jan 2010" I would use: > > format-date(xs:date('2010-01-21'), '[D1o] [MNn,*-3] [Y0001]') > > Do I need to do that manually in XQuery? > > thanks yes or wait for 1.1 http://www.w3.org/TR/2009/WD-xquery-11-requirements-20091215/#date-formatting ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From jonathan.robie at redhat.com Thu Jan 21 10:12:03 2010 From: jonathan.robie at redhat.com (Jonathan Robie) Date: Thu Jan 21 07:09:14 2010 Subject: [xquery-talk] format-date In-Reply-To: <74a894af1001210658l6d19d89cw8b4031a6d3ca4b90@mail.gmail.com> References: <74a894af1001210658l6d19d89cw8b4031a6d3ca4b90@mail.gmail.com> Message-ID: <4B586EC3.3060800@redhat.com> On 01/21/2010 09:58 AM, Andrew Welch wrote: > XQuery appears to lacking a format-date() function... for example to > get "21st Jan 2010" I would use: > > format-date(xs:date('2010-01-21'), '[D1o] [MNn,*-3] [Y0001]') > In XQuery 1.1, this function does exist: http://www.w3.org/TR/xpath-functions-11/#formatting-dates-and-times In XQuery 1.0, you do have to do it yourself. Jonathan From andrew.j.welch at gmail.com Thu Jan 21 15:12:03 2010 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Thu Jan 21 07:09:39 2010 Subject: [xquery-talk] format-date In-Reply-To: <4B586DD0.5020704@nag.co.uk> References: <74a894af1001210658l6d19d89cw8b4031a6d3ca4b90@mail.gmail.com> <4B586DD0.5020704@nag.co.uk> Message-ID: <74a894af1001210712x621ba7d5s89c3b136b7c6bc51@mail.gmail.com> 2010/1/21 David Carlisle : > On 21/01/2010 14:58, Andrew Welch wrote: >> >> XQuery appears to lacking a format-date() function... for example to >> get "21st Jan 2010" I would use: >> >> format-date(xs:date('2010-01-21'), '[D1o] [MNn,*-3] [Y0001]') >> >> Do I need to do that manually in XQuery? >> >> thanks > > yes or wait for 1.1 > > http://www.w3.org/TR/2009/WD-xquery-11-requirements-20091215/#date-formatting "XQuery 1.1 MUST include additional library functions or an equivalent mechanism to perform formatting of date and time values." :) that's pretty much how I feel about it.... thanks -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From adam.retter at googlemail.com Thu Jan 21 15:25:57 2010 From: adam.retter at googlemail.com (Adam Retter) Date: Thu Jan 21 07:23:26 2010 Subject: [xquery-talk] format-date In-Reply-To: <4B586DD0.5020704@nag.co.uk> References: <74a894af1001210658l6d19d89cw8b4031a6d3ca4b90@mail.gmail.com> <4B586DD0.5020704@nag.co.uk> Message-ID: 2010/1/21 David Carlisle : > On 21/01/2010 14:58, Andrew Welch wrote: >> >> XQuery appears to lacking a format-date() function... for example to >> get "21st Jan 2010" I would use: >> >> format-date(xs:date('2010-01-21'), '[D1o] [MNn,*-3] [Y0001]') >> >> Do I need to do that manually in XQuery? >> >> thanks > > yes or wait for 1.1 > > http://www.w3.org/TR/2009/WD-xquery-11-requirements-20091215/#date-formatting In the meantime you could use a concatenation of these functions - http://www.xqueryfunctions.com/xq/c0002.html ...Or depending on the XQuery Engine Implementation that you are using, they may provide an extension function, eXist-db provides the datetime: extension namespace for such functions and I believe that MarkLogic also offer something. > ________________________________________________________________________ > The Numerical Algorithms Group Ltd is a company registered in England > and Wales with company number 1249803. The registered office is: > Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. > > This e-mail has been scanned for all viruses by Star. The service is > powered by MessageLabs. > ________________________________________________________________________ > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Adam Retter skype :adam.retter http://www.adamretter.org.uk From wcandillon at gmail.com Mon Jan 25 14:31:54 2010 From: wcandillon at gmail.com (William Candillon) Date: Mon Jan 25 05:31:47 2010 Subject: [xquery-talk] Looking to meet XQuery enthusiasts in your area? Message-ID: <43b5c44e1001250531k164013dcrc0f565e4758bc544@mail.gmail.com> Hi, A couple of weeks ago we started a wiki at http://xquery.pbworks.com in order to help XQuery enthusiasts from the same area to gather around a snack and a beer. Our aim is to promote knowledge sharing and best practice amongst XQuery developers and business professionals around the world by organizing local meetups. Are you interested in organizing a meetup in your area? The wiki contains some guidelines and tips of organizing such event. Keep it small and informal, it's actually not much work and a lot of fun :-) Best regards, William From james+xquery at blushingbunny.net Mon Jan 25 20:12:19 2010 From: james+xquery at blushingbunny.net (James Cummings) Date: Mon Jan 25 12:08:29 2010 Subject: [xquery-talk] preceding:: and following:: over a collection Message-ID: <961274971001251212g5b68cde9n60ada24d3f9153d@mail.gmail.com> Hiya, I want to do something (fairly inefficient) like: let $ let $elementOfInterest := collection(/db/files)//tei:*[@xml:id=$elementID] (...) let $previousElementID := data($elementOfInterest/preceding::tei:ab[@type='foo'][1]/@xml:id) let $followingElementID := data($elementOfInterest/following::tei:ab[@type='foo'][1]/@xml:id) but my problem is that preceding:: and following:: seem to stop at the document boundary rather than the collection as a whole. So, when I get to the first element of any document it doesn't find the next element as being the last one in the preceding file. I realise I'm probably missing something simple here. Thanks for any help, -James From mike at saxonica.com Mon Jan 25 20:49:48 2010 From: mike at saxonica.com (Michael Kay) Date: Mon Jan 25 12:44:50 2010 Subject: [xquery-talk] preceding:: and following:: over a collection In-Reply-To: <961274971001251212g5b68cde9n60ada24d3f9153d@mail.gmail.com> References: <961274971001251212g5b68cde9n60ada24d3f9153d@mail.gmail.com> Message-ID: <452FE65AB7FD48F6994228EE4FD7CCC6@Sealion> > but my problem is that preceding:: and following:: seem to > stop at the document boundary rather than the collection as a > whole. So, when I get to the first element of any document > it doesn't find the next element as being the last one in the > preceding file. > > I realise I'm probably missing something simple here. Yes, the code you've written doesn't solve the problem, for the reasons you have discovered. Perhaps you could describe the problem: it's not easy to reverse-engineer it from code that doesn't work. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From james+xquery at blushingbunny.net Tue Jan 26 00:14:02 2010 From: james+xquery at blushingbunny.net (James Cummings) Date: Mon Jan 25 16:06:15 2010 Subject: [xquery-talk] preceding:: and following:: over a collection In-Reply-To: <452FE65AB7FD48F6994228EE4FD7CCC6@Sealion> References: <961274971001251212g5b68cde9n60ada24d3f9153d@mail.gmail.com> <452FE65AB7FD48F6994228EE4FD7CCC6@Sealion> Message-ID: <961274971001251614q762b99d5jf3481c09a7063038@mail.gmail.com> On Mon, Jan 25, 2010 at 20:49, Michael Kay wrote: > Yes, the code you've written doesn't solve the problem, for the reasons you > have discovered. > > Perhaps you could describe the problem: it's not easy to reverse-engineer it > from code that doesn't work. Hi Mike, In this case I have 48 years worth of transcribed historical diary, with each day/month/year being one of the objects I want to find the previous/next node for. The query gets a parameter in YYYY-MM-DD, YYYY-MM or YYYY format and returns the appropriate year, month or day from the correct file because this parameter value makes up part of the @xml:id. In each instance I want to provide prevYear/nextYear, prevMonth/nextMonth, prevDay/nextDay navigational links regardless of the fact that I'm sitting on 1798-01-01 and the 1797-12-31 (if it exists) is in the previous file. One straightforward solution is of course to generate a skeleton of the entire collection: .... ... ... and use that as a lookup table...as then preceding::day[1] (or month or year) from the current id's location in that file would work and give me just what I need. However, that seemed like a terribly kludgy workaround. (There are only 48 years of the diary...so that would be some 18K elements....but all this makes me think I'm missing a much easier way!) Since my XQuery knowledge still is at a basic level I'm happy for any suggestions you might have. -James Cummings From jim.melton at acm.org Mon Jan 25 17:56:56 2010 From: jim.melton at acm.org (Jim Melton) Date: Mon Jan 25 16:48:34 2010 Subject: [xquery-talk] [ANN] XQuery and XPath Full Text Test Suite version 1.0.1 Message-ID: <7.0.1.0.2.20100125175631.05df4fc0@oracle.com> The W3C's XML Query Working Group and XSL Working Group are pleased to announce the availability of version 1.0.1 of the XQuery and XPath Full Text Test Suite (XQFTTS) at http://dev.w3.org/2007/xpath-full-text-10-test-suite/. The tests suite contains information about how to run the test suite and how to submit the results (anonymously, if you desire). XQFTTS 1.0.1 fixes a number of bugs reported against XQFTTS 1.0.0 and it reflects a small number of CR issues that have been resolved by the WGs. We encourage implementors who have sent us reports for XQFTTS 1.0.0 to run XQFTTS 1.0.1 and send us their final reports. Implementors who have not yet run the XQFTTS at all are strongly encouraged to run XQFTTF 1.0.1 and submit their implementation reports. The reports that we have received provide a significant amount of the implementation experience that we need to request a transition to Proposed Recommendation. We would especially appreciate a report showing an implementation of Minimal Conformance using the XQueryX syntax. We will continue to maintain and enhance the test suite after our transition to Proposed Recommendation. We do not expect to send out any further announcements about our test suite -- any news or updates will be posted on our web page. Thanks! Jim ======================================================================== Jim Melton --- Editor of ISO/IEC 9075-* (SQL) Phone: +1.801.942.0144 Chair, W3C XML Query WG; XQX (etc.) editor Fax : +1.801.942.3345 Oracle Corporation Oracle Email: jim dot melton at oracle dot com 1930 Viscounti Drive Standards email: jim dot melton at acm dot org Sandy, UT 84093-1063 USA Personal email: jim at melton dot name ======================================================================== = Facts are facts. But any opinions expressed are the opinions = = only of myself and may or may not reflect the opinions of anybody = = else with whom I may or may not have discussed the issues at hand. = ======================================================================== From lists at fgeorges.org Tue Jan 26 02:22:40 2010 From: lists at fgeorges.org (Florent Georges) Date: Mon Jan 25 18:08:50 2010 Subject: [xquery-talk] preceding:: and following:: over a collection In-Reply-To: <961274971001251614q762b99d5jf3481c09a7063038@mail.gmail.com> References: <961274971001251212g5b68cde9n60ada24d3f9153d@mail.gmail.com> <452FE65AB7FD48F6994228EE4FD7CCC6@Sealion> <961274971001251614q762b99d5jf3481c09a7063038@mail.gmail.com> Message-ID: <224693.33281.qm@web23007.mail.ird.yahoo.com> James Cummings wrote: Hi, > In this case I have 48 years worth of transcribed historical > diary, with each day/month/year being one of the objects I want > to find the previous/next node for. The query gets a parameter > in YYYY-MM-DD, YYYY-MM or YYYY format and returns the > appropriate year, month or day from the correct file because > this parameter value makes up part of the @xml:id. In each > instance I want to provide prevYear/nextYear, > prevMonth/nextMonth, prevDay/nextDay navigational links > regardless of the fact that I'm sitting on 1798-01-01 and the > 1797-12-31 (if it exists) is in the previous file. I didn't look in the details, but my first reaction to such a problem would be to separate the navigation within the data on the one hand and the formatting of them on the other hand. So in this case, I would first write a set of functions that extract the correct data from the correct documents and walk through them in the correct order. At the place where each subset of data has to be transformed during this navigation, you call then a second set of functions, which handle the formatting of a single one at a time. Hope that helps, regards, -- Florent Georges http://www.fgeorges.org/ From adam.retter at googlemail.com Tue Jan 26 09:30:00 2010 From: adam.retter at googlemail.com (Adam Retter) Date: Tue Jan 26 01:06:29 2010 Subject: [xquery-talk] Looking to meet XQuery enthusiasts in your area? In-Reply-To: <43b5c44e1001250531k164013dcrc0f565e4758bc544@mail.gmail.com> References: <43b5c44e1001250531k164013dcrc0f565e4758bc544@mail.gmail.com> Message-ID: I added a Map to the Wiki, the aim is that people can add themselves to it so when organising a meetup you can easily see who is nearby and my be interested. Perhaps people would like to add themselves to it? http://xquery.pbworks.com/XQuery-Developers-Map 2010/1/25 William Candillon : > Hi, > > A couple of weeks ago we started a wiki at http://xquery.pbworks.com > in order to help XQuery enthusiasts from the same area to gather > around a snack and a beer. > Our aim is to promote knowledge sharing and best practice amongst > XQuery developers and business professionals around the world by > organizing local meetups. > > Are you interested in organizing a meetup in your area? > The wiki contains some guidelines and tips of organizing such event. > Keep it small and informal, it's actually not much work and a lot of fun :-) > > Best regards, > > William > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Adam Retter skype :adam.retter http://www.adamretter.org.uk From elharo at ibiblio.org Wed Jan 27 05:31:33 2010 From: elharo at ibiblio.org (Elliotte Rusty Harold) Date: Wed Jan 27 01:57:29 2010 Subject: [xquery-talk] Markdown Message-ID: <654a2bb31001270231y37b70476id68c80c2e37fc69d@mail.gmail.com> Does anyone have an XQuery implementation of Markdown or equivalent handy? I need something that will turn basic text into XHTML. -- Elliotte Rusty Harold elharo@ibiblio.org From jolene.meyer at endries.com Thu Jan 28 09:43:13 2010 From: jolene.meyer at endries.com (Jolene Meyer) Date: Thu Jan 28 07:35:12 2010 Subject: [xquery-talk] help Message-ID: I have a flat file that I am running thru Stylus Studio. Stylus Studio takes the flat file and converts it to XML and then runs it thru an xQuery. Every time I need to process this I need to open stylus studio and press the run button. Is there a script I can run to run the xQuery so I can automate this process? Thanks Jolene Meyer Computer Programmer/Analyst Endries Intl Inc, A Ferguson Subsidiary 714 W Ryan St PO Box 69 Brillion WI 54110-0069 USA T: (920) 756-6168 F: (920) 756-6708 E: jolene.meyer@endries.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100128/3b5f27fa/attachment.htm From adam.retter at googlemail.com Thu Jan 28 15:52:56 2010 From: adam.retter at googlemail.com (Adam Retter) Date: Thu Jan 28 07:45:24 2010 Subject: [xquery-talk] help In-Reply-To: References: Message-ID: Take a look at Saxon, you could script that from either a .bat or .sh On 28 January 2010 15:43, Jolene Meyer wrote: > I have a flat file that I am running thru Stylus Studio. Stylus Studio takes > the flat file and converts it to XML and then runs it thru an xQuery. > > > > Every time I need to process this I need to open stylus studio and press the > run button.? Is there a script I can run to run the xQuery so I can automate > this process? > > > > Thanks > > > > Jolene Meyer > > Computer Programmer/Analyst > > Endries Intl Inc, A Ferguson Subsidiary 714 W Ryan St PO Box 69 Brillion WI > 54110-0069 USA > > T: (920) 756-6168 F: (920) 756-6708 > > E: jolene.meyer@endries.com > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Adam Retter skype :adam.retter http://www.adamretter.org.uk From dlee at calldei.com Thu Jan 28 14:21:07 2010 From: dlee at calldei.com (DLEE) Date: Thu Jan 28 12:09:19 2010 Subject: [xquery-talk] help In-Reply-To: References: Message-ID: <1945C596-99A9-40D5-8544-34237842718B@calldei.com> Xmlsh comes with Saxon powered xquery and xslt scripting including flatfile conversions (csv2xml) See www.xmlsh.org -David lee On Jan 28, 2010, at 9:52 AM, Adam Retter wrote: > Take a look at Saxon, you could script that from either a .bat or .sh > > On 28 January 2010 15:43, Jolene Meyer > wrote: >> I have a flat file that I am running thru Stylus Studio. Stylus >> Studio takes >> the flat file and converts it to XML and then runs it thru an xQuery. >> >> >> >> Every time I need to process this I need to open stylus studio and >> press the >> run button. Is there a script I can run to run the xQuery so I can >> automate >> this process? >> >> >> >> Thanks >> >> >> >> Jolene Meyer >> >> Computer Programmer/Analyst >> >> Endries Intl Inc, A Ferguson Subsidiary 714 W Ryan St PO Box 69 >> Brillion WI >> 54110-0069 USA >> >> T: (920) 756-6168 F: (920) 756-6708 >> >> E: jolene.meyer@endries.com >> >> >> >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk >> > > > > -- > Adam Retter > > skype :adam.retter > http://www.adamretter.org.uk > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From hrennau at yahoo.de Fri Jan 29 10:03:05 2010 From: hrennau at yahoo.de (Hans-Juergen Rennau) Date: Fri Jan 29 01:35:19 2010 Subject: [xquery-talk] XQuery frameworks Message-ID: <964945.78705.qm@web27107.mail.ukl.yahoo.com> Dear People, presently I am scribbling away at a little XQuery?framework into which one may plug user-supplied queries, which pulls them into a particular larger processing model, using them as combinable building blocks. Suddenly my pen hovers in mid-air, I raise my head and, listening to the snowflakes rustling in the hedge, I wonder: probably some XQuery?frameworks already exist, and we XQuery developers might really profit from being aware of them, so that, pushing the argument to its?extreme, everytime we write a query we might immediately consider plugging it into this or that framework, to enhance its usefulness. So my *question*: would anybody like to point to some XQuery?framework into which one may plug queries in order to harvest added value,?perhaps hinting at the kind of advantage one obtains? With kind regards, Hans-Juergen Rennau PS: Before closing, one word about XProc. I would not regard the language itself?as such a framework, rather as a toolkit for creating such frameworks, implementing them perhaps as a set of?XProc documents. __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verf?gt ?ber einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com From james.fuller.2007 at gmail.com Fri Jan 29 13:04:57 2010 From: james.fuller.2007 at gmail.com (James Fuller) Date: Fri Jan 29 03:35:56 2010 Subject: [xquery-talk] XQuery frameworks In-Reply-To: <964945.78705.qm@web27107.mail.ukl.yahoo.com> References: <964945.78705.qm@web27107.mail.ukl.yahoo.com> Message-ID: u prob know about these libraries http://www.expath.org http://www.exquery.org http://www.xqueryfunctions.com/xq/ and then there is http://code.google.com/p/xqmvc/ I am also creating a generic XQuery version (for use in eXist) that kind of emulates xqmvc ... will release at some point soon. James Fuller On Fri, Jan 29, 2010 at 11:03 AM, Hans-Juergen Rennau wrote: > Dear People, > > presently I am scribbling away at a little XQuery?framework into which one may plug user-supplied queries, which pulls them into a particular larger processing model, using them as combinable building blocks. Suddenly my pen hovers in mid-air, I raise my head and, listening to the snowflakes rustling in the hedge, I wonder: probably some XQuery?frameworks already exist, and we XQuery developers might really profit from being aware of them, so that, pushing the argument to its?extreme, everytime we write a query we might immediately consider plugging it into this or that framework, to enhance its usefulness. > > So my *question*: would anybody like to point to some XQuery?framework into which one may plug queries in order to harvest added value,?perhaps hinting at the kind of advantage one obtains? > > With kind regards, > Hans-Juergen Rennau > > > PS: Before closing, one word about XProc. I would not regard the language itself?as such a framework, rather as a toolkit for creating such frameworks, implementing them perhaps as a set of?XProc documents. > > __________________________________________________ > Do You Yahoo!? > Sie sind Spam leid? Yahoo! Mail verf?gt ?ber einen herausragenden Schutz gegen Massenmails. > http://mail.yahoo.com > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From xquery-talk at xquery.co.uk Fri Jan 29 15:41:46 2010 From: xquery-talk at xquery.co.uk (Dennis Knochenwefel) Date: Fri Jan 29 06:41:01 2010 Subject: [xquery-talk] XQuery frameworks In-Reply-To: <964945.78705.qm@web27107.mail.ukl.yahoo.com> References: <964945.78705.qm@web27107.mail.ukl.yahoo.com> Message-ID: <4B62F3AA.3030002@xquery.co.uk> An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20100129/71a4851c/attachment.htm From lists at fgeorges.org Fri Jan 29 16:01:47 2010 From: lists at fgeorges.org (Florent Georges) Date: Fri Jan 29 07:55:07 2010 Subject: [xquery-talk] XQuery frameworks In-Reply-To: <964945.78705.qm@web27107.mail.ukl.yahoo.com> References: <964945.78705.qm@web27107.mail.ukl.yahoo.com> Message-ID: <698487.41527.qm@web23003.mail.ird.yahoo.com> Hans-Juergen Rennau wrote: Hi, > So my *question*: would anybody like to point to some XQuery > framework into which one may plug queries in order to harvest > added value, perhaps hinting at the kind of advantage one > obtains? Just to add to responses sent by Jim and Dennis, I'd like to say it depends what you mean by "framework". The definition of this term is quite vague, and even when you have one definition, it depends on what aspects to solve you are looking for after frameworks. If you are looking for a way to evaluate queries on a server in response to an HTTP request (well known as XQuery webapps), then Sausalito is worth investigating. Almost all XML databases like MarkLogic and eXist do also provide some way to plug queries into their HTTP server. The drawback with this approach is that those solutions are all dependent on the processor and/or the chosen framework. As part of EXPath, I'm trying to define a first version of a servlet-like specification, that will be implementation-independent. Its success will depend on which extent implementors will adopt it. But I do not think this is really a framework. This is more a low-level technical piece to help developing larger frameworks in a processor-independent way. Sausalito for instance would be a good example: if it was based on such a spec for its mapping between HTTP and XQuery, it would be (for that part at least) independent on the underlying processor. Any way, if you are interested by those matters, do not miss the XML Prague 2010 conferences :-) Regards, -- Florent Georges http://www.fgeorges.org/ From milu71 at gmx.de Fri Jan 29 22:44:37 2010 From: milu71 at gmx.de (Michael Ludwig) Date: Fri Jan 29 13:30:30 2010 Subject: [xquery-talk] XQuery frameworks In-Reply-To: <964945.78705.qm@web27107.mail.ukl.yahoo.com> References: <964945.78705.qm@web27107.mail.ukl.yahoo.com> Message-ID: <20100129214436.GD2324@wladimir> Hans-Juergen Rennau schrieb am 29.01.2010 um 10:03:05 (+0000): > So my *question*: would anybody like to point to some > XQuery framework into which one may plug queries in order > to harvest added value,?perhaps hinting at the kind of > advantage one obtains? As George said, the term "framework" is a bit vague. This might be of interest, although I'm not sure it is much used or maintained: Xaj: Simple XQuery API for Java http://xaj.sourceforge.net/ -- Michael Ludwig From mike at saxonica.com Fri Jan 29 22:00:27 2010 From: mike at saxonica.com (Michael Kay) Date: Fri Jan 29 13:46:01 2010 Subject: [xquery-talk] preceding:: and following:: over a collection In-Reply-To: <961274971001251614q762b99d5jf3481c09a7063038@mail.gmail.com> References: <961274971001251212g5b68cde9n60ada24d3f9153d@mail.gmail.com> <452FE65AB7FD48F6994228EE4FD7CCC6@Sealion> <961274971001251614q762b99d5jf3481c09a7063038@mail.gmail.com> Message-ID: > > One straightforward solution is of course to generate a > skeleton of the entire collection: > > > > .... > > ... > > > > ... > > > > You might be able to do it by simply defining a sequence containing (references to) the relevant nodes, rather than a newly constructed tree. But I don't think there's a simple solution you're missing. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From hrennau at yahoo.de Fri Jan 29 22:04:46 2010 From: hrennau at yahoo.de (Hans-Juergen Rennau) Date: Fri Jan 29 13:50:16 2010 Subject: [xquery-talk] XQuery frameworks Message-ID: <282017.54590.qm@web27105.mail.ukl.yahoo.com> Florent, James, Dennis, cordial thanks for your facts and comments! Trying to?evaluate them. let me first?indeed define?the term "framework" for the purpose?of this discussion. Taking as a starting point an isolated XQuery module, a *framework* is a machinery enabling a more complex processing than provided by the XQuery module itself, thus?controlling and in some way embedding the query execution within?a larger processing model. So if we assume a query defines a processing P, the framework would provide for a composite processing, say, X-P-Y. A typical example is a web application, where the query execution is preceded by request evaluation and followed by response dispatchal.. Adopting this definition, I think that the following links relate to libraries, but not to frameworks: http://www.expath.org http://www.exquery.org http://www.xqueryfunctions.com/xq/ And the servlet-like specification Florent spoke of would appear as a standard whose implementation would result in a framework. The remaining links: http://sausalito.28msec.com http://code.google.com/p/xqmvc/ definitely refer to frameworks, and both are dedicated to creating web applications, in one case "in general", in the other obeying the MVC pattern. Finally, as Florent?pointed out, XML database implementations?usually contain such a framework, too. This is an?interesting first result: frameworks for creating web applications exist, and they are impressive,?indeed! Frameworks for other purposes have not yet been mentioned. Thank you again, with kind regards, Hans-Juergen __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verf?gt ?ber einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com From liam at w3.org Sun Jan 31 20:14:47 2010 From: liam at w3.org (Liam R E Quin) Date: Sun Jan 31 16:56:15 2010 Subject: [xquery-talk] XQuery frameworks In-Reply-To: <964945.78705.qm@web27107.mail.ukl.yahoo.com> References: <964945.78705.qm@web27107.mail.ukl.yahoo.com> Message-ID: <1264986887.7875.79.camel@desktop.barefootcomputing.com> On Fri, 2010-01-29 at 10:03 +0000, Hans-Juergen Rennau wrote: > Dear People, > > presently I am scribbling away at a little XQuery framework A few years ago when I did http://www.fromoldbooks.org/Search/ using XQuery, I wrote my own. It's far from perfect -- it is a perl script that checks the system load average (!), and the query parameters, and then reads an xml config file, and calls up an external xquery engine based on a variable -- so I could easily switch between galax, qizx and saxon, initially, and later dbxml too. It keeps a cache, to avoid firing up a JVM (two of those implementations are in Java) with each incoming HTTP request, and does get fairly high cache hit rates. It'd be a reasonable question, "why not use servlets", and a lot of the answer to that is that, when I wrote it, Sun's licence for Java was such that Linux distributions couldn't easily include it, and Java was a sufficient pain to set up that I avoided any architecture that depended on it. But then I started using Saxon, and, later qizx, both of which do use Java. More recently I've used dbxml, but not on the production system, as the packaging for dbxml is even weirder than for Java, and my server has changed operating systems several times over the years. All this is a long winded way of saying, a lot of it depends on the environment. I'm particularly interested (since I work at W3C...) in what we could do to extend standardisation "beyond the query" into more of a framework, and how, and what would be the value of that, but I think the XQuery Working Group right now does not have the resources to do that sort of work. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org www.advogato.org