From viklund_anders at hotmail.com Thu Aug 7 20:55:33 2008 From: viklund_anders at hotmail.com (Anders Viklund) Date: Thu Aug 7 12:53:22 2008 Subject: [xquery-talk] Using XQuery to prerender html Message-ID: Hi, I am totally new to XQuery and I would like to know if it is suitable to use XQuery to transform html files into jQuery Treeview format. Basically, what I would like to to is transform this:
  • Root
  • .. into this: This the structure of this jQuery Treeview: Root Order id = 1234 type = order.cancel Parameter id = 5678 Item id = 910 type = access Any ideas how to do this are highly appreciated! _________________________________________________________________ Connect to the next generation of MSN Messenger? http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20080807/5de7de7a/attachment.htm From ignaciot at gmail.com Tue Aug 12 17:45:43 2008 From: ignaciot at gmail.com (Ignacio Tripodi) Date: Tue Aug 12 14:44:12 2008 Subject: [xquery-talk] Problem with "let" statements in an xquery function Message-ID: Hi, I'm puzzled about this function I'm working on: declare updating function do_stuff ( $a as element(), $b as xs:string ) { let $c := $a//some_element[.=$b]/..[another_elem='foo'] let $d := $a//anoher/element return if( exists($c) ) then replace value of node $c/xxx with $d else () }; The problem is, those "let" statements aren't working... if I check the value of $c or $d they're null. And the xpath expression I'm using is valid. Based on the W3 specs I understand those "let" declarations are valid: http://www.w3.org/TR/2008/CR-xquery-update-10-20080801/#doc-xquery-FunctionDecl What am I missing? Should I assign those variables in some other way? I tried using "declare variable" instead but that didn't work either. Thanks for any comments, I think I could use an extra pair of eyes. :-) -i -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20080812/74832af0/attachment.htm From andrew.j.welch at gmail.com Wed Aug 13 12:20:47 2008 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Wed Aug 13 03:18:11 2008 Subject: [xquery-talk] Problem with "let" statements in an xquery function In-Reply-To: References: Message-ID: <74a894af0808130320o2d8903e6s9fe92b43fe7ffb4e@mail.gmail.com> 2008/8/12 Ignacio Tripodi : > Hi, > > I'm puzzled about this function I'm working on: > > declare updating function > do_stuff > ( > $a as element(), > $b as xs:string > ) > { > let $c := $a//some_element[.=$b]/..[another_elem='foo'] > let $d := $a//anoher/element > > return > if( exists($c) ) > then > replace value of node $c/xxx with $d > else > () > }; > > The problem is, those "let" statements aren't working... if I check the > value of $c or $d they're null. And the xpath expression I'm using is valid. > Based on the W3 specs I understand those "let" declarations are valid: > > http://www.w3.org/TR/2008/CR-xquery-update-10-20080801/#doc-xquery-FunctionDecl > > What am I missing? Should I assign those variables in some other way? I > tried using "declare variable" instead but that didn't work either. $a//some_element[.=$b]/..[another_elem='foo'] That line is almost certainly the problem... what are you trying to do there? -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From lists at fgeorges.org Wed Aug 13 19:26:10 2008 From: lists at fgeorges.org (Florent Georges) Date: Wed Aug 13 09:54:43 2008 Subject: [xquery-talk] Problem with "let" statements in an xquery function In-Reply-To: <74a894af0808130320o2d8903e6s9fe92b43fe7ffb4e@mail.gmail.com> Message-ID: <167320.80241.qm@web23001.mail.ird.yahoo.com> Andrew Welch wrote: > $a//some_element[.=$b]/..[another_elem='foo'] > That line is almost certainly the problem... what are you trying to > do there? I don't know if it is the problem, but at least this is not how I would write what it says. I would rather use the equivalent (except for one corner case): $a//*[some_element = $b][another_elem = 'foo'] But without input sample, we don't know if those are correct or not. Regards, --drkm _____________________________________________________________________________ Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr From wcandillon at gmail.com Thu Aug 21 12:05:19 2008 From: wcandillon at gmail.com (William Candillon) Date: Thu Aug 21 02:06:14 2008 Subject: [xquery-talk] Running XQuery with PHP Message-ID: <43b5c44e0808210205mb49b29ckf79e45049ab51f68@mail.gmail.com> Hi, PECL, the official repository for PHP extensions contains now a language binding for Zorba XQuery engine: http://www.pecl.php.net/package/Zorba. PHP always had a great support for XML and we're happy that it supports now XQuery. You can find more information about this release in the following blog entry: http://www.zorba-xquery.com/index.php/24/. Best regards, William -- William Candillon http://apdt.googlecode.com From georg.piewald at siemens.com Fri Aug 22 10:22:30 2008 From: georg.piewald at siemens.com (Piewald, Georg) Date: Fri Aug 22 00:21:22 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions Message-ID: Hi, I'm very new to Xquery and don't know much more than what I've read in a tutorial. Now I have trouble with a query where I need an if-statement inside a FLWOR-expression. The following minimal example shows the problem: for $item in (1 to 5) if ($item < 3) then let $var := 'abc' else let $var := 'def' return

    Text {$var}

    The 'if' doesn't seem to be permitted after the for, I get an error message "Parse error: element name containing whitespace: unexpected token: if" What can I do to solve this? Thanks, Georg From jens.teubner at inf.ethz.ch Fri Aug 22 10:41:31 2008 From: jens.teubner at inf.ethz.ch (Jens Teubner) Date: Fri Aug 22 00:40:19 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: References: Message-ID: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> On Fri, Aug 22, 2008 at 09:22:30AM +0200, Piewald, Georg wrote: > if ($item < 3) then > let $var := 'abc' > else > let $var := 'def' > return >

    Text {$var}

    XQuery is a functional, expression-oriented language. What you want to write is let $var := if ($item < 3) then 'abc' else 'def' return

    Text {$var}

    Observe how the `if ...' does not imply a certain control flow. Rather, the entire clause is an expression that evaluates to either 'abc' or 'def'. Jens -- Jens Teubner ETH Zurich, Systems Group Haldeneggsteig 4 / IFW B 47.1 8092 Zurich, Switzerland Time is money. Especially if you make clocks. From bharath.ilugc at gmail.com Fri Aug 22 15:11:29 2008 From: bharath.ilugc at gmail.com (bharath maharajan) Date: Fri Aug 22 01:40:15 2008 Subject: [xquery-talk] XQuery in mark logic Message-ID: Hi All, I am facing some issue in XQuery with Marklogic database. In the below example, HF 45 Core 67 When i try, data(doc("book.xml")/books/book/information)) the output in StylusStudio is HF 45 Core 67868 which is something i expected. But when i try the same in Marklogic database I get it in HF45Core67868 how can i modify my query to get the output like HF 45 Core 67868 Thanks in advance, Bharath -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20080822/39ca2c88/attachment.htm From andrew.j.welch at gmail.com Fri Aug 22 11:05:11 2008 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Fri Aug 22 02:03:57 2008 Subject: [xquery-talk] XQuery in mark logic In-Reply-To: References: Message-ID: <74a894af0808220205l46a22381u974421ad0e0fe3a5@mail.gmail.com> 2008/8/22 bharath maharajan : > Hi All, > I am facing some issue in XQuery with Marklogic database. > > In the below example, > > > > > HF > 45 > > > > > Core > 67 > > > > > When i try, > data(doc("book.xml")/books/book/information)) > > the output in StylusStudio is > HF 45 Core 67868 > > which is something i expected. But when i try the same in Marklogic database > I get it in > > HF45Core67868 > > how can i modify my query to get the output like > > HF 45 Core 67868 To combine items in a sequence with a separator you can use string-join() eg string-join($seq, ' ') However, you can't be telling us the full story because neither of your output's could be made from that input with that query... It's probably just a case of whitespace stripping, but it's hard to say anything more than that. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From georg.piewald at siemens.com Fri Aug 22 12:14:53 2008 From: georg.piewald at siemens.com (Piewald, Georg) Date: Fri Aug 22 02:13:42 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> Message-ID: (Sorry Jens, by mistake I replied to you personally instead of the list - I'm forced to use MS Outlook here, which I'm not used to...) Jens Teubner wrote: > > On Fri, Aug 22, 2008 at 09:22:30AM +0200, Piewald, Georg wrote: > > > if ($item < 3) then > > let $var := 'abc' > > else > > let $var := 'def' > > return > >

    Text {$var}

    > > XQuery is a functional, expression-oriented language. What you want to > write is > > let $var := if ($item < 3) then 'abc' else 'def' > return

    Text {$var}

    > > Observe how the `if ...' does not imply a certain control > flow. Rather, > the entire clause is an expression that evaluates to either 'abc' or > 'def'. Thank you, that clearifies a lot. But now I want to go a step further. In my original problem I don't have only one variable $var to set in each of the if-branches, but several ones. So my original (and of course wrong) approach was if ($item < 3) then let $var1 := 'abc' let $var2 := ... ... else let $var1 := 'def' let $var2 := ... ... return

    Text {$var1} text {$var2}

    I don't see how to map this to the correct syntax in a straightforward way. Thanks again, Georg From andrew.j.welch at gmail.com Fri Aug 22 11:47:18 2008 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Fri Aug 22 02:46:04 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> Message-ID: <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> It's because annoyingly the list is setup to be reply-to-sender instead of reply-to-list.... (it's not Outlook's fault) So many replies must be lost and not archived because of this - hopefully the list admin will change it. 2008/8/22 Piewald, Georg : > (Sorry Jens, by mistake I replied to you personally instead of the list > - I'm forced to use MS Outlook here, which I'm not used to...) > -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From jhunter at servlets.com Fri Aug 22 04:48:17 2008 From: jhunter at servlets.com (Jason Hunter) Date: Fri Aug 22 03:47:04 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> Message-ID: <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> On Aug 22, 2008, at 2:47 AM, Andrew Welch wrote: > It's because annoyingly the list is setup to be reply-to-sender > instead of reply-to-list.... (it's not Outlook's fault) > > So many replies must be lost and not archived because of this - > hopefully the list admin will change it. Nope, it's intentional. Without the reply-to header you get some emails accidentally mailed privately and when it happens people post them publicly. No big harm, easy to fix. With the header you get some emails that were meant for private consumption that get accidentally mailed publicly. Can cause harm, impossible to rectify. -jh- From andrew.j.welch at gmail.com Fri Aug 22 13:02:35 2008 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Fri Aug 22 04:01:20 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> Message-ID: <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> 2008/8/22 Jason Hunter : > On Aug 22, 2008, at 2:47 AM, Andrew Welch wrote: > >> It's because annoyingly the list is setup to be reply-to-sender >> instead of reply-to-list.... (it's not Outlook's fault) >> >> So many replies must be lost and not archived because of this - >> hopefully the list admin will change it. > > Nope, it's intentional. Without the reply-to header you get some emails > accidentally mailed privately and when it happens people post them publicly. > No big harm, easy to fix. With the header you get some emails that were > meant for private consumption that get accidentally mailed publicly. Can > cause harm, impossible to rectify. hmmm so the reason everyone has go to through the hassle of first realising they've not replied to the list and then sending it again (not to mention the loss to the archives), is all because some people might send something publicly that was meant to be private?? Surely not... Other lists (such as the xsl-list) are reply-to-list and that's doing just fine, no harm so far (in the 8 or so years I've been on there. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From wapiez at mulberrytech.com Fri Aug 22 16:02:42 2008 From: wapiez at mulberrytech.com (Wendell Piez) Date: Fri Aug 22 12:05:54 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> Message-ID: <20080822150527.GA94699@mail11c.verio-web.com> Georg, Just extend the logic: let $var1 := if ($item < 3) then 'abc' else 'def' let $var2 := if ($item < 3) then 'lmn' else 'opq' return

    Text {$var1} ... {$var2}

    or further: let $lowitem := ($item < 3) let $var1 := if ($lowitem) then 'abc' else 'def' let $var2 := if ($lowitem) then 'lmn' else 'opq' [ ... etc. ...] return

    Text {$var1} ... {$var2}

    Alternatively, use sequences, and index into them: let $var := if ($item < 3) then ('abc','lmn') else ('def','opq') return

    Text {$var[1]} ... {$var[2]}

    Cheers, Wendell At 05:14 AM 8/22/2008, you wrote: >Jens Teubner wrote: > > > > On Fri, Aug 22, 2008 at 09:22:30AM +0200, Piewald, Georg wrote: > > > > > if ($item < 3) then > > > let $var := 'abc' > > > else > > > let $var := 'def' > > > return > > >

    Text {$var}

    > > > > XQuery is a functional, expression-oriented language. What you want to > > write is > > > > let $var := if ($item < 3) then 'abc' else 'def' > > return

    Text {$var}

    > > > > Observe how the `if ...' does not imply a certain control > > flow. Rather, > > the entire clause is an expression that evaluates to either 'abc' or > > 'def'. > >Thank you, that clearifies a lot. But now I want to go a step further. >In my original problem I don't have only one variable $var to set in >each of the if-branches, but several ones. So my original (and of course >wrong) approach was > > if ($item < 3) then > let $var1 := 'abc' > let $var2 := ... > ... > else > let $var1 := 'def' > let $var2 := ... > ... > return >

    Text {$var1} text {$var2}

    > >I don't see how to map this to the correct syntax in a straightforward >way. ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== From wapiez at mulberrytech.com Fri Aug 22 15:50:53 2008 From: wapiez at mulberrytech.com (Wendell Piez) Date: Fri Aug 22 12:05:56 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.co m> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> Message-ID: <20080822150527.GA82137@mail11b.verio-web.com> Hey Andrew, At 07:02 AM 8/22/2008, Andrew Welch wrote: > > Nope, it's intentional. Without the reply-to header you get some emails > > accidentally mailed privately and when it happens people post > them publicly. > > No big harm, easy to fix. With the header you get some emails that were > > meant for private consumption that get accidentally mailed publicly. Can > > cause harm, impossible to rectify. > >hmmm so the reason everyone has go to through the hassle of first >realising they've not replied to the list and then sending it again >(not to mention the loss to the archives), is all because some people >might send something publicly that was meant to be private?? > >Surely not... > >Other lists (such as the xsl-list) are reply-to-list and that's doing >just fine, no harm so far (in the 8 or so years I've been on there. Heh. As it happens, xsl-list has from time to time seen messages not intended for the list. On more than one occasion (though not frequently), the list owner (who works down the hall from me) has even received frantic messages from embarrassed or irate users requesting that their publicly-posted messages be retracted. As if. (Admittedly, these are not always because they've mistakenly replied on-list when they thought they were off-list. Once, IIRC, it was because the person didn't want to be archived asking a question, on the theory that future prospective employers might discover it. Apparently, such are the perils of list ownership, which seems to be a job somewhere between a kindergarten teacher and a janitor.) So, I'm afraid there's no right answer, just strong feelings, and Jason has to be allowed to do it the way he wants. FWIW, personally I agree with you. People learn to work with reply-to-list, and then it's a considerable convenience. Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== From jhunter at servlets.com Fri Aug 22 15:43:43 2008 From: jhunter at servlets.com (Jason Hunter) Date: Fri Aug 22 14:44:02 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> Message-ID: > hmmm so the reason everyone has go to through the hassle of first > realising they've not replied to the list and then sending it again > (not to mention the loss to the archives), is all because some people > might send something publicly that was meant to be private?? Reply: to one person Reply-All: to many people > -jh- From rob at koberg.com Fri Aug 22 19:57:46 2008 From: rob at koberg.com (Robert Koberg) Date: Fri Aug 22 15:58:03 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> Message-ID: <1219445866.6746.5.camel@rkoberg-laptop> On Fri, 2008-08-22 at 14:43 -0700, Jason Hunter wrote: > > hmmm so the reason everyone has go to through the hassle of first > > realising they've not replied to the list and then sending it again > > (not to mention the loss to the archives), is all because some people > > might send something publicly that was meant to be private?? > > Reply: to one person > Reply-All: to many people A mailing list is singular. I am with Andrew... I am sure the folk who got your response once through the list and then addressed to them personally appreciate the duplicate. fwiw, -Rob From jhunter at servlets.com Fri Aug 22 17:43:32 2008 From: jhunter at servlets.com (Jason Hunter) Date: Fri Aug 22 16:43:49 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <1219445866.6746.5.camel@rkoberg-laptop> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> <1219445866.6746.5.camel@rkoberg-laptop> Message-ID: <28B447D5-D0E4-475D-9B78-957D3DBB48D9@servlets.com> > On Fri, 2008-08-22 at 14:43 -0700, Jason Hunter wrote: >>> hmmm so the reason everyone has go to through the hassle of first >>> realising they've not replied to the list and then sending it again >>> (not to mention the loss to the archives), is all because some >>> people >>> might send something publicly that was meant to be private?? >> >> Reply: to one person >> Reply-All: to many people > > A mailing list is singular. I am with Andrew... I am sure the folk who > got your response once through the list and then addressed to them > personally appreciate the duplicate. > > fwiw, > -Rob It's a religious issue. Minds never change. :) In case you're curious, the scripture to my religion is documented at http://www.unicom.com/pw/reply-to-harmful.html . Coincidentally it's the top Google hit for "reply-to". -jh- P.S. vim From rob at koberg.com Fri Aug 22 21:12:12 2008 From: rob at koberg.com (Robert Koberg) Date: Fri Aug 22 17:12:28 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <28B447D5-D0E4-475D-9B78-957D3DBB48D9@servlets.com> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> <1219445866.6746.5.camel@rkoberg-laptop> <28B447D5-D0E4-475D-9B78-957D3DBB48D9@servlets.com> Message-ID: <1219450332.6746.11.camel@rkoberg-laptop> On Fri, 2008-08-22 at 16:43 -0700, Jason Hunter wrote: > > On Fri, 2008-08-22 at 14:43 -0700, Jason Hunter wrote: > >>> hmmm so the reason everyone has go to through the hassle of first > >>> realising they've not replied to the list and then sending it again > >>> (not to mention the loss to the archives), is all because some > >>> people > >>> might send something publicly that was meant to be private?? > >> > >> Reply: to one person > >> Reply-All: to many people > > > > A mailing list is singular. I am with Andrew... I am sure the folk who > > got your response once through the list and then addressed to them > > personally appreciate the duplicate. > > > > fwiw, > > -Rob > > It's a religious issue. Minds never change. :) > > In case you're curious, the scripture to my religion is documented at http://www.unicom.com/pw/reply-to-harmful.html > . Coincidentally it's the top Google hit for "reply-to". Hang on, let me cut the Cc: to the list and paste it over the To: OK, done. I don't buy the argument, but you da man. A person did not send me the message, the list did. Anyway, I will check with the Flying Spaghetti Monster and get back to you. Ramen, -Rob From kennorth at sbcglobal.net Mon Aug 25 13:48:40 2008 From: kennorth at sbcglobal.net (Ken North) Date: Mon Aug 25 12:49:31 2008 Subject: [xquery-talk] Workshop at DataServices World (podcasts, video) Message-ID: <004001c906eb$96e08eb0$2301a8c0@DURANTE> The workshop at the DataServices World conference in New York included presentations that were heavy on XML and XQuery-related content. The presentations are available as slides, podcasts (MP3) and video (Flash, Windows Media Video, Quicktime and MP4). There will be 3GP (for cell phones) in a week or two. Part 1: Mike Gorman (Introduction and SQL database schema overview) http://www.dataservicesworld.com/People/MGorman.htm Part 2: Mike Pizzo (ADO.NET Entity Framework, ADO.NET Data Services) http://www.dataservicesworld.com/People/MPizzo.htm Part 3: Mike Carey (XML, XQuery for integrating data from heterogeneous sources) http://www.dataservicesworld.com/People/MCarey.htm Part 4: Minollo Innocenti (XML, XQuery for transforming and aggregating data from disparate sources) http://www.dataservicesworld.com/People/CInnocenti.htm Part 5 is the Q&A, which you can view by clicking a link from one of the video players for the above presentations. ======== Ken North =========== www.KNComputing.com www.DataServicesWorld.com www.CloudComputingSummit.com www.LinkedDataSummit.com www.WebServicesSummit.com www.SQLSummit.com www.GridSummit.com ======== Ken North =========== www.KNComputing.com www.DataServicesWorld.com www.CloudComputingSummit.com www.LinkedDataSummit.com www.WebServicesSummit.com www.SQLSummit.com www.GridSummit.com From andrew.j.welch at gmail.com Tue Aug 26 11:14:00 2008 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue Aug 26 02:13:12 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <20080822150527.GA82137@mail11b.verio-web.com> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> <20080822150527.GA82137@mail11b.verio-web.com> Message-ID: <74a894af0808260214h476a9d79l6381361122a1cc91@mail.gmail.com> (I've hit reply-to-all, after initial hitting reply and then spotting my mistake ;) > (Admittedly, these are not always because they've mistakenly replied on-list > when they thought they were off-list. Once, IIRC, it was because the person > didn't want to be archived asking a question, on the theory that future > prospective employers might discover it. ha... I've been reading some threads before and thought "who wrote this nonsense" and then realised it was me... > So, I'm afraid there's no right answer, just strong feelings, and Jason has > to be allowed to do it the way he wants. Ah ok, I didn't realise Jason was the list owner. > FWIW, personally I agree with you. People learn to work with reply-to-list, > and then it's a considerable convenience. It's seems most people do. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From andrew.j.welch at gmail.com Tue Aug 26 11:20:22 2008 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue Aug 26 02:19:30 2008 Subject: [xquery-talk] if statement inside FLWOR-expressions In-Reply-To: <1219450332.6746.11.camel@rkoberg-laptop> References: <20080822074131.GA1720@ikdesk25.inf.ethz.ch> <74a894af0808220247v55b3d013v535d1967188635ab@mail.gmail.com> <7B6A643A-9616-44CF-A9B6-78F0E6BD857E@servlets.com> <74a894af0808220402m238ef2cep87add755958af771@mail.gmail.com> <1219445866.6746.5.camel@rkoberg-laptop> <28B447D5-D0E4-475D-9B78-957D3DBB48D9@servlets.com> <1219450332.6746.11.camel@rkoberg-laptop> Message-ID: <74a894af0808260220r132b252bh10d00ff1eed6d69c@mail.gmail.com> >> In case you're curious, the scripture to my religion is documented at http://www.unicom.com/pw/reply-to-harmful.html >> . Coincidentally it's the top Google hit for "reply-to". > > Hang on, let me cut the Cc: to the list and paste it over the To: The "Principle of Least Work" and "Principle of Least Suprise" are the opposite of the real world there... They're basing it on the "Principle of You Want to Reply to the Sender" so it's effort to reply to the list - but I don't want to reply to the sender, and it's annoying when people reply directly to me - do I then reply to the list or directly to them? If I reply to the list and quote their direct reply, should I get permission first? If I've got 3 direct replies all saying the same thing, should I reply to each, or ignore them? Anyway.... -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From cschlaefcke at wms-network.de Tue Aug 26 12:54:24 2008 From: cschlaefcke at wms-network.de (Christian Schlaefcke) Date: Tue Aug 26 02:53:35 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes Message-ID: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de> Hi, I am fighting with a xpath/xquery expression to select the whole xml document except of certain nodes that I want to remove. The general structure of the document should be preserved. With my approaches I either select too much or too less and my research @ google & co. did not bring me any further :-( The document structure is a bit tricky (arbitrarily nested categories) - imagine the following document: Important Information Less Important Information Unimportant Information Even More Unimportant Information What I want would be: Important Information I tried several approaches like: /site/sites//categories/category[@name = 'category_1'] or /site/sites//categories/category[@name != 'hidden'] or /site/sites//categories/category/some/further/nested/info[@info_id = '1'] But all I get is something like this: Important Information What is missing to preserve the parent xml data? Any hint that will point me to the right direction would be very appreciated! Thank & Regards, Christian From cschlaefcke at wms-network.de Tue Aug 26 13:05:49 2008 From: cschlaefcke at wms-network.de (Christian Schlaefcke) Date: Tue Aug 26 03:05:00 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes Message-ID: <57893.80.85.196.22.1219745149.squirrel@www.wms-network.de> Hi, I am fighting with a xpath/xquery expression to select the whole xml document except of certain nodes that I want to remove. The general structure of the document should be preserved. With my approaches I either select too much or too less and my research @ google & co. did not bring me any further :-( The document structure is a bit tricky (arbitrarily nested categories) - imagine the following document: Important Information Less Important Information Unimportant Information Even More Unimportant Information What I want would be: Important Information I tried several approaches like: /site/sites//categories/category[@name = 'category_1'] or /site/sites//categories/category[@name != 'hidden'] or /site/sites//categories/category/some/further/nested/info[@info_id = '1'] But all I get is something like this: Important Information What is missing to preserve the parent xml data? Any hint that will point me to the right direction would be very appreciated! Thank & Regards, Christian Christian Schlaefcke ******************************************* * IT-Consulting, Java- u. J2EE-Spezialist * * * * Saseler M?hlenweg 4, 22395 Hamburg * * * * Mail: cschlaefcke@wms-network.de * * Phone: +49.40.41185913 * * Fax: +49.40.41185914 * * Mobil: +49.176.15125519 * ******************************************* From andrew.j.welch at gmail.com Tue Aug 26 12:56:19 2008 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue Aug 26 03:55:26 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes In-Reply-To: <57893.80.85.196.22.1219745149.squirrel@www.wms-network.de> References: <57893.80.85.196.22.1219745149.squirrel@www.wms-network.de> Message-ID: <74a894af0808260356l37b5452esccf91463af1a5eb5@mail.gmail.com> > I am fighting with a xpath/xquery expression to select the whole xml > document except of certain nodes that I want to remove. The general > structure of the document should be preserved. That's generally known as an "identity transform": http://en.wikipedia.org/wiki/Identity_transform For XQuery look at the lowest example. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From mike at saxonica.com Tue Aug 26 12:56:52 2008 From: mike at saxonica.com (Michael Kay) Date: Tue Aug 26 03:56:00 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes In-Reply-To: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de> References: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de> Message-ID: <53823B78813F4243817DD5AD2297993F@Sealion> This kind of operation is much easier in XSLT than in XQuery (unless you use XQuery updates). Any approach that simply tries to select nodes from the existing document is going to fail: the nodes in your output have different children from the nodes in the input, so they must be newly constructed nodes, they cannot be nodes in the original document, or even copies of the nodes in the original document. In XSLT the general pattern is: (a) write a template rule that copies each node unchanged, calling itself recursively to copy its children (b) override this with a more specific rule that applies to the nodes you don't want to copy, and which does nothing when such nodes are encountered. In XQuery you can simulate this with a recursive function that uses typeswitch() to test what kind of node has been supplied as an argument. But why fight the language? Use either XSLT, or XQuery Update. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Christian Schlaefcke > Sent: 26 August 2008 10:54 > To: talk@x-query.com > Subject: [xquery-talk] xpath/xquery to eleminate certain nodes > > Hi, > > I am fighting with a xpath/xquery expression to select the > whole xml document except of certain nodes that I want to > remove. The general structure of the document should be preserved. > > With my approaches I either select too much or too less and > my research @ google & co. did not bring me any further :-( > > The document structure is a bit tricky (arbitrarily nested > categories) - imagine the following document: > > > > > > > > > > Important Information > > > > > > > > > Less Important Information > > > > > > > > > > > > > Unimportant Information > > > > > > > > > Even More Unimportant > Information > > > > > > > > > > > What I want would be: > > > > > > > > > > Important Information > > > > > > > > > > > I tried several approaches like: > /site/sites//categories/category[@name = 'category_1'] or > /site/sites//categories/category[@name != 'hidden'] or > /site/sites//categories/category/some/further/nested/info[@inf > o_id = '1'] > > But all I get is something like this: > > > > > Important Information > > > > > > What is missing to preserve the parent xml data? > > Any hint that will point me to the right direction would be > very appreciated! > > Thank & Regards, > > Christian > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From john.snelson at oracle.com Tue Aug 26 13:00:50 2008 From: john.snelson at oracle.com (John Snelson) Date: Tue Aug 26 04:12:06 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes In-Reply-To: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de> References: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de> Message-ID: <48B3E262.5010706@oracle.com> Hi Christian, XQuery Update can be used to solve your problem fairly easily - something like this should do the trick: copy $a := / modify delete nodes $a/site/sites//categories/category[@name = 'hidden'] return $a John Christian Schlaefcke wrote: > Hi, > > I am fighting with a xpath/xquery expression to select the whole xml > document except of certain nodes that I want to remove. The general > structure of the document should be preserved. > > With my approaches I either select too much or too less and my research @ > google & co. did not bring me any further :-( > > The document structure is a bit tricky (arbitrarily nested categories) - > imagine the following document: > > > > > > > > > > Important Information > > > > > > > > > Less Important Information > > > > > > > > > > > > > Unimportant Information > > > > > > > > > Even More Unimportant Information > > > > > > > > > > > What I want would be: > > > > > > > > > > Important Information > > > > > > > > > > > I tried several approaches like: > /site/sites//categories/category[@name = 'category_1'] > or > /site/sites//categories/category[@name != 'hidden'] > or > /site/sites//categories/category/some/further/nested/info[@info_id = '1'] > > But all I get is something like this: > > > > > Important Information > > > > > > What is missing to preserve the parent xml data? > > Any hint that will point me to the right direction would be very appreciated! > > Thank & Regards, > > Christian > > > > _______________________________________________ > 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 cschlaefcke at wms-network.de Tue Aug 26 17:12:38 2008 From: cschlaefcke at wms-network.de (Christian Schlaefcke) Date: Tue Aug 26 07:14:20 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes In-Reply-To: <48B3E262.5010706@oracle.com> References: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de> <48B3E262.5010706@oracle.com> Message-ID: <35914.80.85.196.22.1219759958.squirrel@www.wms-network.de> Thank you John! looks promising! But after I tried to adapt it to my application I have some trouble with XmlBeans and Saxon that I use to run my queries. After I found out that xquery uptate was not available with the XmlBeans/Saxon versions I used (2.3.0/8.7) I upgraded to versions (2.4.0/9.1.0.1) and now I get this error: Error on line 3 column 9 XPST0003: XQuery syntax error in #...$this external; copy $#: Unexpected token "copy" in path expression My query looks like this: declare namespace mns='http://www.mynamespace.com'; copy $a := / modify delete node $a/mns:sites/mns:site//mns:categories/mns:category[@id = "888"] return $a Did someone encounter this problem before? Thanks & Regards, Christian > Hi Christian, > > XQuery Update can be used to solve your problem fairly easily - > something like this should do the trick: > > copy $a := / > modify delete nodes $a/site/sites//categories/category[@name = 'hidden'] > return $a > > John > > Christian Schlaefcke wrote: >> Hi, >> >> I am fighting with a xpath/xquery expression to select the whole xml >> document except of certain nodes that I want to remove. The general >> structure of the document should be preserved. >> >> With my approaches I either select too much or too less and my research >> @ >> google & co. did not bring me any further :-( >> >> The document structure is a bit tricky (arbitrarily nested categories) - >> imagine the following document: >> >> >> >> >> >> >> >> >> >> Important Information >> >> >> >> >> >> >> >> >> Less Important Information >> >> >> >> >> >> >> >> >> >> >> >> >> Unimportant Information >> >> >> >> >> >> >> >> >> Even More Unimportant >> Information >> >> >> >> >> >> >> >> >> >> >> What I want would be: >> >> >> >> >> >> >> >> >> >> Important Information >> >> >> >> >> >> >> >> >> >> >> I tried several approaches like: >> /site/sites//categories/category[@name = 'category_1'] >> or >> /site/sites//categories/category[@name != 'hidden'] >> or >> /site/sites//categories/category/some/further/nested/info[@info_id = >> '1'] >> >> But all I get is something like this: >> >> >> >> >> Important Information >> >> >> >> >> >> What is missing to preserve the parent xml data? >> >> Any hint that will point me to the right direction would be very >> appreciated! >> >> Thank & Regards, >> >> Christian >> >> >> >> _______________________________________________ >> 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 > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Tue Aug 26 16:56:17 2008 From: mike at saxonica.com (Michael Kay) Date: Tue Aug 26 07:57:17 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes In-Reply-To: <35914.80.85.196.22.1219759958.squirrel@www.wms-network.de> References: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de><48B3E262.5010706@oracle.com> <35914.80.85.196.22.1219759958.squirrel@www.wms-network.de> Message-ID: <3DF1F2FB389C421F9F61EA4D765B14E6@Sealion> To run XQuery Update in Saxon you need the Saxon-SA version of the product, and you need to run it with updating enabled. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Christian Schlaefcke > Sent: 26 August 2008 15:13 > To: talk@x-query.com > Subject: Re: [xquery-talk] xpath/xquery to eleminate certain nodes > > Thank you John! > > looks promising! But after I tried to adapt it to my > application I have some trouble with XmlBeans and Saxon that > I use to run my queries. > > After I found out that xquery uptate was not available with > the XmlBeans/Saxon versions I used (2.3.0/8.7) I upgraded to versions > (2.4.0/9.1.0.1) and now I get this error: > > Error on line 3 column 9 > XPST0003: XQuery syntax error in #...$this external; copy $#: > Unexpected token "copy" in path expression > > My query looks like this: > declare namespace mns='http://www.mynamespace.com'; > copy $a := / > modify delete node > $a/mns:sites/mns:site//mns:categories/mns:category[@id = "888"] > return $a > > Did someone encounter this problem before? > > Thanks & Regards, > > Christian > > > > Hi Christian, > > > > XQuery Update can be used to solve your problem fairly easily - > > something like this should do the trick: > > > > copy $a := / > > modify delete nodes $a/site/sites//categories/category[@name = > > 'hidden'] return $a > > > > John > > > > Christian Schlaefcke wrote: > >> Hi, > >> > >> I am fighting with a xpath/xquery expression to select the > whole xml > >> document except of certain nodes that I want to remove. > The general > >> structure of the document should be preserved. > >> > >> With my approaches I either select too much or too less and my > >> research @ google & co. did not bring me any further :-( > >> > >> The document structure is a bit tricky (arbitrarily nested > >> categories) - imagine the following document: > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> Important Information > >> > >> > >> > >> > >> > >> > >> > >> > >> Less Important > Information > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> Unimportant Information > >> > >> > >> > >> > >> > >> > >> > >> > >> Even More Unimportant > >> Information > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> What I want would be: > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> Important Information > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> I tried several approaches like: > >> /site/sites//categories/category[@name = 'category_1'] or > >> /site/sites//categories/category[@name != 'hidden'] or > >> > /site/sites//categories/category/some/further/nested/info[@info_id = > >> '1'] > >> > >> But all I get is something like this: > >> > >> > >> > >> > >> Important Information > >> > >> > >> > >> > >> > >> What is missing to preserve the parent xml data? > >> > >> Any hint that will point me to the right direction would be very > >> appreciated! > >> > >> Thank & Regards, > >> > >> Christian > >> > >> > >> > >> _______________________________________________ > >> 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 > > _______________________________________________ > > talk@x-query.com > > http://x-query.com/mailman/listinfo/talk > > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From cschlaefcke at wms-network.de Tue Aug 26 18:18:40 2008 From: cschlaefcke at wms-network.de (Christian Schlaefcke) Date: Tue Aug 26 08:33:23 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes In-Reply-To: <3DF1F2FB389C421F9F61EA4D765B14E6@Sealion> References: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de><48B3E262.5010706@oracle.com> <35914.80.85.196.22.1219759958.squirrel@www.wms-network.de> <3DF1F2FB389C421F9F61EA4D765B14E6@Sealion> Message-ID: <52007.80.85.196.22.1219763920.squirrel@www.wms-network.de> Hi Micheal, I just downloaded saxon9 (9.1.0.1) and put it in my local Maven2 repository and added it to my classpath with these dependencies: net.sf.saxon saxon9sa 9.1.0.1 net.sf.saxon saxon9sa-jaxp 9.1.0.1 net.sf.saxon saxon9sa-qc 9.1.0.1 net.sf.saxon saxon-dom 9.1.0.1 Having this I do not get the "no query engine" error, so I guess it XmlBeans can access Saxonias query engine. But I still get the "XPST0003" error. Maybe "updating" is not enabled by default - how can it be "enabled" then? Thanks & Regards, Christian > To run XQuery Update in Saxon you need the Saxon-SA version of the > product, > and you need to run it with updating enabled. > > Michael Kay > http://www.saxonica.com/ > >> -----Original Message----- >> From: talk-bounces@x-query.com >> [mailto:talk-bounces@x-query.com] On Behalf Of Christian Schlaefcke >> Sent: 26 August 2008 15:13 >> To: talk@x-query.com >> Subject: Re: [xquery-talk] xpath/xquery to eleminate certain nodes >> >> Thank you John! >> >> looks promising! But after I tried to adapt it to my >> application I have some trouble with XmlBeans and Saxon that >> I use to run my queries. >> >> After I found out that xquery uptate was not available with >> the XmlBeans/Saxon versions I used (2.3.0/8.7) I upgraded to versions >> (2.4.0/9.1.0.1) and now I get this error: >> >> Error on line 3 column 9 >> XPST0003: XQuery syntax error in #...$this external; copy $#: >> Unexpected token "copy" in path expression >> >> My query looks like this: >> declare namespace mns='http://www.mynamespace.com'; >> copy $a := / >> modify delete node >> $a/mns:sites/mns:site//mns:categories/mns:category[@id = "888"] >> return $a >> >> Did someone encounter this problem before? >> >> Thanks & Regards, >> >> Christian >> >> >> > Hi Christian, >> > >> > XQuery Update can be used to solve your problem fairly easily - >> > something like this should do the trick: >> > >> > copy $a := / >> > modify delete nodes $a/site/sites//categories/category[@name = >> > 'hidden'] return $a >> > >> > John >> > >> > Christian Schlaefcke wrote: >> >> Hi, >> >> >> >> I am fighting with a xpath/xquery expression to select the >> whole xml >> >> document except of certain nodes that I want to remove. >> The general >> >> structure of the document should be preserved. >> >> >> >> With my approaches I either select too much or too less and my >> >> research @ google & co. did not bring me any further :-( >> >> >> >> The document structure is a bit tricky (arbitrarily nested >> >> categories) - imagine the following document: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Important Information >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Less Important >> Information >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Unimportant Information >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Even More Unimportant >> >> Information >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> What I want would be: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Important Information >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> I tried several approaches like: >> >> /site/sites//categories/category[@name = 'category_1'] or >> >> /site/sites//categories/category[@name != 'hidden'] or >> >> >> /site/sites//categories/category/some/further/nested/info[@info_id = >> >> '1'] >> >> >> >> But all I get is something like this: >> >> >> >> >> >> >> >> >> >> Important Information >> >> >> >> >> >> >> >> >> >> >> >> What is missing to preserve the parent xml data? >> >> >> >> Any hint that will point me to the right direction would be very >> >> appreciated! >> >> >> >> Thank & Regards, >> >> >> >> Christian >> >> >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > _______________________________________________ >> > talk@x-query.com >> > http://x-query.com/mailman/listinfo/talk >> >> >> >> >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk > From mike at saxonica.com Tue Aug 26 18:14:24 2008 From: mike at saxonica.com (Michael Kay) Date: Tue Aug 26 09:15:21 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes In-Reply-To: <52007.80.85.196.22.1219763920.squirrel@www.wms-network.de> References: <46377.80.85.196.22.1219744464.squirrel@www.wms-network.de><48B3E262.5010706@oracle.com><35914.80.85.196.22.1219759958.squirrel@www.wms-network.de><3DF1F2FB389C421F9F61EA4D765B14E6@Sealion> <52007.80.85.196.22.1219763920.squirrel@www.wms-network.de> Message-ID: <3638B3B4188E45008B02B7D9A5611744@Sealion> Saxon-SA needs to be downloaded from www.saxonica.com and activated with a license key (free for 30 days). My log file doesn't show any recent request in your name for a license key. Having installed Saxon-SA and a license key, you need to invoke the query engine in updating mode. If you're doing that from the command line, set -update:on. If you're doing it using s9api, call setUpdatingEnabled(true) on the XQueryCompiler. I'm afraid I've no idea whether this can be done via XMLBeans. The documentation at http://xmlbeans.apache.org/documentation/conInstallGuide.html mentions some very old Saxon releases indeed. Michael Kay Saxonica > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Christian Schlaefcke > Sent: 26 August 2008 16:19 > To: talk@x-query.com > Subject: RE: [xquery-talk] xpath/xquery to eleminate certain nodes > > Hi Micheal, > > I just downloaded saxon9 (9.1.0.1) and put it in my local > Maven2 repository and added it to my classpath with these > dependencies: > > net.sf.saxon > saxon9sa > 9.1.0.1 > > > net.sf.saxon > saxon9sa-jaxp > 9.1.0.1 > > > net.sf.saxon > saxon9sa-qc > 9.1.0.1 > > > net.sf.saxon > saxon-dom > 9.1.0.1 > > > Having this I do not get the "no query engine" error, so I > guess it XmlBeans can access Saxonias query engine. > > But I still get the "XPST0003" error. Maybe "updating" is not > enabled by default - how can it be "enabled" then? > > Thanks & Regards, > > Christian > > > To run XQuery Update in Saxon you need the Saxon-SA version of the > > product, and you need to run it with updating enabled. > > > > Michael Kay > > http://www.saxonica.com/ > > > >> -----Original Message----- > >> From: talk-bounces@x-query.com > >> [mailto:talk-bounces@x-query.com] On Behalf Of Christian Schlaefcke > >> Sent: 26 August 2008 15:13 > >> To: talk@x-query.com > >> Subject: Re: [xquery-talk] xpath/xquery to eleminate certain nodes > >> > >> Thank you John! > >> > >> looks promising! But after I tried to adapt it to my application I > >> have some trouble with XmlBeans and Saxon that I use to run my > >> queries. > >> > >> After I found out that xquery uptate was not available with the > >> XmlBeans/Saxon versions I used (2.3.0/8.7) I upgraded to versions > >> (2.4.0/9.1.0.1) and now I get this error: > >> > >> Error on line 3 column 9 > >> XPST0003: XQuery syntax error in #...$this external; copy $#: > >> Unexpected token "copy" in path expression > >> > >> My query looks like this: > >> declare namespace mns='http://www.mynamespace.com'; > >> copy $a := / > >> modify delete node > >> $a/mns:sites/mns:site//mns:categories/mns:category[@id = "888"] > >> return $a > >> > >> Did someone encounter this problem before? > >> > >> Thanks & Regards, > >> > >> Christian > >> > >> > >> > Hi Christian, > >> > > >> > XQuery Update can be used to solve your problem fairly easily - > >> > something like this should do the trick: > >> > > >> > copy $a := / > >> > modify delete nodes $a/site/sites//categories/category[@name = > >> > 'hidden'] return $a > >> > > >> > John > >> > > >> > Christian Schlaefcke wrote: > >> >> Hi, > >> >> > >> >> I am fighting with a xpath/xquery expression to select the > >> whole xml > >> >> document except of certain nodes that I want to remove. > >> The general > >> >> structure of the document should be preserved. > >> >> > >> >> With my approaches I either select too much or too less and my > >> >> research @ google & co. did not bring me any further :-( > >> >> > >> >> The document structure is a bit tricky (arbitrarily nested > >> >> categories) - imagine the following document: > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> Important Information > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> Less Important > >> Information > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> Unimportant > Information > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> Even More Unimportant > >> >> Information > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> What I want would be: > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> Important Information > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> I tried several approaches like: > >> >> /site/sites//categories/category[@name = 'category_1'] or > >> >> /site/sites//categories/category[@name != 'hidden'] or > >> >> > >> > /site/sites//categories/category/some/further/nested/info[@info_id = > >> >> '1'] > >> >> > >> >> But all I get is something like this: > >> >> > >> >> > >> >> > >> >> > >> >> Important Information > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> What is missing to preserve the parent xml data? > >> >> > >> >> Any hint that will point me to the right direction > would be very > >> >> appreciated! > >> >> > >> >> Thank & Regards, > >> >> > >> >> Christian > >> >> > >> >> > >> >> > >> >> _______________________________________________ > >> >> 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 > >> > _______________________________________________ > >> > talk@x-query.com > >> > http://x-query.com/mailman/listinfo/talk > >> > >> > >> > >> > >> _______________________________________________ > >> talk@x-query.com > >> http://x-query.com/mailman/listinfo/talk > > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From cschlaefcke at wms-network.de Thu Aug 28 15:29:05 2008 From: cschlaefcke at wms-network.de (Christian Schlaefcke) Date: Thu Aug 28 05:29:45 2008 Subject: [xquery-talk] xpath/xquery to eleminate certain nodes In-Reply-To: <74a894af0808260356l37b5452esccf91463af1a5eb5@mail.gmail.com> References: <57893.80.85.196.22.1219745149.squirrel@www.wms-network.de> <74a894af0808260356l37b5452esccf91463af1a5eb5@mail.gmail.com> Message-ID: <40189.80.85.196.22.1219926545.squirrel@www.wms-network.de> Hi, okay I got it running with the approach mentioned by Andrew. Sorry Michael, no license to sell t?day ;-) Thank?s for the fast and pragmatic help! Regards, Christian >> I am fighting with a xpath/xquery expression to select the whole xml >> document except of certain nodes that I want to remove. The general >> structure of the document should be preserved. > > That's generally known as an "identity transform": > > http://en.wikipedia.org/wiki/Identity_transform > > For XQuery look at the lowest example. > > > > -- > Andrew Welch > http://andrewjwelch.com > Kernow: http://kernowforsaxon.sf.net/ From lists at fgeorges.org Sun Aug 31 00:46:12 2008 From: lists at fgeorges.org (Florent Georges) Date: Sat Aug 30 14:46:36 2008 Subject: [xquery-talk] XQuery in mark logic In-Reply-To: Message-ID: <698253.627.qm@web23005.mail.ird.yahoo.com> bharath maharajan wrote: Hi > > > > HF > 45 > > > > > Core > 67 > > > > data(doc("book.xml")/books/book/information)) I wonder what you want to achieve. Actually, I always thought that data() on an element that has child elements was an error. What would be the semantics of the above example? Regards, --drkm _____________________________________________________________________________ Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr From rob at koberg.com Sat Aug 30 21:05:16 2008 From: rob at koberg.com (Robert Koberg) Date: Sat Aug 30 17:05:38 2008 Subject: XQuery as a standard, was Re: [xquery-talk] XQuery in mark logic In-Reply-To: <698253.627.qm@web23005.mail.ird.yahoo.com> References: <698253.627.qm@web23005.mail.ird.yahoo.com> Message-ID: <81705E1F-29CD-4793-8146-EC898B206CFE@koberg.com> Curious, what are your experiences in using XQuery across implementations? best, Rob On Aug 30, 2008, at 5:46 PM, Florent Georges wrote: > bharath maharajan wrote: > > Hi > >> >> >> >> HF >> 45 >> >> >> >> >> Core >> 67 >> >> >> > >> data(doc("book.xml")/books/book/information)) > > I wonder what you want to achieve. > > Actually, I always thought that data() on an element that has child > elements was an error. What would be the semantics of the above > example? > > Regards, > > --drkm > > > > > > > > > > > > > > > > > > > > > > > _____________________________________________________________________________ > Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Sun Aug 31 11:39:57 2008 From: mike at saxonica.com (Michael Kay) Date: Sun Aug 31 02:40:16 2008 Subject: [xquery-talk] XQuery in mark logic In-Reply-To: <698253.627.qm@web23005.mail.ird.yahoo.com> References: <698253.627.qm@web23005.mail.ird.yahoo.com> Message-ID: <0F1DE2C688D748E98255269BA94F5487@Sealion> > Actually, I always thought that data() on an element that > has child elements was an error. No. It's an error if the element has been validated against a schema that assigns it a type that has element-only content. That's not the same thing at all. > What would be the semantics of the above example? For an untyped element node, data() returns essentially the same as string() - the concatenation of the descendant text nodes. Michael Kay http://www.saxonica.com/