From sahoo.byomokesh at gmail.com Wed Dec 2 10:56:42 2009 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Tue Dec 1 21:04:56 2009 Subject: [xquery-talk] Poor coding Default Convert Message-ID: <373764c60912012126g660e4cdbw553d83e10d800e71@mail.gmail.com> Hi, I have some doubt about MarkLogic Default Converter (PDF to XML, Word to XML). 1. This convert files are 100% accuracy? 2. Can i write any program to transform from Marklogic convert files to another XML format in complex table and List Item. 3. Can we archive different output files (eBook, ePDF) frm default conversion I found text missing, table is coding para, List items para coding. My Question is without any manual work how we archive good output from Marklogic default conversion. Can anyone suggest me. Thanks Byomokesh From james.fuller.2007 at gmail.com Wed Dec 2 06:32:01 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Tue Dec 1 21:10:08 2009 Subject: [xquery-talk] Poor coding Default Convert In-Reply-To: <373764c60912012126g660e4cdbw553d83e10d800e71@mail.gmail.com> References: <373764c60912012126g660e4cdbw553d83e10d800e71@mail.gmail.com> Message-ID: On Wed, Dec 2, 2009 at 6:26 AM, Byomokesh Sahoo wrote: > Hi, > > I have some doubt about MarkLogic Default Converter (PDF to XML, Word to XML). > > 1. This convert files are 100% accuracy? > 2. Can i write any program to transform from Marklogic convert files > to another ?XML format in complex table and List Item. > 3. Can we archive different output files (eBook, ePDF) frm default conversion > You might want to try the marklogic mailing list for these kind of questions about marklogic specific functionality. Jim Fuller > > I found text missing, table is coding para, List items para coding. My > Question is without any manual work how we archive good output from > Marklogic default conversion. > > > Can anyone suggest me. > > Thanks > Byomokesh > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From nicola.cosco at gmail.com Thu Dec 3 00:28:30 2009 From: nicola.cosco at gmail.com (Nicola Cosco) Date: Wed Dec 2 15:12:40 2009 Subject: [xquery-talk] help about xquery implementations Message-ID: Hi, I'm looking for a XQuery java implementation, in order to modify it and include my XPath implementation. Cheers, Nicola -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20091203/9ff1d20e/attachment.htm From dlee at calldei.com Wed Dec 2 19:02:13 2009 From: dlee at calldei.com (David A. Lee) Date: Wed Dec 2 15:45:07 2009 Subject: [xquery-talk] help about xquery implementations In-Reply-To: References: Message-ID: <4B170005.8060106@calldei.com> Saxon (www.saxonica.com) is an excellent java based XQuery engine However, I suspect you will find it extremely difficult to replace the XPath implementation, because XQuery and XPath are so intertwined. David A. Lee dlee@calldei.com http://www.calldei.com http://www.xmlsh.org 812-482-5224 Nicola Cosco wrote: > Hi, > > I'm looking for a XQuery java implementation, in order to modify it > and include my XPath implementation. > > Cheers, > > Nicola > ------------------------------------------------------------------------ > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20091202/6980fb3f/attachment.htm From sahoo.byomokesh at gmail.com Fri Dec 4 19:05:41 2009 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Fri Dec 4 05:35:28 2009 Subject: [xquery-talk] XPATH Problem Message-ID: <373764c60912040535m1fd15731wa44e9c1bcaaad8f8@mail.gmail.com> Hi, I am missing XPATH in my result files. my input -----------

Chapter 2

Creating and Using DSLs

Introduction

The purpose of this chapter is to touch on all of the principal aspects of defining a domain-specific language (DSL) with the Microsoft DSL Tools. We also introduce an example scenario in which the DSL Tools are used. The later chapters will then go into more detail on each topic.

Query... for.... return if ($o/xh:div) then {data($o//xh:p[@class='pa-0'])} else {data($o//xh:p)} Result ===== Creating and Using DSLs Required Output =========== Chapter 2 Creating and Using DSLs Introduction The purpose of this.............. Please advice.. Thanks Byomokesh From gkholman at CraneSoftwrights.com Fri Dec 4 08:52:37 2009 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Fri Dec 4 05:52:08 2009 Subject: [xquery-talk] XPATH Problem In-Reply-To: <373764c60912040535m1fd15731wa44e9c1bcaaad8f8@mail.gmail.co m> References: <373764c60912040535m1fd15731wa44e9c1bcaaad8f8@mail.gmail.com> Message-ID: <7.0.1.0.2.20091204084320.027574d8@wheresmymailserver.com> At 2009-12-04 19:05 +0530, Byomokesh Sahoo wrote: >I am missing XPATH in my result files. >... > >Query... > >for.... >return if ($o/xh:div) >then {data($o//xh:p[@class='pa-0'])} >else {data($o//xh:p)} I find it unclear how the test for xh:div is to be interpreted. >Result >===== > >Creating and Using DSLs > > >Required Output >=========== >Chapter 2 >Creating and Using DSLs >Introduction >The purpose of this.............. > >Please advice.. I'm assuming you just want to put all of the paragraphs through a translation to simple text without preserving their markup. An example is below, but without understanding your precise requirements I'm unsure this will help you. I hope it does. . . . . . . . Ken T:\ftemp>type sahoo.xml

Chapter 2

Creating and Using DSLs

Introduction

The purpose of this chapter is to touch on all of the principal aspects of defining a domain-specific language (DSL) with the Microsoft DSL Tools. We also introduce an example scenario in which the DSL Tools are used. The later chapters will then go into more detail on each topic.

T:\ftemp>xquery sahoo.xq Chapter 2 Creating and Using DSLs Introduction The purpose of this chapter is to touch on all of the principal aspects of defining a domain-specific language (DSL) with the Microsoft DSL Tools. We also introduce an example scenario in which the DSL Tools are used. The later chapters will then go into more detail on each topic. T:\ftemp>type sahoo.xq declare namespace xh = "http://www.w3.org/1999/xhtml"; for $p in doc('sahoo.xml')/xh:html/xh:body/xh:div/xh:p return if ( $p/@class='pa-0' ) then {data($p)} else {data($p)} T:\ftemp> -- 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 Fri Dec 4 14:04:56 2009 From: mike at saxonica.com (Michael Kay) Date: Fri Dec 4 06:04:07 2009 Subject: [xquery-talk] XPATH Problem In-Reply-To: <373764c60912040535m1fd15731wa44e9c1bcaaad8f8@mail.gmail.com> References: <373764c60912040535m1fd15731wa44e9c1bcaaad8f8@mail.gmail.com> Message-ID: <7D096C9777C14F04A71A9871292C8EB2@Sealion> > > Query... > > for.... > return if ($o/xh:div) > then {data($o//xh:p[@class='pa-0'])} > else {data($o//xh:p)} All we can tell from this is that $o/xh:div exists. Since you haven't told us what $o is, we can't tell you why that should be the case. My guess is that $o is bound to the body element when you were expecting it for some reason to be bound to something else. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > > Result > ===== > > Creating and Using DSLs > > > Required Output > =========== > Chapter 2 > Creating and Using DSLs > Introduction > The purpose of this.............. > > > Please advice.. > > Thanks > Byomokesh > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From sahoo.byomokesh at gmail.com Fri Dec 4 19:45:26 2009 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Fri Dec 4 06:14:13 2009 Subject: [xquery-talk] XPATH Problem In-Reply-To: <7D096C9777C14F04A71A9871292C8EB2@Sealion> References: <373764c60912040535m1fd15731wa44e9c1bcaaad8f8@mail.gmail.com> <7D096C9777C14F04A71A9871292C8EB2@Sealion> Message-ID: <373764c60912040615v7d1ab1b3jc31ed3b273eaad0a@mail.gmail.com> Thanks. Its work fine. $o is file handle like replace in $p. On that file bold itlaic is coming in . Is it possible to convert bold italic tag inside this syntax. Thanks Sahoo On Fri, Dec 4, 2009 at 7:34 PM, Michael Kay wrote: >> >> Query... >> >> for.... >> return if ($o/xh:div) >> then {data($o//xh:p[@class='pa-0'])} >> else {data($o//xh:p)} > > All we can tell from this is that $o/xh:div exists. Since you haven't told > us what $o is, we can't tell you why that should be the case. My guess is > that $o is bound to the body element when you were expecting it for some > reason to be bound to something else. > > Regards, > > Michael Kay > http://www.saxonica.com/ > http://twitter.com/michaelhkay > >> >> Result >> ===== >> >> Creating and Using DSLs >> >> >> Required Output >> =========== >> Chapter 2 >> Creating and Using DSLs >> Introduction >> The purpose of this.............. >> >> >> Please advice.. >> >> Thanks >> Byomokesh >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk > > From mike at saxonica.com Fri Dec 4 14:48:06 2009 From: mike at saxonica.com (Michael Kay) Date: Fri Dec 4 06:45:54 2009 Subject: [xquery-talk] XPATH Problem In-Reply-To: <373764c60912040615v7d1ab1b3jc31ed3b273eaad0a@mail.gmail.com> References: <373764c60912040535m1fd15731wa44e9c1bcaaad8f8@mail.gmail.com><7D096C9777C14F04A71A9871292C8EB2@Sealion> <373764c60912040615v7d1ab1b3jc31ed3b273eaad0a@mail.gmail.com> Message-ID: <32731B66F6714B26AE3BCF387C7109B7@Sealion> > $o is file handle like replace in $p. I haven't the faintest idea what that sentence is supposed to mean, but $o is certainly not a file handle: it is a variable reference, and to tell why your code isn't working we need to know how the variable is initialized. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From sahoo.byomokesh at gmail.com Mon Dec 7 16:57:17 2009 From: sahoo.byomokesh at gmail.com (Byomokesh Sahoo) Date: Mon Dec 7 02:57:14 2009 Subject: [xquery-talk] Transform Message-ID: <373764c60912070327x19f77f91kd889525cb9115735@mail.gmail.com> Hi, I am facing lot of problems using XQuery. I am trying to convert XHTML to XML using XQuery. Please advice me, is it possible or not. If yes...how. Input ====

Chapter 2

Creating and Using DSLs

Introduction

The purpose of....

This chapter DSLs.

Need Output =========
Chapter 2 Creating and Using DSLs<title> <section> <title>Introduction The purpose of.... This chapter DSLs.
I know its very easy to transform using XSLT. By I want to convert using XQuery. Is it possible? Thanks Byomokesh From milu71 at gmx.de Mon Dec 7 12:48:13 2009 From: milu71 at gmx.de (Michael Ludwig) Date: Mon Dec 7 03:18:16 2009 Subject: [xquery-talk] Transform In-Reply-To: <373764c60912070327x19f77f91kd889525cb9115735@mail.gmail.com> References: <373764c60912070327x19f77f91kd889525cb9115735@mail.gmail.com> Message-ID: <20091207114813.GA1888@wladimir> Byomokesh Sahoo schrieb am 07.12.2009 um 16:57:17 (+0530): > Input > ==== > > > >
>

Chapter 2

>

Creating > and Using DSLs

>

class="ca-2">Introduction

>

The purpose of....

>

This chapter DSLs.

>
> > > I know its very easy to transform using XSLT. By I want to convert > using XQuery. Is it possible? Regardless of the language used, it is difficult to see the logical structure in your HTML input, because it is not exlicit in the markup, as it should be, in terms of h1, h2, etc. Then, this seems to be rather a document than a piece of data such as an invoice, and for such input the push approach is usually superior to the pull approach. In XSLT, both are possible; in XQuery, there is only very limited support for push, and that's why I'd avoid XQuery here. Bottom line: It may be possible, but why bother using a screwdriver to get a nail in the wall when there is a hammer? -- Michael Ludwig From mike at saxonica.com Mon Dec 7 11:59:55 2009 From: mike at saxonica.com (Michael Kay) Date: Mon Dec 7 03:29:21 2009 Subject: [xquery-talk] Transform In-Reply-To: <373764c60912070327x19f77f91kd889525cb9115735@mail.gmail.com> References: <373764c60912070327x19f77f91kd889525cb9115735@mail.gmail.com> Message-ID: <3EB5605DBF3342FBBF7B6D653E6B614E@Sealion> The classic way of doing this kind of transformation in XSLT is using template rules, typically one for each element name. There's no direct equivalent to that in XQuery. In XQuery you essentially have to simulate the action of apply-templates by hand: write one function for each element name, and then write your own processChildren() function which uses typeswitch to select which of these functions to apply to each element. For example declare function f:processHtml($in as element(html)) {
{f:processChildren($in)
} declare function f:processDiv($in as element(div)) { {f:processChildren($in) } declare function f:processChildren($in as element()) { for $c in $in/child::node() { typeswitch ($c) { case element(body): f:processBody($c) case element(div): f:processDiv($c) etc. If the patterns are more complex, e.g. different classes of div, then you can either put the conditional logic in the processDiv() function or in the processChildren() despatch function. 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: 07 December 2009 11:27 > To: talk@x-query.com > Subject: [xquery-talk] Transform > > Hi, > > I am facing lot of problems using XQuery. I am trying to > convert XHTML to XML using XQuery. Please advice me, is it > possible or not. If yes...how. > > Input > ==== > > > >
>

Chapter 2

>

class="ca-1">Creating and Using DSLs

class="pa-1">

class="ca-2">Introduction

>

The purpose of....

class="pa-2 ca-3">This chapter DSLs.

> > > Need Output > ========= > >
> > Chapter 2 Creating and Using DSLs<title> <section> > <title>Introduction The purpose > of.... This chapter DSLs. >
> > I know its very easy to transform using XSLT. By I want to > convert using XQuery. Is it possible? > > Thanks > Byomokesh > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From anujk.harcourtian at gmail.com Thu Dec 10 18:51:03 2009 From: anujk.harcourtian at gmail.com (anuj kumar) Date: Thu Dec 10 04:17:51 2009 Subject: [xquery-talk] How to preserve " in text node output in result tree Message-ID: Hi All, I am creating a result tree from my source tree using XQuery. I have source tree sample data as follows: *

"Conservancy."A charitable corporation

* My result tree data should be like this : *

"Conservancy. " A charitable corporation

* My question is, how can i convert *"* (single quote) in my source tree into its Unicode equivalent *" * in my result tree using XQuery. Please help. -- Regards, Anuj Kumar -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20091210/9b75ed0b/attachment.htm From gkholman at CraneSoftwrights.com Thu Dec 10 08:33:42 2009 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Thu Dec 10 04:30:05 2009 Subject: [xquery-talk] How to preserve " in text node output in result tree In-Reply-To: References: Message-ID: <7.0.1.0.2.20091210082844.02642fe0@wheresmymailserver.com> At 2009-12-10 18:51 +0530, anuj kumar wrote: >I am creating a result tree from my source tree using XQuery. >I have source tree sample data as follows: >

"Conservancy."A charitable corporation

>My result tree data should be like this : >

"Conservancy. " A charitable corporation

> >My question is, how can i convert " (single >quote) in my source tree into its Unicode >equivalent "? in my result tree using XQuery. The "Unicode equivalent" to " is " What you want to preserve is the XML markup for the Unicode double quote character. The XML markup used in the source file is not a property of the XPath data model for XML on which XQuery is built. You say your result tree "should be like this" ... yet any XML processor downstream is going to interpret the same text node information if you use " or if you use " because that XML processor is going to eat the markup and interpret the Unicode character. Of course if you are using a non-XML processor downstream, then the question becomes more important, but you are still stuck ... the data model just doesn't remember this kind of information. An XQuery processor is allowed to support a character map for serialization and in such a processor you could ask that all double quotes get serialized as ", but you can't do it selectively only for some of the result nodes. You might consider a pre-process that escapes your special uses of the built-in entity, perhaps using a private-use Unicode character, and then post-process your result to translate them back ... but again I ask why you feel these need to be preserved in the first place if this is a true XML-based process. I hope this helps. . . . . . . . . . Ken -- XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 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 Thu Dec 10 13:37:02 2009 From: mike at saxonica.com (Michael Kay) Date: Thu Dec 10 04:33:14 2009 Subject: [xquery-talk] How to preserve " in text node output in result tree In-Reply-To: References: Message-ID: <779071EDDAEC49DC8C00287B3F28EAAC@Sealion> A result tree never contains " - that is an artefact of serializing the result tree into lexical XML. XQuery doesn't give you this amount of control over the way in which the result tree is serialized. Generally, character and entity references will be used only where there is no other way of representing the character. You can achieve what you want by post-processing the results through an XSLT 2.0 serializer that supports character maps. This allows you to define rules for outputting individual characters during serialization. However, it's worth asking the question - why do you care? Any component that reads this output and cares about the difference between " and " is not using XML in the way XML was intended to be used, and your best course of action is to fix that component. 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: 10 December 2009 13:21 To: talk@x-query.com Subject: [xquery-talk] How to preserve "in text node output in result tree Hi All, I am creating a result tree from my source tree using XQuery. I have source tree sample data as follows:

"Conservancy."A charitable corporation

My result tree data should be like this :

"Conservancy. " A charitable corporation

My question is, how can i convert " (single quote) in my source tree into its Unicode equivalent " in my result tree using XQuery. Please help. -- Regards, Anuj Kumar -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20091210/97e5a64e/attachment.htm From John.newman at viaoncology.com Mon Dec 14 16:35:31 2009 From: John.newman at viaoncology.com (Newman, John W) Date: Mon Dec 14 13:15:58 2009 Subject: [xquery-talk] Problems inserting an attribute that contains new lines Message-ID: Hello, We are using mxquery 0.6. A few months ago, I noticed a problem where our xquery updates were losing newlines. One of my coworkers did some testing, closed it as "not a bug, cannot reproduce", but now today I've found that the problem is still happening when inserting attributes but not replacing them (which is probably what he tested). Sample query: declare variable $source external; declare variable $newNote := "A note with some new lines in it."; copy $target := $source modify ( let $targetElement := $target//; let $notes := $targetElement/@Notes return ( if ($notes) then ( replace value of node $notes with $newNote (: this works fine, new lines are preserved :) ) else ( insert nodes attribute Notes '{' $newNote '}' into $targetElement (: this loses new lines, they are replaced with a space :) ) ) ) return $target input: output: (incorrect, escaped new lines have been replaced with regular spaces) input: output: (correct, replace is OK) I've been digging through the xquery update spec for a bit but I am not finding my answer - is there an extra symbol or setting we need to preserve the new lines for an insert? Is the processor doing 'too much' normalization? I'd be happier if it wasn't modifying data on its own. =) Thanks in advance for any advice -John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20091214/a403d269/attachment.htm From hrennau at yahoo.de Tue Dec 15 07:27:14 2009 From: hrennau at yahoo.de (Hans-Juergen Rennau) Date: Mon Dec 14 22:52:17 2009 Subject: [xquery-talk] How to copy in-scope namespace bindings Message-ID: <482478.18927.qm@web27101.mail.ukl.yahoo.com> Hello People, glad to get advice concerning the processing of namespace-sensitive content. The problem. When recursively processing a document with namespace-sensitive content - e.g. an XSD - one has this problem: the classic copying pattern: element {node-name($n)} { for $ac in $n/(@*, node()) return yogi:process($ac) } does not copy namespace-bindings unless they will be provided by namespace fixup due to their use in item names. In particular, namespace bindings which the source may possess solely for the interpretation of namespace-sensitive content may be lost... How to deal with this problem? The technique I use is collecting the source element's bindings (via in-scope-prefixes + namespace-uri-for-prefix), construct a wrapper around the target node, attach dummy attributes to it using the namespace bindings, and then discard the wrapper: <_wrapper>{$nsDummayAtts, element{node-name($n)} {...}}/* which is as elegant as Monty Python's silly walks but less funny. And worse: it is a fragile solution, depending on the copy-namespaces mode containing the value 'inherit', and some (even neither bad nor cheap) processors do not even support setting that mode! Not to mention that in other parts of the same module a different mode value may be appropriate... Does anybody have alternative suggestions how to cope with the problem (except for turning to XQuery 1.1 which will not be a recommendation within two years, and XSLT2.0)? Thank you very much - Hans-Juergen __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verf?gt ?ber einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com From Geert.Josten at daidalos.nl Tue Dec 15 09:16:38 2009 From: Geert.Josten at daidalos.nl (Geert Josten) Date: Mon Dec 14 23:40:55 2009 Subject: [xquery-talk] How to copy in-scope namespace bindings In-Reply-To: <482478.18927.qm@web27101.mail.ukl.yahoo.com> References: <482478.18927.qm@web27101.mail.ukl.yahoo.com> Message-ID: <0260356C6DFE754BA6FA48E659A1433846EF07515D@helios.olympus.borgus.nl> Hi Hans-Juergen, I had a similar case (or perhaps it is the same?) in which I wanted to preserve namespace bindings on the element when copying it, even those not used or only used by descendants. I simply solved it by using the namespace axis. It would come down to adding $n/namespace::* just above your for loop. But I am not certain it is supported by all XQuery processors, and you may get some xml namespace bindings you will have to filter out as well.. 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 Hans-Juergen Rennau > Sent: dinsdag 15 december 2009 8:27 > To: talk@x-query.com > Subject: [xquery-talk] How to copy in-scope namespace bindings > > Hello People, > > glad to get advice concerning the processing of > namespace-sensitive content. > > The problem. When recursively processing a document with > namespace-sensitive content - e.g. an XSD - one has this > problem: the classic copying pattern: > element {node-name($n)} { > for $ac in $n/(@*, node()) return yogi:process($ac) > } > > does not copy namespace-bindings unless they will be provided > by namespace fixup due to their use in item names. In > particular, namespace bindings which the source may possess > solely for the interpretation of namespace-sensitive content > may be lost... How to deal with this problem? > > The technique I use is collecting the source element's > bindings (via in-scope-prefixes + namespace-uri-for-prefix), > construct a wrapper around the target node, attach dummy > attributes to it using the namespace bindings, and then > discard the wrapper: > <_wrapper>{$nsDummayAtts, element{node-name($n)} {...}}/* > > which is as elegant as Monty Python's silly walks but less > funny. And worse: it is a fragile solution, depending on the > copy-namespaces mode containing the value 'inherit', and some > (even neither bad nor cheap) processors do not even support > setting that mode! Not to mention that in other parts of the > same module a different mode value may be appropriate... > > Does anybody have alternative suggestions how to cope with > the problem (except for turning to XQuery 1.1 which will not > be a recommendation within two years, and XSLT2.0)? > > Thank you very much - > Hans-Juergen > > > __________________________________________________ > 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 mike at saxonica.com Tue Dec 15 10:21:30 2009 From: mike at saxonica.com (Michael Kay) Date: Tue Dec 15 01:43:51 2009 Subject: [xquery-talk] How to copy in-scope namespace bindings In-Reply-To: <0260356C6DFE754BA6FA48E659A1433846EF07515D@helios.olympus.borgus.nl> References: <482478.18927.qm@web27101.mail.ukl.yahoo.com> <0260356C6DFE754BA6FA48E659A1433846EF07515D@helios.olympus.borgus.nl> Message-ID: <110F0F9645D24CA1A03101FC71829E07@Sealion> I was under the impression that an XQuery processor isn't even *allowed* to support the namespace axis, which is why Saxon contains explicit logic to reject it: though reading the conformance rules again, XQuery is actually very liberal about vendor extensions, so that might not have been the right decision. Saxon does have a function saxon:namespace() which allows you to construct namespace nodes and add them to a containing element, which is less contorted than your workaround, but not as portable. It's worth pointing out that the Data Model actually allows processors to remove namespaces that don't appear in element or attribute names completely. That was done because there were influential vendors on the Working Group who simply saw "namespaces in content" as an unnecessary complexity, and one which made mapping of XML to relational databases too hard. I don't know if any products have taken this option - it's worth checking, because any such product cannot be used to store schemas, stylesheets, or even instance documents containing an "xsi:type" attribute. 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 Geert Josten > Sent: 15 December 2009 08:17 > To: Hans-Juergen Rennau; talk@x-query.com > Subject: RE: [xquery-talk] How to copy in-scope namespace bindings > > Hi Hans-Juergen, > > I had a similar case (or perhaps it is the same?) in which I > wanted to preserve namespace bindings on the element when > copying it, even those not used or only used by descendants. > I simply solved it by using the namespace axis. It would come > down to adding $n/namespace::* just above your for loop. But > I am not certain it is supported by all XQuery processors, > and you may get some xml namespace bindings you will have to > filter out as well.. > > 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 Hans-Juergen Rennau > > Sent: dinsdag 15 december 2009 8:27 > > To: talk@x-query.com > > Subject: [xquery-talk] How to copy in-scope namespace bindings > > > > Hello People, > > > > glad to get advice concerning the processing of namespace-sensitive > > content. > > > > The problem. When recursively processing a document with > > namespace-sensitive content - e.g. an XSD - one has this > > problem: the classic copying pattern: > > element {node-name($n)} { > > for $ac in $n/(@*, node()) return yogi:process($ac) > > } > > > > does not copy namespace-bindings unless they will be provided by > > namespace fixup due to their use in item names. In particular, > > namespace bindings which the source may possess solely for the > > interpretation of namespace-sensitive content may be lost... How to > > deal with this problem? > > > > The technique I use is collecting the source element's > bindings (via > > in-scope-prefixes + namespace-uri-for-prefix), construct a wrapper > > around the target node, attach dummy attributes to it using the > > namespace bindings, and then discard the wrapper: > > <_wrapper>{$nsDummayAtts, element{node-name($n)} {...}}/* > > > > which is as elegant as Monty Python's silly walks but less > funny. And > > worse: it is a fragile solution, depending on the > copy-namespaces mode > > containing the value 'inherit', and some (even neither bad > nor cheap) > > processors do not even support setting that mode! Not to > mention that > > in other parts of the same module a different mode value may be > > appropriate... > > > > Does anybody have alternative suggestions how to cope with > the problem > > (except for turning to XQuery 1.1 which will not be a > recommendation > > within two years, and XSLT2.0)? > > > > Thank you very much - > > Hans-Juergen > > > > > > __________________________________________________ > > 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 > > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From gkholman at CraneSoftwrights.com Tue Dec 15 09:53:31 2009 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Tue Dec 15 06:52:33 2009 Subject: [xquery-talk] How to copy in-scope namespace bindings In-Reply-To: <110F0F9645D24CA1A03101FC71829E07@Sealion> References: <482478.18927.qm@web27101.mail.ukl.yahoo.com> <0260356C6DFE754BA6FA48E659A1433846EF07515D@helios.olympus.borgus.nl> <110F0F9645D24CA1A03101FC71829E07@Sealion> Message-ID: <7.0.1.0.2.20091215081454.0286f4c8@wheresmymailserver.com> At 2009-12-15 10:21 +0000, Michael Kay wrote: >I was under the impression that an XQuery processor isn't even *allowed* to >support the namespace axis, which is why Saxon contains explicit logic to >reject it: though reading the conformance rules again, XQuery is actually >very liberal about vendor extensions, so that might not have been the right >decision. I've based the section in my teaching materials on the note in: http://www.w3.org/TR/2007/REC-xquery-20070123/#id-basics ... just before section 2.1: http://www.w3.org/TR/2007/REC-xquery-20070123/#context ... where it states: "XQuery does not support the namespace axis and does not represent namespace bindings in the form of nodes. That sounds pretty explicit to me ... but it is in a note. Does putting it in a note make it informative instead of normative in W3C specifications? I think in ISO specifications that is true, but given this was in the section on basics I thought it was binding. . . . . . . . . . . Ken -- XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 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 Andy.K.Chang at aexp.com Tue Dec 15 08:01:59 2009 From: Andy.K.Chang at aexp.com (Andy K Chang) Date: Tue Dec 15 07:00:34 2009 Subject: [xquery-talk] Andy K Chang is on vacation Message-ID: I will be out of the office starting 12/12/2009 and will not return until 01/04/2010. Hi, I will be out of my office on vacation starting Monday, 12/14/2009. Coming back to work on 1/4/2010. During this time, my delegation will be: on 12/14: John S Strozyk; email: John.S.Strozyk@aexp.com; phone: 602-537-2854 from 12/15 to 12/23: Nicole A Black; email: Nicole.A.Black@aexp.com; phone: 302-653-8240 from 12/24 to 12/27: no delegate and I will be out of pocket. If you need help, please contact Rob Sassman at 480-528-0880 for emergency from 12/28 to 12/29: John S Strozyk; email: John.S.Strozyk@aexp.com; phone: 602-537-2854 from 12/30 to 1/3: no delegate but I will be available. Please call me at 480-203-3964 for emergency Thanks and have a happy holiday. American Express made the following annotations on Tue Dec 15 2009 08:02:00 ------------------------------------------------------------------------------ "This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you." American Express a ajouté le commentaire suivant le Tue Dec 15 2009 08:02:00 Ce courrier et toute pièce jointe qu'il contient sont réservés au seul destinataire indiqué et peuvent renfermer des renseignements confidentiels et privilégiés. Si vous n'êtes pas le destinataire prévu, toute divulgation, duplication, utilisation ou distribution du courrier ou de toute pièce jointe est interdite. Si vous avez reçu cette communication par erreur, veuillez nous en aviser par courrier et détruire immédiatement le courrier et les pièces jointes. Merci. ****************************************************************************** ------------------------------------------------------------------------------- From Geert.Josten at daidalos.nl Tue Dec 15 16:05:18 2009 From: Geert.Josten at daidalos.nl (Geert Josten) Date: Tue Dec 15 07:03:48 2009 Subject: [xquery-talk] How to copy in-scope namespace bindings In-Reply-To: <7.0.1.0.2.20091215081454.0286f4c8@wheresmymailserver.com> References: <482478.18927.qm@web27101.mail.ukl.yahoo.com><0260356C6DFE754BA6FA48E659A1433846EF07515D@helios.olympus.borgus.nl><110F0F9645D24CA1A03101FC71829E07@Sealion> <7.0.1.0.2.20091215081454.0286f4c8@wheresmymailserver.com> Message-ID: <0260356C6DFE754BA6FA48E659A1433846EF0752AF@helios.olympus.borgus.nl> I would say it is not bothering anybody when there happens to be some implementation that supports it, for some kind of backwards compatibility reason perhaps. But if it is mentioned that explicitly, its use should not be advocated. I will refrain from it, though I have to say that it made solving my problem quite easy.. :-/ 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 G. Ken Holman > Sent: dinsdag 15 december 2009 15:54 > To: talk@x-query.com > Subject: RE: [xquery-talk] How to copy in-scope namespace bindings > > At 2009-12-15 10:21 +0000, Michael Kay wrote: > >I was under the impression that an XQuery processor isn't even > >*allowed* to support the namespace axis, which is why Saxon contains > >explicit logic to reject it: though reading the conformance rules > >again, XQuery is actually very liberal about vendor > extensions, so that > >might not have been the right decision. > > I've based the section in my teaching materials on the note in: > > http://www.w3.org/TR/2007/REC-xquery-20070123/#id-basics > > ... just before section 2.1: > > http://www.w3.org/TR/2007/REC-xquery-20070123/#context > > ... where it states: > > "XQuery does not support the namespace axis and does not > represent namespace bindings in the form of nodes. > > That sounds pretty explicit to me ... but it is in a note. > Does putting it in a note make it informative instead of > normative in W3C specifications? I think in ISO > specifications that is true, but given this was in the > section on basics I thought it was binding. > > . . . . . . . . . . Ken > > > -- > XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 > 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 > From mike at saxonica.com Tue Dec 15 16:14:54 2009 From: mike at saxonica.com (Michael Kay) Date: Tue Dec 15 08:09:07 2009 Subject: [xquery-talk] How to copy in-scope namespace bindings In-Reply-To: <7.0.1.0.2.20091215081454.0286f4c8@wheresmymailserver.com> References: <482478.18927.qm@web27101.mail.ukl.yahoo.com><0260356C6DFE754BA6FA48E659A1433846EF07515D@helios.olympus.borgus.nl><110F0F9645D24CA1A03101FC71829E07@Sealion> <7.0.1.0.2.20091215081454.0286f4c8@wheresmymailserver.com> Message-ID: > > I've based the section in my teaching materials on the note in: > > http://www.w3.org/TR/2007/REC-xquery-20070123/#id-basics > > ... just before section 2.1: > > http://www.w3.org/TR/2007/REC-xquery-20070123/#context > > ... where it states: > > "XQuery does not support the namespace axis and does not > represent namespace bindings in the form of nodes. > > That sounds pretty explicit to me ... but it is in a note. > Does putting it in a note make it informative instead of > normative in W3C specifications? I think in ISO > specifications that is true, but given this was in the > section on basics I thought it was binding. Well, personally, I treat the word "support" in specifications as poison. What does it mean? We read of applications that "support" Linux, of products that "support" standards (say XQuery), and here of a language that "supports" a particular feature. Almost invariably, and certainly here, it's a bad choice of verb. It's fairly clear that this sentence means that a minimally conformant XQuery implementation will reject use of the namespace axis, and provides no mechanism for getting access to namespace nodes. But it doesn't say that an implementation is non-conformant if it does provide those features. The specification explicitly doesn't say that a conforming implementation must reject any construct that isn't defined in (or "supported by") the spec: and as far as I have been able to determine, that is a deliberate omission. The cultural background of XQuery is in the database world, where vendors routinely expect to implement their own enhancements to standards and users typically don't complain. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From mail at martin-probst.com Tue Dec 15 19:00:10 2009 From: mail at martin-probst.com (Martin Probst) Date: Tue Dec 15 09:53:02 2009 Subject: [xquery-talk] How to copy in-scope namespace bindings In-Reply-To: References: <482478.18927.qm@web27101.mail.ukl.yahoo.com> <0260356C6DFE754BA6FA48E659A1433846EF07515D@helios.olympus.borgus.nl> <110F0F9645D24CA1A03101FC71829E07@Sealion> <7.0.1.0.2.20091215081454.0286f4c8@wheresmymailserver.com> Message-ID: <6dca08520912151000r4d0a1ab5h46897231cd7ab94b@mail.gmail.com> > specification explicitly doesn't say that a conforming implementation must > reject any construct that isn't defined in (or "supported by") the spec: and > as far as I have been able to determine, that is a deliberate omission. The > cultural background of XQuery is in the database world, where vendors > routinely expect to implement their own enhancements to standards and users > typically don't complain. That is a tough decision in my opinion. For example, the standard mandates that "5div 3" must be treated as an error, at least that's the way I read it. Our parser actually contains several special case statements that check for such conditions - normally, we'd be able to properly parse that (and I don't quite understand why it should be a problem), but we need special logic to prevent that. The same thing applies to casting strings to QNames at run time, and other similar things. I'm actually thinking about implementing a more rigid standards compliancy mode that enforces these things, and a more lenient mode. Preventing things like the run time case to QName is quite a pain for users, and it's entirely gratuitous in my opinion. Regards, Martin From mike at saxonica.com Tue Dec 15 18:21:12 2009 From: mike at saxonica.com (Michael Kay) Date: Tue Dec 15 10:13:40 2009 Subject: [xquery-talk] How to copy in-scope namespace bindings In-Reply-To: <6dca08520912151000r4d0a1ab5h46897231cd7ab94b@mail.gmail.com> References: <482478.18927.qm@web27101.mail.ukl.yahoo.com> <0260356C6DFE754BA6FA48E659A1433846EF07515D@helios.olympus.borgus.nl> <110F0F9645D24CA1A03101FC71829E07@Sealion> <7.0.1.0.2.20091215081454.0286f4c8@wheresmymailserver.com> <6dca08520912151000r4d0a1ab5h46897231cd7ab94b@mail.gmail.com> Message-ID: <40CC593950474462B6281ADCF06ACDF2@Sealion> > > That is a tough decision in my opinion. For example, the > standard mandates that "5div 3" must be treated as an error, > at least that's the way I read it. Yes, I've generally gone out of my way to implement and enforce such rules. But I also tried to get the WG to agree to tighter wording on conformance to disallow syntactic extensions, and they pushed back. > (and I don't quite understand why it should be a problem), If I remember, it was a rather silly discussion of why 5e0 should be tokenized differently from 5else0, leading to the rule in 2.2 that adjacent non-delimiting termial symbols must be separated by whitespace. > Preventing things like the > run time case to QName is quite a pain for users, and it's > entirely gratuitous in my opinion. Again there's a history, but the final result ended up slightly absurd, given that there are other constructs in XQuery (element constructors) where the static namespace context needs to be known at run-time. The original rule was to ensure that casting QName to string didn't need to know the static namespace context (because the system would then have to keep this context for all casts, just in case the operand turns out to be a QName); the current rule was introduced for symmetry, and somehow got left in when the QName->string case was resolved by making QNames into triples. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From jonathan.robie at redhat.com Tue Dec 15 15:57:57 2009 From: jonathan.robie at redhat.com (Jonathan Robie) Date: Tue Dec 15 12:47:20 2009 Subject: [xquery-talk] New XQuery / XPath Working Drafts Message-ID: <4B27F855.4080406@redhat.com> The XQuery working Group has just published new versions of the following specifications: XQuery 1.1: An XML Query Language http://www.w3.org/TR/2009/WD-xquery-11-20091215/ XQueryX 1.1 http://www.w3.org/TR/2009/WD-xqueryx-11-20091215/ XQuery 1.1 Requirements http://www.w3.org/TR/2009/WD-xquery-11-requirements-20091215/ These include a number of significant new XQuery features, including: * group by clause in FLWOR Expressions * tumbling window and sliding window in FLWOR Expressions * count clause in FLWOR Expressions * allowing empty in 3.8.2 For Clause (for functionality similar to outer joins in SQL) * try/catch expressions * Dynamic function invocation * Inline functions * Private functions * Nondeterministic functions * Switch expressions * Computed namespace constructors * Output declarations The XQuery and XSL Working Groups have published First Public Working Drafts of the following specifications: XPath 2.1 http://www.w3.org/TR/2009/WD-xpath-21-20091215/ XQuery and XPath Data Model 1.1 http://www.w3.org/TR/2009/WD-xpath-datamodel-11-20091215/ XPath and XQuery Functions and Operators 1.1 http://www.w3.org/TR/2009/WD-xpath-functions-11-20091215/ XSLT and XQuery Serialization 1.1 http://www.w3.org/TR/2009/WD-xslt-xquery-serialization-11-20091215/ Jonathan From int19h at gmail.com Tue Dec 15 14:10:31 2009 From: int19h at gmail.com (Pavel Minaev) Date: Tue Dec 15 13:57:42 2009 Subject: [xquery-talk] Recursive functions and function types Message-ID: 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. From mike at saxonica.com Tue Dec 15 22:32:54 2009 From: mike at saxonica.com (Michael Kay) Date: Tue Dec 15 14:19:14 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: References: Message-ID: <0505B50C8ED248118BEF423CDDDB0014@Sealion> Does this offer a significant advantage over using a named global function when recursion is required? Is the advantage great enough to justify what appears to be significant extra complexity? If one did want to provide such a thing, I would have thought it could be done using local function declarations: named functions declared locally rather than globally, e.g. local function fib ($n as xs:integer) as xs:integer { if ($n < 3) then 1 else fib($n-1) + fib($n+2) } return fib(10) and if you want it in a variable, it's let $fib := fib#1 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 Pavel Minaev > Sent: 15 December 2009 22:11 > To: talk@x-query.com > Subject: [xquery-talk] Recursive functions and function types > > 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 From int19h at gmail.com Tue Dec 15 14:51:00 2009 From: int19h at gmail.com (Pavel Minaev) Date: Tue Dec 15 14:37:02 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: <0505B50C8ED248118BEF423CDDDB0014@Sealion> References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> Message-ID: On Tue, Dec 15, 2009 at 2:32 PM, Michael Kay wrote: > Does this offer a significant advantage over using a named global function > when recursion is required? Is the advantage great enough to justify what > appears to be significant extra complexity? I believe so. In a pure language like XQuery, recursion has to be used in any place where an imperative language would use a loop where every next iteration depends on results computed by a previous iteration. The problem with using global function definitions for that purpose is that they 1) pollute the namespace, and 2) don't capture the local environment. In practice, #2 is probably the biggest deal. I'm not talking about reusable recursive functions here, but basically something that would be written only to be immediately called somewhere inside another function, where I'd write a loop in e.g. Java. Typical example would be a function that uses accumulator-passing style for implementation, but does not wish to expose that accumulator in its public signature (as is normally the case). > If one did want to provide such a thing, I would have thought it could be > done using local function declarations: named functions declared locally > rather than globally, e.g. > > ? ? ? local function fib ($n as xs:integer) as xs:integer { > ? ? ? ? ?if ($n < 3) then 1 else fib($n-1) + fib($n+2) > ? ? ? } > ? ? ? return fib(10) Something like that would be wonderful. I'm not specifically interested in syntax details here, just the existence of a clear and straightforward way to do this. From peter.fischer at inf.ethz.ch Tue Dec 15 23:43:37 2009 From: peter.fischer at inf.ethz.ch (Peter Fischer) Date: Tue Dec 15 23:56:47 2009 Subject: [xquery-talk] Problems inserting an attribute that contains newlines In-Reply-To: References: Message-ID: <4B281119.8080907@inf.ethz.ch> On 14.12.2009 22:35, Newman, John W wrote: > Hello, Dear John, there is indeed a bug in the code for whitespace normalization and attributes. Based on your example, we could fix it internally. I can send you a patch, if you are willing to build MXQuery from source and want to minimize the changes to your current setup. Alternatively, I can point you to an internal build of MXQuery, which will contain the fix, but also other changes and new features. A new version of MXQuery is due for general release in the next weeks, and the fix will be in. Please let me know what you prefer. I am sorry for not following up your previous report in more detail, but the posting indicated that the problem was on your side, and you had solved it. Best Regards, Peter Fischer > > > We are using mxquery 0.6. A few months ago, I noticed a problem where our xquery updates were losing newlines. One of my coworkers did some testing, closed it as "not a bug, cannot reproduce", but now today I've found that the problem is still happening when inserting attributes but not replacing them (which is probably what he tested). > > > > Sample query: > > > > declare variable $source external; > > declare variable $newNote := "A note with some new lines in it."; > > > > copy $target := $source modify ( > let $targetElement := $target//; > > let $notes := $targetElement/@Notes > > return ( > > if ($notes) then ( > > replace value of node $notes with $newNote (: this works fine, new lines are preserved :) > > ) else ( > > insert nodes attribute Notes '{' $newNote '}' into $targetElement (: this loses new lines, they are replaced with a space :) > > ) > > ) > > ) > > return $target > > > > input: > > output: (incorrect, escaped new lines have been replaced with regular spaces) > > > > input: > > output: (correct, replace is OK) > > > > I've been digging through the xquery update spec for a bit but I am not finding my answer - is there an extra symbol or setting we need to preserve the new lines for an insert? Is the processor doing 'too much' normalization? I'd be happier if it wasn't modifying data on its own. =) > > > > Thanks in advance for any advice > > -John > -- Dr. Peter Fischer Systems Group/D-INFK/ETH Zurich peter.fischer@inf.ethz.ch Tel: +41/44/632 36 16 http://www.dbis.ethz.ch/people/petfisch CAB F56.1 From james.fuller.2007 at gmail.com Wed Dec 16 13:13:47 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Wed Dec 16 03:41:06 2009 Subject: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) Message-ID: XML Prague 2010 Final Call for Papers Please submit your papers for XML Prague as the CFP deadline approaches. * December 21st - End of CFP (extended abstract or full paper) * January 6th - Notification of acceptance/rejection of paper to authors * January 22nd - Final paper If you have any question regarding submission process please contact Jirka Kosek at jirka.kosek@xmlprague.cz. on behalf, XML Prague Committee ------------------------- Jim Fuller http://www.xmlprague.cz XML Prague 2010 Sponsor - MarkLogic (http://www.marklogic.com) From jonathan.robie at redhat.com Wed Dec 16 10:43:27 2009 From: jonathan.robie at redhat.com (Jonathan Robie) Date: Wed Dec 16 07:47:19 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> Message-ID: <4B29001F.6070102@redhat.com> On 12/15/2009 05:51 PM, Pavel Minaev wrote: > On Tue, Dec 15, 2009 at 2:32 PM, Michael Kay wrote: > >> If one did want to provide such a thing, I would have thought it could be >> done using local function declarations: named functions declared locally >> rather than globally, e.g. >> >> local function fib ($n as xs:integer) as xs:integer { >> if ($n< 3) then 1 else fib($n-1) + fib($n+2) >> } >> return fib(10) >> > Something like that would be wonderful. I'm not specifically > interested in syntax details here, just the existence of a clear and > straightforward way to do this. > Can't this already be done with inline functions? let $fib := function($n as xs:integer) as xs:integer { if ($n < 3) then 1 else fib($n-1) + fib($n+2) } return $fib(10) Jonathan From mike at saxonica.com Wed Dec 16 16:11:09 2009 From: mike at saxonica.com (Michael Kay) Date: Wed Dec 16 08:02:52 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: <4B29001F.6070102@redhat.com> References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> <4B29001F.6070102@redhat.com> Message-ID: > > Can't this already be done with inline functions? > > let $fib := > function($n as xs:integer) as xs:integer { > if ($n < 3) then 1 else fib($n-1) + fib($n+2) > } > return $fib(10) > No: the inner (recursive) calls to fib() would fail saying the function is undefined. Anonymous functions can't be recursive because there is no way they can refer to themselves. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From jonathan.robie at redhat.com Wed Dec 16 11:29:57 2009 From: jonathan.robie at redhat.com (Jonathan Robie) Date: Wed Dec 16 08:21:09 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> <4B29001F.6070102@redhat.com> Message-ID: <4B290B05.6080906@redhat.com> On 12/16/2009 11:11 AM, Michael Kay wrote: >> Can't this already be done with inline functions? >> >> let $fib := >> function($n as xs:integer) as xs:integer { >> if ($n< 3) then 1 else fib($n-1) + fib($n+2) >> } >> return $fib(10) >> >> > No: the inner (recursive) calls to fib() would fail saying the function is > undefined. Anonymous functions can't be recursive because there is no way > they can refer to themselves. > Hmmm, we should mention that in the spec .... Jonathan From dlee at calldei.com Wed Dec 16 11:41:59 2009 From: dlee at calldei.com (David A. Lee) Date: Wed Dec 16 08:33:13 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: <4B290B05.6080906@redhat.com> References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> <4B29001F.6070102@redhat.com> <4B290B05.6080906@redhat.com> Message-ID: <4B290DD7.1010606@calldei.com> This is a bizzare thought and ugly but how about let $fib := function($func , $n as xs:integer) as xs:integer { if ($n< 3) then 1 else $func($n-1) + $func($n+2) } return $fib($fib,10) David A. Lee dlee@calldei.com http://www.calldei.com http://www.xmlsh.org 812-482-5224 Jonathan Robie wrote: > On 12/16/2009 11:11 AM, Michael Kay wrote: >>> Can't this already be done with inline functions? >>> >>> let $fib := >>> function($n as xs:integer) as xs:integer { >>> if ($n< 3) then 1 else fib($n-1) + fib($n+2) >>> } >>> return $fib(10) >>> >>> >> No: the inner (recursive) calls to fib() would fail saying the >> function is >> undefined. Anonymous functions can't be recursive because there is no >> way >> they can refer to themselves. >> > > Hmmm, we should mention that in the spec .... > > Jonathan > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From davidc at nag.co.uk Wed Dec 16 16:44:06 2009 From: davidc at nag.co.uk (David Carlisle) Date: Wed Dec 16 08:36:01 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: <4B290B05.6080906@redhat.com> (message from Jonathan Robie on Wed, 16 Dec 2009 11:29:57 -0500) References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> <4B29001F.6070102@redhat.com> <4B290B05.6080906@redhat.com> Message-ID: <200912161644.nBGGi62h022664@edinburgh.nag.co.uk> > Hmmm, we should mention that in the spec .... or fix the defficiency rather than documenting it? David ________________________________________________________________________ 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 derhoermi at gmx.net Wed Dec 16 17:50:49 2009 From: derhoermi at gmx.net (Bjoern Hoehrmann) Date: Wed Dec 16 08:41:37 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: <4B290DD7.1010606@calldei.com> References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> <4B29001F.6070102@redhat.com> <4B290B05.6080906@redhat.com> <4B290DD7.1010606@calldei.com> Message-ID: * David A. Lee wrote: >This is a bizzare thought and ugly but how about > >let $fib := > function($func , $n as xs:integer) as xs:integer { > if ($n< 3) then 1 else $func($n-1) + $func($n+2) > } >return $fib($fib,10) Well that's not very bizarre, eventually you would arrive at the Y combinator, . -- Bj?rn H?hrmann ? mailto:bjoern@hoehrmann.de ? http://bjoern.hoehrmann.de Am Badedeich 7 ? Telefon: +49(0)160/4415681 ? http://www.bjoernsworld.de 25899 Dageb?ll ? PGP Pub. KeyID: 0xA4357E78 ? http://www.websitedev.de/ From dlee at calldei.com Wed Dec 16 11:55:30 2009 From: dlee at calldei.com (David A. Lee) Date: Wed Dec 16 08:46:31 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> <4B29001F.6070102@redhat.com> <4B290B05.6080906@redhat.com> <4B290DD7.1010606@calldei.com> Message-ID: <4B291102.2050208@calldei.com> we need a "$this" David A. Lee dlee@calldei.com http://www.calldei.com http://www.xmlsh.org 812-482-5224 Pavel Minaev wrote: > On Wed, Dec 16, 2009 at 8:41 AM, David A. Lee wrote: > >> This is a bizzare thought and ugly but how about >> >> >> >> let $fib := >> function($func , $n as xs:integer) as xs:integer { >> if ($n< 3) then 1 else $func($n-1) + $func($n+2) >> } >> return $fib($fib,10) >> > > I've mentioned this in my initial post. It works, but I don't like the > lack of type annotation on $func (and there's no way to express the > type of a function taking itself as an argument). > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20091216/6ba5e6a6/attachment.htm From int19h at gmail.com Wed Dec 16 08:54:27 2009 From: int19h at gmail.com (Pavel Minaev) Date: Wed Dec 16 08:52:47 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: <4B290DD7.1010606@calldei.com> References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> <4B29001F.6070102@redhat.com> <4B290B05.6080906@redhat.com> <4B290DD7.1010606@calldei.com> Message-ID: On Wed, Dec 16, 2009 at 8:41 AM, David A. Lee wrote: > This is a bizzare thought and ugly but how about > > > > let $fib := > ? ? function($func , ?$n as xs:integer) as xs:integer { > ? ? ? ? if ($n< ?3) then 1 else $func($n-1) + $func($n+2) > ? ? } > return $fib($fib,10) I've mentioned this in my initial post. It works, but I don't like the lack of type annotation on $func (and there's no way to express the type of a function taking itself as an argument). From int19h at gmail.com Wed Dec 16 09:06:00 2009 From: int19h at gmail.com (Pavel Minaev) Date: Wed Dec 16 08:56:49 2009 Subject: [xquery-talk] Recursive functions and function types In-Reply-To: <4B291102.2050208@calldei.com> References: <0505B50C8ED248118BEF423CDDDB0014@Sealion> <4B29001F.6070102@redhat.com> <4B290B05.6080906@redhat.com> <4B290DD7.1010606@calldei.com> <4B291102.2050208@calldei.com> Message-ID: On Wed, Dec 16, 2009 at 8:55 AM, David A. Lee wrote: > we need a "$this" This would actually be an interesting approach to this, as it would eliminate the need to bind a function to a variable altogether (since we really just want to call it right away, and the binding is only there to recurse on it). This doesn't handle mutually recursive functions, though, but then that is a much bigger issue, as it would effectively require some way to define a group of "let" or "local function" bindings that can all see each other, like OCaml "let rec ... and ... and ..." syntax. From dlee at calldei.com Wed Dec 16 13:26:34 2009 From: dlee at calldei.com (David A. Lee) Date: Wed Dec 16 10:15:50 2009 Subject: [xquery-talk] XQuery functions returning multiple element types Message-ID: <4B29265A.9030401@calldei.com> I'm trying to declare a function that can return 2 element types but with no success. Maybe its not possible. What I'd like to do is something like this (simplified) declare function search( $root as element(root) ) as element(foo|bar)* { $root//(foo|bar) }; No go ... :( I'm stuck with declare function search( $root as element(root) ) as element()* Am I missing some magic syntax to allow a function to be mulit-valued ? -David -- David A. Lee dlee@calldei.com http://www.calldei.com http://www.xmlsh.org 812-482-5224 From lists at fgeorges.org Wed Dec 16 18:31:07 2009 From: lists at fgeorges.org (Florent Georges) Date: Wed Dec 16 10:20:20 2009 Subject: [xquery-talk] XQuery functions returning multiple element types In-Reply-To: <4B29265A.9030401@calldei.com> Message-ID: <667401.64172.qm@web23003.mail.ird.yahoo.com> David A. Lee wrote: > declare function? search( $root as element(root) > )? as element(foo|bar)* Yes, that would be interesting, but that's not possible. See the production SequenceType in the spec. Regards, -- Florent Georges http://www.fgeorges.org/ From gkholman at CraneSoftwrights.com Wed Dec 16 13:32:25 2009 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Wed Dec 16 10:22:03 2009 Subject: [xquery-talk] XQuery functions returning multiple element types In-Reply-To: <4B29265A.9030401@calldei.com> References: <4B29265A.9030401@calldei.com> Message-ID: <7.0.1.0.2.20091216132839.0288f188@wheresmymailserver.com> At 2009-12-16 13:26 -0500, David A. Lee wrote: >I'm trying to declare a function that can return 2 element types but >with no success. Maybe its not possible. It is possible to have the function return them, but you can't constrain the function to validate that they are being returned. >What I'd like to do is something like this (simplified) > >declare function search( $root as element(root) ) as element(foo|bar)* >{ > $root//(foo|bar) >}; > >No go ... :( > >I'm stuck with > >declare function search( $root as element(root) ) as element()* > >Am I missing some magic syntax to allow a function to be mulit-valued ? Sequence types are used as the constraints for function declarations, and the following is not a sequence type: element(foo|bar)* A sequence type is a combination of a data type and a cardinality. So each of these are sequence types: element(foo)* and element(bar)* But you cannot combine the two and still have a sequence type. I think if you had a schema aware process and you created a user-defined type that unions the foo and bar elements, then you could create a sequence type of your user-defined type ... but I haven't got the time today to test that. 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 mike at saxonica.com Wed Dec 16 19:20:28 2009 From: mike at saxonica.com (Michael Kay) Date: Wed Dec 16 11:08:27 2009 Subject: [xquery-talk] XQuery functions returning multiple element types In-Reply-To: <4B29265A.9030401@calldei.com> References: <4B29265A.9030401@calldei.com> Message-ID: <59B53878E64E4B3D9B3849588F39EA22@Sealion> > > I'm trying to declare a function that can return 2 element > types but with no success. Maybe its not possible. If foo and bar are sufficiently related to be alternative results of the function, then perhaps they should be members of a substitution group, in which case you can say $root as schema-element(s) where s is the name of the substitution group. This becomes easier in XSD 1.1 where elements can belong to more than one substitution group. > > What I'd like to do is something like this (simplified) > > > declare function search( $root as element(root) ) as > element(foo|bar)* { Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay From dflorescu at mac.com Wed Dec 16 14:24:21 2009 From: dflorescu at mac.com (Daniela Florescu) Date: Wed Dec 16 14:06:58 2009 Subject: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) In-Reply-To: References: Message-ID: <5B737058-67D0-46EF-9A94-54914ADC89A7@mac.com> James, the conference web site says very little (close to nothing) about the fate of the submissions, which makes it difficult to contribute to. For example, how are the papers considered: are they considered publications ? are double submissions accepted ? can they resubmit their results somewhere else after that ? It would be important to know the answer to such questions, especially for students and their research contributions. Thanks, best regards Dana On Dec 16, 2009, at 4:13 AM, James Fuller wrote: > XML Prague 2010 Final Call for Papers > > Please submit your papers for XML Prague as the CFP deadline > approaches. > > * December 21st - End of CFP (extended abstract or full paper) > * January 6th - Notification of acceptance/rejection of paper to > authors > * January 22nd - Final paper > > If you have any question regarding submission process please contact > Jirka Kosek at jirka.kosek@xmlprague.cz. > > on behalf, > XML Prague Committee > > ------------------------- > Jim Fuller > http://www.xmlprague.cz > XML Prague 2010 Sponsor - MarkLogic (http://www.marklogic.com) > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From james.fuller.2007 at gmail.com Thu Dec 17 08:44:24 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Wed Dec 16 23:03:27 2009 Subject: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) In-Reply-To: <5B737058-67D0-46EF-9A94-54914ADC89A7@mac.com> References: <5B737058-67D0-46EF-9A94-54914ADC89A7@mac.com> Message-ID: On Wed, Dec 16, 2009 at 11:24 PM, Daniela Florescu wrote: > James, > > the conference web site says very little (close to nothing) about the fate > of the submissions, > which makes it difficult to contribute to. good point we will amend the site > For example, how are the papers considered: are they considered publications > ? ITI (Charlies University) publishes the proceedings by their internal pub ... I can send you pdf of last years (send me direct email)) in a pdf > are double submissions accepted ? can they resubmit their results somewhere > else after that ? sure double submissions are fine and you are free to resubmit elsewhere .... > It would be important to know the answer to such questions, especially for > students > and their research contributions. pls feel free to contact me if you have any further questions. Jim Fuller From james.fuller.2007 at gmail.com Thu Dec 17 08:46:24 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Wed Dec 16 23:05:26 2009 Subject: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) In-Reply-To: References: <5B737058-67D0-46EF-9A94-54914ADC89A7@mac.com> Message-ID: here is link to 2007 proceedings http://www.xmlprague.cz/2007/images/xmlprague2007.pdf to give you an idea. Jim Fuller From mike at saxonica.com Thu Dec 17 09:33:15 2009 From: mike at saxonica.com (Michael Kay) Date: Thu Dec 17 00:48:56 2009 Subject: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) In-Reply-To: References: <5B737058-67D0-46EF-9A94-54914ADC89A7@mac.com> Message-ID: > > 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 From dflorescu at mac.com Thu Dec 17 09:56:07 2009 From: dflorescu at mac.com (Daniela Florescu) Date: Thu Dec 17 09:44:14 2009 Subject: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) In-Reply-To: References: <5B737058-67D0-46EF-9A94-54914ADC89A7@mac.com> Message-ID: <6F8D0823-8FF2-4852-AC7B-B427C753319E@mac.com> 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 > > From oesterg at gmail.com Fri Dec 18 11:30:07 2009 From: oesterg at gmail.com (=?iso-8859-1?Q?Jens_=D8stergaard_Petersen?=) Date: Fri Dec 18 01:45:51 2009 Subject: [xquery-talk] adding elements Message-ID: <2A35B279-E0E0-4618-8653-FD6B7A6B254D@gmail.com> Hello! I am an xquery newbie - please bear over with me (for a while, at least)! Some of the elements in my file I want to duplicate in order to make some character substitutions in the duplicate (the original element contents uses diacritica and in the duplicated one the diacritica is dissolved). I can easily extract the elements and convert their contents, but how do I insert into the parent element? There are functions for adding and deleting attributes and one can "except" an element, but how does one add one? What I have is something like this: da?tahastavin?yaka and I want to get something like this (note the two , the added one with an extra attribute): da?tahastavin?yaka damtahastavinayaka but all I manage to get is something like this: da?tahastavin?yaka damtahastavinayaka Does my question make sense? And is there a way to do this? The files are from the XML output of HyperImage . Best, Jens ?stergaard Petersen University of Heidelberg From mike at saxonica.com Fri Dec 18 10:53:32 2009 From: mike at saxonica.com (Michael Kay) Date: Fri Dec 18 02:08:37 2009 Subject: [xquery-talk] adding elements In-Reply-To: <2A35B279-E0E0-4618-8653-FD6B7A6B254D@gmail.com> References: <2A35B279-E0E0-4618-8653-FD6B7A6B254D@gmail.com> Message-ID: <7E22A5FC9E9240ACB86B5B81499BFAB7@Sealion> Transformations that involve making a small change to an existing document are best handled either with XSLT, or using XQuery Update. It can be done in XQuery, but it's a lot of work in comparison with the other approaches. So the first thing is to establish whether this really has to be an XQuery solution. 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 Jens > ?stergaard Petersen > Sent: 18 December 2009 10:30 > To: talk@x-query.com > Subject: [xquery-talk] adding elements > > Hello! I am an xquery newbie - please bear over with me (for > a while, at least)! > > Some of the elements in my file I want to duplicate in order > to make some character substitutions in the duplicate (the > original element contents uses diacritica and in the > duplicated one the diacritica is dissolved). I can easily > extract the elements and convert their contents, but how do I > insert into the parent element? There are functions for > adding and deleting attributes and one can "except" an > element, but how does one add one? > > What I have is something like this: > > > > hash="a72ff5300a4e5cba7c6d58d581f7c220"/> > use="pict" width="213"/> > > > rdf:about="petal://kjc-fs2.kjc.uni-heidelberg.de:8081/HIEditor > _2.0-Service/P67/V33052" > xml:lang="en"> > da?tahastavin?yaka > > > > > > > > and I want to get something like this (note the two > , the added one with an extra attribute): > > > > hash="a72ff5300a4e5cba7c6d58d581f7c220"/> > use="pict" width="213"/> > > > rdf:about="petal://kjc-fs2.kjc.uni-heidelberg.de:8081/HIEditor > _2.0-Service/P67/V33052" > xml:lang="en"> > da?tahastavin?yaka > xml:lang="xx">damtahastavinayaka > > > > > > > > but all I manage to get is something like this: > > > > hash="a72ff5300a4e5cba7c6d58d581f7c220"/> > use="pict" width="213"/> > > > rdf:about="petal://kjc-fs2.kjc.uni-heidelberg.de:8081/HIEditor > _2.0-Service/P67/V33052" > xml:lang="en"> > da?tahastavin?yaka > > > > > > > > > > > rdf:about="petal://kjc-fs2.kjc.uni-heidelberg.de:8081/HIEditor > _2.0-Service/P67/V33052" > xml:lang="en"> > xml:lang="xx">damtahastavinayaka > > > > > > Does my question make sense? And is there a way to do this? > > The files are from the XML output of HyperImage > . > > Best, > > Jens ?stergaard Petersen > University of Heidelberg > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From wolfgang at exist-db.org Fri Dec 18 12:16:20 2009 From: wolfgang at exist-db.org (Wolfgang Meier) Date: Fri Dec 18 02:30:41 2009 Subject: [xquery-talk] adding elements In-Reply-To: <2A35B279-E0E0-4618-8653-FD6B7A6B254D@gmail.com> References: <2A35B279-E0E0-4618-8653-FD6B7A6B254D@gmail.com> Message-ID: <19f274050912180316m7c64b57cs3c2ade93e9516952@mail.gmail.com> Hi Jens, as an alternative to using XSLT or XQuery Update, my standard XQuery solution would be to create a recursive filter function with a typeswitch statement. Tested with saxon: declare namespace dc="http://purl.org/dc/elements/1.1/"; declare variable $xml := da?tahastavin?yaka ; declare function local:modify($title as element(dc:title)) { {$title/text()} }; declare function local:filter($node as node()) { typeswitch ($node) case element(dc:title) return ($node, local:modify($node)) case element() return element { node-name($node) } { $node/@*, for $child in $node/node() return local:filter($child) } default return $node }; local:filter($xml) Wolfgang From james.fuller.2007 at gmail.com Fri Dec 18 20:48:58 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Fri Dec 18 11:32:56 2009 Subject: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) In-Reply-To: <6F8D0823-8FF2-4852-AC7B-B427C753319E@mac.com> References: <5B737058-67D0-46EF-9A94-54914ADC89A7@mac.com> <6F8D0823-8FF2-4852-AC7B-B427C753319E@mac.com> Message-ID: 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. let me try to be clear and respond in an official capacity. > 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 answer to this is a) ... with all the usual caveats (e.g. that the pub does not invalidate someone else's copyright, which is the Authors responsibility). > 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...]] its a) > [[ and unfortunately, being published "on the Web" can be interpreted either > way...]] XML Prague is affiliated with Charles University/ITI and takes such questions seriously so I will also get an official statement repeating what I have said directly from the University (and the press that publishes the proceedings) to confirm and amend the website accordingly. Previous proceedings were less clear then they could have been, thank you for pointing this out and know that next years will be crystal clear on this point. Jim Fuller on behalf of the XML Prague Committee From james.fuller.2007 at gmail.com Tue Dec 22 18:27:49 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Tue Dec 22 09:23:50 2009 Subject: Follow Up Re: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) Message-ID: 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 >> >> > > From dflorescu at mac.com Wed Dec 23 09:24:36 2009 From: dflorescu at mac.com (daniela florescu) Date: Wed Dec 23 09:20:38 2009 Subject: Follow Up Re: [xquery-talk] [ANN] XML Prague 2010 Final Call for Participation (CFP) In-Reply-To: References: Message-ID: <9B1EC664-16FB-46D3-93B8-DDEF166B7EED@mac.com> Dear James, thank you for the clarification. This answers my question. Best regards, looking forward to an interesting conference in Prague ! Dana On Dec 22, 2009, at 9:27 AM, James Fuller wrote: > 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