From mike at saxonica.com Tue Dec 3 01:41:10 2013 From: mike at saxonica.com (Michael Kay) Date: Tue, 3 Dec 2013 09:41:10 +0000 Subject: [xquery-talk] map module for XQUERY ? In-Reply-To: References: <528C8696.3050306@marklogic.com> <528CA424.4000003@marklogic.com> <528CBD92.9080109@marklogic.com> <1B0CC16A-B5EE-41D2-BCD5-4AAA6480AA5C@saxonica.com> Message-ID: > > It seems that this is due to the fact that XQUERY lacks of a container for doubly chained lists. At my knowledge, the only container available for set of items are sequences. And creating a sequence in XQUERY have a quadratic complexity in sequence length with all the interpreters I've tried... > Saxon tries quite hard to achieve incremental sequence construction with linear time complexity, but it does depend on your using coding patterns that the optimizer recognizes. Michael Kay Saxonica From john.snelson at marklogic.com Tue Dec 3 03:31:04 2013 From: john.snelson at marklogic.com (John Snelson) Date: Tue, 03 Dec 2013 11:31:04 +0000 Subject: [xquery-talk] map module for XQUERY ? In-Reply-To: References: <528CA424.4000003@marklogic.com> <528CBD92.9080109@marklogic.com> <1B0CC16A-B5EE-41D2-BCD5-4AAA6480AA5C@saxonica.com> <186B16BD-A2CA-4313-8085-525232281024@saxonica.com> Message-ID: <529DC0F8.80709@marklogic.com> On 03/12/13 11:27, jean-marc Mercier wrote: > > XQuery comes from the world of database > I understand this point. From another side, it could be used to write > complex algorithmic : I found this language very handy to that purpose, > because it is a functional language, it is incredibly data flexible, and > template programming is straightforward. Provided basic containers were > added, the community could enrich this language with external modules, > best among them could in turn feed the standardization process. At > present time, as far as I understand, the only way to write a serious > algorithm is to bind XQUERY with an external imperative language, that > is not really a good solution. You can create a simple linked list using a cons cell: declare function local:cons($head,$tail) { function() { $head, $tail } }; declare function local:to-list($seq) { if(empty($seq)) then () else local:cons(head($seq),local:to-list(tail($seq))) }; John -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From christian.gruen at gmail.com Tue Dec 3 03:37:48 2013 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Tue, 3 Dec 2013 12:37:48 +0100 Subject: [xquery-talk] map module for XQUERY ? In-Reply-To: References: <528C8696.3050306@marklogic.com> <528CA424.4000003@marklogic.com> <528CBD92.9080109@marklogic.com> <1B0CC16A-B5EE-41D2-BCD5-4AAA6480AA5C@saxonica.com> Message-ID: Hi Jean-Marc, > To report over this topic, I've written in XQUERY a Map that have the > desired properties, rewriting John Snelson rbtree.xq > - It can handle nodes or functions as keys, if of course the user provides > its external ordering function, this point being left under the user > responsibility. > - It can remove nodes. > > However, it suffers from performance issues : creating a map is quadratic > (n^2) in map length (n), to be compared to n log_2(n) complexity for a > normal red / black tree insertion. I can only speculate, because we haven?t seen your implementation, but I am wondering why you didn?t take advantage of John?s existing $lessthan function argument in order to compare all kinds of items? > Maps (even immutable ones like Phil's Bagwell) are indeed implemented > using stacks as far as I know. When talking about stacks, do you refer to dynamic arrays (which are downsized when entries are deleted)? There are lots of ways how you can implement maps. On a low level, it?s possible to store all kinds of data structures in arrays (on machine level, it?s the only choice you have), but that?s the imperative way of thinking. The functional language paradigm is completely different: here, you live in an immutable world which does not allow you to modify existing data. However, the existence of immutable maps, finger trees or John?s tree demonstrates on the one hand that it?s possible to build efficient data structures with functional languages and, on the other hand, that conventional maps and arrays will not cover the requirements of functional languages. Maybe the most important thing here is: It takes *time* to get into the functional way of thinking (Okasaki?s book on Functional Data Structures may a good start). If you prefer more straightforward solutions, or if you really want to get 100% performance, a functional language may not be the best tool (well, some people may object..). Christian From john.snelson at marklogic.com Tue Dec 3 04:32:05 2013 From: john.snelson at marklogic.com (John Snelson) Date: Tue, 03 Dec 2013 12:32:05 +0000 Subject: [xquery-talk] map module for XQUERY ? In-Reply-To: References: <528CBD92.9080109@marklogic.com> <1B0CC16A-B5EE-41D2-BCD5-4AAA6480AA5C@saxonica.com> <186B16BD-A2CA-4313-8085-525232281024@saxonica.com> <529DC0F8.80709@marklogic.com> Message-ID: <529DCF45.1030701@marklogic.com> On 03/12/13 12:17, jean-marc Mercier wrote: > > You can create a simple linked list using a cons cell: > > @John : Right, but you will always have quadratic complexity in length > creating the sequence $seq. Not always. But that was just example code - don't create it from a sequence. > >I can only speculate, because we haven?t seen your implementation, but >> I am wondering why you didn?t take advantage of John?s existing> >> $lessthan function argument in order to compare all kinds of items? > > @ Christian. Indeed, I realized after profiling my rewriting of John > code that its code implementation has also a quadratic complexity in > sequence length. John, as I, need at a point to allocate memory for > writing this tree implementation. If we want to stay pure xquery, this > will be done with quadratic complexity in length, at least I can't see > any work around to that. My red/black tree implementation only ever uses sequences of length 4, which will therefore have a constant cost to create (in the size of the red/black tree). John -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From inpost at gmail.com Mon Dec 9 15:41:54 2013 From: inpost at gmail.com (e-letter) Date: Mon, 9 Dec 2013 23:41:54 +0000 Subject: [xquery-talk] xquery technology now ready? Message-ID: Readers, Can xquery be used for the following scenario: a "database" (originally from 'w3schools' web site) Everyday Italian Giada De Laurentiis 2005 30.00 Harry Potter J K. Rowling 2005 29.99 Can an xhtml web page be created with a html form to select a book title from a menu list, then display the full details of the book in another xhtml web page, using xquery? web page 1: select title Harry Potter web page 2 result: Harry Potter J K. Rowling 2005 29.99 What software (if any) needs to be installed for the xml documents to be processed on a standard linux web server? From liam at w3.org Mon Dec 9 23:10:33 2013 From: liam at w3.org (Liam R E Quin) Date: Tue, 10 Dec 2013 02:10:33 -0500 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: Message-ID: <1386659433.26783.118.camel@slave.barefootcomputing.com> On Mon, 2013-12-09 at 23:41 +0000, e-letter wrote: > Readers, > > Can xquery be used for the following scenario: [...] > Can an xhtml web page be created with a html form to select a book > title from a menu list, then display the full details of the book in > another xhtml web page, using xquery?[...] > What software (if any) needs to be installed for the xml documents to > be processed on a standard linux web server? For a catalogue of any size you'll probably want to send only the matching entries to the Web browser/client, so you'll want to run XQuery on the server. There are maybe a dozen reasonably popular choices. I use BaseX (Java-based) on www.fromoldbooks.org; Zorba (C++) seemed to me to be somewhat harder to set up but then BaseX is particularly easy. There's also an Apache module called sedna, and a stand-alone database server called eXist; there are commercial offerings from Microsoft, Oracle, IBM, MarkLogic and many more. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ W3C staff contact for the XQuery Working Group From mike at saxonica.com Tue Dec 10 02:26:14 2013 From: mike at saxonica.com (Michael Kay) Date: Tue, 10 Dec 2013 10:26:14 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: Message-ID: XQuery can certainly be used for this, but it won't do the whole job. You also need some kind of framework that accepts HTTP requests from the browser and invokes the necessary query with the right parameters. An example of such a framework which we use within Saxonica is servlex (servlex.net). Michael Kay Saxonica On 9 Dec 2013, at 23:41, e-letter wrote: > Readers, > > Can xquery be used for the following scenario: > > a "database" (originally from 'w3schools' web site) > > > > > > > Everyday Italian > Giada De Laurentiis > 2005 > 30.00 > > > Harry Potter > J K. Rowling > 2005 > 29.99 > > > > Can an xhtml web page be created with a html form to select a book > title from a menu list, then display the full details of the book in > another xhtml web page, using xquery? > > web page 1: > select title Harry Potter > > web page 2 result: > Harry Potter > J K. Rowling > 2005 > 29.99 > > What software (if any) needs to be installed for the xml documents to > be processed on a standard linux web server? > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From msokolov at safaribooksonline.com Tue Dec 10 05:03:07 2013 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Tue, 10 Dec 2013 08:03:07 -0500 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: Message-ID: <52A7110B.5010503@safaribooksonline.com> On 12/9/2013 6:41 PM, e-letter wrote: > > Can an xhtml web page be created with a html form to select a book > title from a menu list, then display the full details of the book in > another xhtml web page, using xquery? > You could use Lux, which is based on XQuery and comes with an application server, search index, and data store: http://luxdb.org -Mike From adam.retter at googlemail.com Tue Dec 10 05:41:13 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Tue, 10 Dec 2013 13:41:13 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: <52A7110B.5010503@safaribooksonline.com> References: <52A7110B.5010503@safaribooksonline.com> Message-ID: Yes, that is absolutely possible using XQuery. Normally you also need to have some sort of web-server in there that is executing your XQuery and generating XHTML. There are several available, the most popular that I am aware of are: http://www.exist-db.org http://www.basex.org http://www.28msec.com http://www.marklogic.com Disclaimer - I am a contributor to eXist-db. eXist-db and BaseX are both open source. 28msec is a commercial cloud offering and Marklogic is a commercial offering. On 10 December 2013 13:03, Michael Sokolov wrote: > On 12/9/2013 6:41 PM, e-letter wrote: >> >> >> Can an xhtml web page be created with a html form to select a book >> title from a menu list, then display the full details of the book in >> another xhtml web page, using xquery? >> > You could use Lux, which is based on XQuery and comes with an application > server, search index, and data store: http://luxdb.org > > -Mike > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk From inpost at gmail.com Tue Dec 10 06:16:23 2013 From: inpost at gmail.com (e-letter) Date: Tue, 10 Dec 2013 14:16:23 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: <1386659433.26783.118.camel@slave.barefootcomputing.com> References: <1386659433.26783.118.camel@slave.barefootcomputing.com> Message-ID: On 10/12/2013, Liam R E Quin wrote: > > For a catalogue of any size you'll probably want to send only the > matching entries to the Web browser/client, so you'll want to run XQuery > on the server. > >From all the recommendations, is it correct to assume that a dedicated web server will need to be used, where permissions are provided to install these various software products? Or, are there any (cheap) web hosts that have these xquery functionalities already installed on their servers? If these server software are not readily provided by cheap web host suppliers, isn't it easier to use postgresql and php which is more likely to available from existing low cost web host suppliers? Whilst xquery seems interesting, for a personal learning project having to pay for a dedicated server is expected to be too expensive. From mike at saxonica.com Tue Dec 10 06:38:46 2013 From: mike at saxonica.com (Michael Kay) Date: Tue, 10 Dec 2013 14:38:46 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> Message-ID: > > From all the recommendations, is it correct to assume that a dedicated > web server will need to be used, where permissions are provided to > install these various software products? > > Or, are there any (cheap) web hosts that have these xquery > functionalities already installed on their servers? > It doesn't have to be a web server dedicated to the one application, but you are right that if you choose a bog-standard cheap hosting provider then you are often restricted to the software that they decide to let you use, which will often be a very limited choice. Michael Kay Saxonica From dlee at calldei.com Tue Dec 10 06:49:56 2013 From: dlee at calldei.com (David Lee) Date: Tue, 10 Dec 2013 14:49:56 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> Message-ID: <1262a2502e5b45f293b4b54b4cb418ac@BY2PR08MB014.namprd08.prod.outlook.com> If cost is the driving factor and your website is small, you could consider Amazon or Google Compute. On Amazon you can have a "t1.micro" instance at 2 cents/hour or half that if you pre-pay for a year or more. This instance type has enough capacity for a small web server and associated technology. It does not have enough capacity for some of the more enterprise scale XML databases but those are designed for more demanding needs. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of e-letter Sent: Tuesday, December 10, 2013 9:16 AM To: liam at w3.org Cc: talk at x-query.com Subject: Re: [xquery-talk] xquery technology now ready? On 10/12/2013, Liam R E Quin wrote: > > For a catalogue of any size you'll probably want to send only the > matching entries to the Web browser/client, so you'll want to run XQuery > on the server. > >From all the recommendations, is it correct to assume that a dedicated web server will need to be used, where permissions are provided to install these various software products? Or, are there any (cheap) web hosts that have these xquery functionalities already installed on their servers? If these server software are not readily provided by cheap web host suppliers, isn't it easier to use postgresql and php which is more likely to available from existing low cost web host suppliers? Whilst xquery seems interesting, for a personal learning project having to pay for a dedicated server is expected to be too expensive. _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From christian.gruen at gmail.com Tue Dec 10 07:06:28 2013 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Tue, 10 Dec 2013 16:06:28 +0100 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> Message-ID: > From all the recommendations, is it correct to assume that a dedicated > web server will need to be used, where permissions are provided to > install these various software products? If you simply want to learn the language, there is no need to look out for professional hosting solutions. Some XQuery implementations come with their own web server code, and they are often pretty light-weight (and can also be run locally). As Adam indicated, if you are looking for open source solutions, you could have a look at BaseX (disclaimer: I?m contributing to this project), or eXist-db, which are both easy to install, and check out the included examples. By the way, if you only want to create xhtml pages and e.g. store them in a file, no web server is required at all (this may be obvious anyway). Hope this helps, Christian > Or, are there any (cheap) web hosts that have these xquery > functionalities already installed on their servers? > > If these server software are not readily provided by cheap web host > suppliers, isn't it easier to use postgresql and php which is more > likely to available from existing low cost web host suppliers? > > Whilst xquery seems interesting, for a personal learning project > having to pay for a dedicated server is expected to be too expensive. From inpost at gmail.com Wed Dec 11 06:27:53 2013 From: inpost at gmail.com (e-letter) Date: Wed, 11 Dec 2013 14:27:53 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> Message-ID: On 10/12/2013, Christian Gr?n wrote: >> From all the recommendations, is it correct to assume that a dedicated >> web server will need to be used, where permissions are provided to >> install these various software products? > > If you simply want to learn the language, there is no need to look out > for professional hosting solutions. Some XQuery implementations come > with their own web server code, and they are often pretty light-weight > (and can also be run locally). As Adam indicated, if you are looking > for open source solutions, you could have a look at BaseX (disclaimer: > I?m contributing to this project), or eXist-db, which are both easy to > install, and check out the included examples. > The problem with the general lack of widespread deployment of xquery is a risk of disappointment similar to xforms. I would like to learn xquery with the knowledge that practical deployment is possible and cost effective; otherwise the technology doesn't seem ready yet and so sql database + sever script language remains the option. From mike at saxonica.com Wed Dec 11 06:50:25 2013 From: mike at saxonica.com (Michael Kay) Date: Wed, 11 Dec 2013 14:50:25 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> Message-ID: > > The problem with the general lack of widespread deployment of xquery > is a risk of disappointment similar to xforms. I would like to learn > xquery with the knowledge that practical deployment is possible and > cost effective; otherwise the technology doesn't seem ready yet and so > sql database + sever script language remains the option. > And presumably you don't think the car's time has come yet, because travelling by bus is so much cheaper. Michael Kay Saxonica From dlee at calldei.com Wed Dec 11 06:55:21 2013 From: dlee at calldei.com (David Lee) Date: Wed, 11 Dec 2013 14:55:21 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> Message-ID: <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> Xquery is quite mature and robust and there are many solutions available both as Open Source and Commercial in all price ranges from free to very expensive. Much like the RDBMS world where you can get sqlite through Oracle ... and nearly everything in between It is important to realize that 100% "pure XQuery" is not sufficient to build a web application, you also need a web server or application server. Either one which comes with a pre integrated XQuery product or one which you add XQuery to. Now the question of "cost effective" is subjective. Clearly the software has to run on something ... and that something is never free. If you are asking specifically about hosting services where they provide all the infrastructure including the web server then you may be hard pressed to find one that is XQuery capable. However if you host your own server (such as on Amazon where for at least the first year, there is a "Free Tier" which is sufficient for small web servers) the out of pocket expense can be literally zero. And after the first year a reasonable web server can be run for a low price. For example I run my personal web site along with about a dozen others including xmlsh.org on a "m1.small" instance on amazon and total cost including storage runs me about $30 / month. This includes 100G of storage I use for my personal photo site. A t1.micro site will cost you about $15/month on demand pricing or about $8/month if you prepay. Google Compute just made it to public so it's another choice but I have not done cost analysis on it yet. Only you can tell if this is in your budget, but it seems reasonably low cost to me. (compare to the typical "cup of coffee" metric ... 2 - 5 cups of Starbucks / month will get you a fully functioning virtual host) As you work up the scale of both size of web site, necessary hardware, and especially dont neglect support or more advanced services then you will have to pay something for it. Sometimes that is paying in your time or paying someone else's time. Also depending on what application and data you are working on, XQuery may or may not be the easiest or "best" fit for the whole enchilada. For myself, for example, I am a very strong and vocal XQuery advocate and work for a company that produces an XQuery product, but when I build my own web apps I frequently use XQuery at the data base layer for a multi-tier solution, much like I would use MySQL for the database. You can, and I have personally, produced quite good web applications 100% in XQuery ... but it isn't the only reasonable route to take. Another reasonable route is to use an app server like Tomcat or JBoss and then use XQuery "on the back end" to handle the database and heavy transformation, but leave the presentation layer to the application server. The choice is yours. The solutions are plentiful ... it's a rainbow of solutions not black & white. What approach works "best" or even "reasonably good" for you may vary dramatically from others or even yourself. But I can assert with reasonable authority that there is a wide variety of quality XQuery implementations to choose from in the price range from Budget to Gourmet. And *unlike* XForms ... XQuery does not have to solve the GUI problem. It can, but It can also be used in conjunction with other front end tools, or can be used all by itself (in a XQuery implementation which supports application servers). ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of e-letter Sent: Wednesday, December 11, 2013 9:28 AM To: Christian Gr?n Cc: Liam Quin; talk at x-query.com Subject: Re: [xquery-talk] xquery technology now ready? On 10/12/2013, Christian Gr?n wrote: >> From all the recommendations, is it correct to assume that a dedicated >> web server will need to be used, where permissions are provided to >> install these various software products? > > If you simply want to learn the language, there is no need to look out > for professional hosting solutions. Some XQuery implementations come > with their own web server code, and they are often pretty light-weight > (and can also be run locally). As Adam indicated, if you are looking > for open source solutions, you could have a look at BaseX (disclaimer: > I?m contributing to this project), or eXist-db, which are both easy to > install, and check out the included examples. > The problem with the general lack of widespread deployment of xquery is a risk of disappointment similar to xforms. I would like to learn xquery with the knowledge that practical deployment is possible and cost effective; otherwise the technology doesn't seem ready yet and so sql database + sever script language remains the option. _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From CMisztur at macleanfogg.com Wed Dec 11 07:03:50 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Wed, 11 Dec 2013 15:03:50 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> , Message-ID: <9439192E-A289-415D-A38C-8A0353D51CAC@macleanfogg.com> For me it is what fits right now and xquery fits perfectly. Can you describe practical and cost effective? -c On Dec 11, 2013, at 8:31 AM, "e-letter" wrote: > On 10/12/2013, Christian Gr?n wrote: >>> From all the recommendations, is it correct to assume that a dedicated >>> web server will need to be used, where permissions are provided to >>> install these various software products? >> >> If you simply want to learn the language, there is no need to look out >> for professional hosting solutions. Some XQuery implementations come >> with their own web server code, and they are often pretty light-weight >> (and can also be run locally). As Adam indicated, if you are looking >> for open source solutions, you could have a look at BaseX (disclaimer: >> I?m contributing to this project), or eXist-db, which are both easy to >> install, and check out the included examples. >> > > The problem with the general lack of widespread deployment of xquery > is a risk of disappointment similar to xforms. I would like to learn > xquery with the knowledge that practical deployment is possible and > cost effective; otherwise the technology doesn't seem ready yet and so > sql database + sever script language remains the option. > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From CMisztur at macleanfogg.com Wed Dec 11 07:22:41 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Wed, 11 Dec 2013 15:22:41 +0000 Subject: [xquery-talk] Functional paradigm shift Message-ID: <1687C53F-CAE6-4465-A019-C4733D937C06@macleanfogg.com> Is there a good book out there that can help shift my coding style from .NET to a functional language? For example I am doing this a lot: let $result := some-func() let $a := if($result eq 0) then() else(logger:log($result),error()) It just doesn't feel right. -c ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From inpost at gmail.com Wed Dec 11 08:11:58 2013 From: inpost at gmail.com (e-letter) Date: Wed, 11 Dec 2013 16:11:58 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: <9439192E-A289-415D-A38C-8A0353D51CAC@macleanfogg.com> References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <9439192E-A289-415D-A38C-8A0353D51CAC@macleanfogg.com> Message-ID: On 11/12/2013, Misztur, Chris wrote: > For me it is what fits right now and xquery fits perfectly. > > Can you describe practical and cost effective? > A web host service provider has advertised a service less than US$ 2 per month, which features the range standard web host tools, in this case an sql database and web server script language So being technology agnostic, whilst xquery and xml technologies are interesting per se for a novice who has negligible prior knowledge, learning sql and php would suffice for the personal objective, creating a simple web site where information in a database can be viewed in a web page. Xforms is a great concept, but if it doesn't work with opera, or firefox or another w3-compliant browser, its advantage is lost. Excuse my ignorance of the web host market, but if it was possible for a customer to say to a US$ 2 supplier "please install [xquery web server software name] and I'll use your service", I'd sign up and be more likely to learn xquery. From what others have written so far, the market state now seems a bit pre-mature. From inpost at gmail.com Wed Dec 11 08:21:20 2013 From: inpost at gmail.com (e-letter) Date: Wed, 11 Dec 2013 16:21:20 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On 11/12/2013, David Lee wrote: > > But I can assert with reasonable authority that there is a wide variety of > quality XQuery implementations to choose from in the price range from Budget > to Gourmet. > And *unlike* XForms ... XQuery does not have to solve the GUI problem. It > can, but It can also be used in conjunction with other front end tools, or > can be used all by itself (in a XQuery implementation which supports > application servers). > Useful opinion, thanks, but your comment prompts the following personal conclusion: xforms was/is hampered by insufficient web browser support; xquery by insufficient web server (standard hosting supplier) support. From dlee at calldei.com Wed Dec 11 09:16:12 2013 From: dlee at calldei.com (David Lee) Date: Wed, 11 Dec 2013 17:16:12 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> ========== Useful opinion, thanks, but your comment prompts the following personal conclusion: xforms was/is hampered by insufficient web browser support; xquery by insufficient web server (standard hosting supplier) support. =========== Not all technologies get adopted by everyone. . I dont know exactly (but I do know *roughly*) by what you mean by "standard hosting supplier" - ie. those that sell the cheapest "web site hosting" possible to the most people. I dont agree that means "hampered" ... it just means " vastly availble for nearly nothing" and if that is your most important criteria go for it. It is generally a circular problem ... If you want a *free xquery* hosting provider you can get one today from Amazon for 1 year using their free tier support. After that ... if $2/month vs $7/month is your most important concern then xquery isnt for you. Browser support is a problem for XForms (although I belive there are versions which dont require browser support) Browser support is a non-issue for XQuery - it is browser agnostic. If you want the absolutely dirt cheapest "solution" go with a free service like most major providers will give you for free (bloggger etc). you wont get XQuery or even mysql or PHP but you will get a "web site" for "free" (typically "free" means your web site will have ads on it). If cost is your major concern and $2/month vs $7/month is the key factor in your decision on what technology you want to learn and use then go with the cheapest. But making claims about technology viability by quoting the bare minimum low end just isn't something you will get great resounding agreement with on this list. XQuery can be had for free. Convincing budget low end web hosting providers to provide it may take a while if ever. Convincing Browser vendors to build it into their browser (let alone XSLT 2.0 or 3.0 ) ... well I am not holding my breath. but none of this has to do with the maturity or quality of technology. As Michael Key said so elegantly, I will paraphrase, if your #1 issue is cost, ride the bus. Or walk for that matter. There is nothing wrong with that, but you will have a hard time convincing car drivers and manufacturers that means that cars are not viable. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org From adam.retter at googlemail.com Wed Dec 11 10:02:31 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 11 Dec 2013 18:02:31 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> Message-ID: Amazon EC2 have a free tier for a year and eXist can be installed on there and runs fine if your database is not too big. On 10 Dec 2013 14:18, "e-letter" wrote: > On 10/12/2013, Liam R E Quin wrote: > > > > For a catalogue of any size you'll probably want to send only the > > matching entries to the Web browser/client, so you'll want to run XQuery > > on the server. > > > > From all the recommendations, is it correct to assume that a dedicated > web server will need to be used, where permissions are provided to > install these various software products? > > Or, are there any (cheap) web hosts that have these xquery > functionalities already installed on their servers? > > If these server software are not readily provided by cheap web host > suppliers, isn't it easier to use postgresql and php which is more > likely to available from existing low cost web host suppliers? > > Whilst xquery seems interesting, for a personal learning project > having to pay for a dedicated server is expected to be too expensive. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From CMisztur at macleanfogg.com Wed Dec 11 11:56:44 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Wed, 11 Dec 2013 19:56:44 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <9439192E-A289-415D-A38C-8A0353D51CAC@macleanfogg.com> Message-ID: <7AC1D93CF590E5458FCE12A1306063570E6DDF7E@us09exm01.MacLean-Fogg.com> I would say the learning curve for MySQL and PHP would be much higher than learning XQuery. Whichever way you go, you'll still need to learn HTML, JavaScript, JQuery and other JS frameworks to build a pretty site. -c Chris Misztur | Engineer, Business Systems 1000 Allanson Rd, Mundelein, IL 60060 (Map) Office +1 847 837-3729 | Cell +1 312 504-0681 www.macleanfoggcs.com -----Original Message----- From: e-letter [mailto:inpost at gmail.com] Sent: Wednesday, December 11, 2013 10:12 AM To: Misztur, Chris Cc: Christian Gr?n; Liam Quin; talk at x-query.com Subject: Re: [xquery-talk] xquery technology now ready? On 11/12/2013, Misztur, Chris wrote: > For me it is what fits right now and xquery fits perfectly. > > Can you describe practical and cost effective? > A web host service provider has advertised a service less than US$ 2 per month, which features the range standard web host tools, in this case an sql database and web server script language So being technology agnostic, whilst xquery and xml technologies are interesting per se for a novice who has negligible prior knowledge, learning sql and php would suffice for the personal objective, creating a simple web site where information in a database can be viewed in a web page. Xforms is a great concept, but if it doesn't work with opera, or firefox or another w3-compliant browser, its advantage is lost. Excuse my ignorance of the web host market, but if it was possible for a customer to say to a US$ 2 supplier "please install [xquery web server software name] and I'll use your service", I'd sign up and be more likely to learn xquery. From what others have written so far, the market state now seems a bit pre-mature. ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From inpost at gmail.com Wed Dec 11 12:01:49 2013 From: inpost at gmail.com (e-letter) Date: Wed, 11 Dec 2013 20:01:49 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On 11/12/2013, David Lee wrote: > If you want a *free xquery* hosting provider you can get one today from > Amazon for 1 year using their free tier support. A brief look at amazon suggests that I could (assuming correct comprehension!) create a linux web server virtual image and export to amazon to host and make public, free for a year. It is during the creation of the linux web server image that the necessary xquery server software can be installed. > Convincing budget low end web hosting providers to provide it may take a > while if ever. I don't understand this (being ignorant of the web host market, admittedly). If a gnu gpl xquery server software exists why would they be reluctant to add this to their service if a customer demands and pays for it? > > As Michael Key said so elegantly, I will paraphrase, if your #1 issue is > cost, ride the bus. Or walk for that matter. > Consider the question of cost as being "devil's advocate"; it seems that the price of using xquery is at least 3x a more prevalent sql & server script system, but of course there's more to decision making than "ticket price" comparisons...Anyway this has proven to be a useful discussion and fascinating to learn that amazon is more than a mere book-seller! From dk at basex.org Wed Dec 11 13:00:27 2013 From: dk at basex.org (Dirk Kirsten) Date: Wed, 11 Dec 2013 22:00:27 +0100 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <52A8D26B.2030904@basex.org> >> Convincing budget low end web hosting providers to provide it may take a >> while if ever. > > I don't understand this (being ignorant of the web host market, > admittedly). If a gnu gpl xquery server software exists why would they > be reluctant to add this to their service if a customer demands and > pays for it? I guess because you are discussing 2$ web hosts. And if you pay 2$, do you really expect any service at all? So you would need to have an actual human being (who is paid, and I guess a bit more than 2 dollars an hour) to do something for you. I am sure if you are willing to pay a reasonable price for it, most web hosts will install all kinds of software for you. It is just not the price range you are talking about. Cheers, Dirk -- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Gesch?ftsf?hrer: | Dr. Christian Gr?n, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 From liam at w3.org Wed Dec 11 13:56:39 2013 From: liam at w3.org (Liam R E Quin) Date: Wed, 11 Dec 2013 16:56:39 -0500 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <1386798999.9506.26.camel@slave.barefootcomputing.com> On Wed, 2013-12-11 at 20:01 +0000, e-letter wrote: > I don't understand this (being ignorant of the web host market, > admittedly). If a gnu gpl xquery server software exists why would they > be reluctant to add this to their service if a customer demands and > pays for it? The most popular ones are written in Java, and use more memory and CPU than the Web hosting companies want to allocate to a shared host. There also tends to be a distrust of Java-based software in Free software communities. > Consider the question of cost as being "devil's advocate"; it seems > that the price of using xquery is at least 3x a more prevalent sql & > server script system, I don't think that's necessarily true. For example, apache with zorba and PHP is a Java-free zero-dollar open-source alternative. You can also run XQuery systems alongside MySQL quite happily, accessing relational data as well as XML hierarchical data from XQuery. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml From adam.retter at googlemail.com Wed Dec 11 14:26:58 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 11 Dec 2013 22:26:58 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: I would be happy to configure a Amazon EC2 instance running eXist for you, if that helps? On 11 Dec 2013 20:03, "e-letter" wrote: > On 11/12/2013, David Lee wrote: > > If you want a *free xquery* hosting provider you can get one today from > > Amazon for 1 year using their free tier support. > > A brief look at amazon suggests that I could (assuming correct > comprehension!) create a linux web server virtual image and export to > amazon to host and make public, free for a year. It is during the > creation of the linux web server image that the necessary xquery > server software can be installed. > > > Convincing budget low end web hosting providers to provide it may take a > > while if ever. > > I don't understand this (being ignorant of the web host market, > admittedly). If a gnu gpl xquery server software exists why would they > be reluctant to add this to their service if a customer demands and > pays for it? > > > > > As Michael Key said so elegantly, I will paraphrase, if your #1 issue is > > cost, ride the bus. Or walk for that matter. > > > > Consider the question of cost as being "devil's advocate"; it seems > that the price of using xquery is at least 3x a more prevalent sql & > server script system, but of course there's more to decision making > than "ticket price" comparisons...Anyway this has proven to be a > useful discussion and fascinating to learn that amazon is more than a > mere book-seller! > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inpost at gmail.com Wed Dec 11 14:31:04 2013 From: inpost at gmail.com (e-letter) Date: Wed, 11 Dec 2013 22:31:04 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On 11/12/2013, Adam Retter wrote: > I would be happy to configure a Amazon EC2 instance running eXist for you, > if that helps? Thank you for the offer, but for now am still undecided what to do! :) From gkholman at CraneSoftwrights.com Wed Dec 11 14:34:40 2013 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Wed, 11 Dec 2013 17:34:40 -0500 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <7.0.1.0.2.20131211173029.0246e478@wheresmymailserver.com> At 2013-12-11 22:26 +0000, Adam Retter wrote: >I would be happy to configure a Amazon EC2 instance running eXist >for you, if that helps? I'm an EC2 user and I would find a summary list of instructions very useful, as would I'm sure many others on this list. Could I impose on you, please, to itemize the instructions for all to follow? And thinking about this from a student's perspective, can anyone on this list identify publicly-available sources of XML content to load up on the eXist instance so that when the itemized instructions are complete that anyone would be able to run example scripts against the installed dataset? I'll contribute some sample scripts once I see what data is available to upload onto the server. Thank you, Adam! . . . . . . . . Ken -- Public XSLT, XSL-FO, UBL & code list classes: Melbourne, AU May 2014 | Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ | G. Ken Holman mailto:gkholman at CraneSoftwrights.com | Google+ profile: https://plus.google.com/116832879756988317389/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal | From CMisztur at macleanfogg.com Wed Dec 11 14:40:25 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Wed, 11 Dec 2013 22:40:25 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: <7.0.1.0.2.20131211173029.0246e478@wheresmymailserver.com> References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> , <7.0.1.0.2.20131211173029.0246e478@wheresmymailserver.com> Message-ID: <7AC1D93CF590E5458FCE12A1306063570E6DE4E7@us09exm01.MacLean-Fogg.com> I got an instance of eXist running on nitrous.io. Nothing out of the ordinary. Headless installation and then start "bin/startup.sh &" on a 'screens' session to prevent it from dying. Could use the Shakespeare data in eXist. -c ________________________________________ From: talk-bounces at x-query.com [talk-bounces at x-query.com] on behalf of G. Ken Holman [gkholman at cranesoftwrights.com] Sent: Wednesday, December 11, 2013 4:34 PM To: talk at x-query.com Subject: Re: [xquery-talk] xquery technology now ready? At 2013-12-11 22:26 +0000, Adam Retter wrote: >I would be happy to configure a Amazon EC2 instance running eXist >for you, if that helps? I'm an EC2 user and I would find a summary list of instructions very useful, as would I'm sure many others on this list. Could I impose on you, please, to itemize the instructions for all to follow? And thinking about this from a student's perspective, can anyone on this list identify publicly-available sources of XML content to load up on the eXist instance so that when the itemized instructions are complete that anyone would be able to run example scripts against the installed dataset? I'll contribute some sample scripts once I see what data is available to upload onto the server. Thank you, Adam! . . . . . . . . Ken -- Public XSLT, XSL-FO, UBL & code list classes: Melbourne, AU May 2014 | Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ | G. Ken Holman mailto:gkholman at CraneSoftwrights.com | Google+ profile: https://plus.google.com/116832879756988317389/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal | _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From dlee at calldei.com Wed Dec 11 14:41:33 2013 From: dlee at calldei.com (David Lee) Date: Wed, 11 Dec 2013 22:41:33 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <659a6d596882484a86ecd2c37b17f603@BY2PR08MB014.namprd08.prod.outlook.com> >>> Anyway this has proven to be a useful discussion and fascinating to learn that amazon is more than a mere book-seller! ------------ To spread the Koolaid ... Amazon .. or lets just say AWS (Amazon Web Services, a subsidary of Amazon.com) is *fricken amazing* I could talk forever .. but to get started JUST DO THIS Get yourself an AWS Account and start using their FREE Tier ... http://aws.amazon.com/free/ Compute by the hour Disk space by the GB/month Queues, Messaging, NoSQL Engines, Managed Databases, Workflow systems, ( skipp forward a million ) AND WITH THAT you get MORE !!! Just saying ... whether you end up using it or not, you want to learn about AWS -David -------------- next part -------------- An HTML attachment was scrubbed... URL: From inpost at gmail.com Wed Dec 11 15:08:41 2013 From: inpost at gmail.com (e-letter) Date: Wed, 11 Dec 2013 23:08:41 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On 11/12/2013, Misztur, Chris wrote: > And I'll be happy to help you work through your solution. What kind of app > did you have in mind? > My scenario is barely an application ;) I want to be able to use the example list of books in the web site tutorial 'w3schools' and create a demonstration of xquery. The desired result is an xhtml web page that features a simple menu list using an html form element 'select'. A user selects a book title, then further meta-data (author, publisher etc. that is stored as the xml document "database") appears in another web page. So far, 'jedit' with the xml plug-ins (xquery, xml, xslt) activated has been used and an xhtml page was created by the transformation function in jedit (proving my rudimentary understanding of xpath ;) ) Originally I thought that xquery could be used like xsl; open an xml file using a web browser that refers to the xslt file that also refers to an xq file and voila, result! Unfortunately not; once I realised xquery needs a server, that led me here. So much next step is to try the various software mentioned in this thread and find out which will be the easiest for me to install and use on my old computer. Will ask again nearer the time; thanks very much! From adam.retter at googlemail.com Wed Dec 11 15:11:47 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 11 Dec 2013 23:11:47 +0000 Subject: [xquery-talk] Functional paradigm shift In-Reply-To: <1687C53F-CAE6-4465-A019-C4733D937C06@macleanfogg.com> References: <1687C53F-CAE6-4465-A019-C4733D937C06@macleanfogg.com> Message-ID: I think the classic text is SICP (Structured Interpretation of Computer Programs). This can be downloaded for free. If you still do .Net stuff, maybe worth switching to F# to force you more into a functional approach. > For example I am doing this a lot: > > let $result := some-func() > let $a := if($result eq 0) > then() > else(logger:log($result),error()) > > It just doesn't feel right. Sequences are the key. One approach is to just map/transform on sequences, if you have an empty sequence then nothing happens, else you get the expected result ;-) > > -c > > > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam.retter at googlemail.com Wed Dec 11 15:59:27 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 11 Dec 2013 23:59:27 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: How about using http://xqib.org/ On 11 December 2013 23:08, e-letter wrote: > On 11/12/2013, Misztur, Chris wrote: >> And I'll be happy to help you work through your solution. What kind of app >> did you have in mind? >> > > My scenario is barely an application ;) > > I want to be able to use the example list of books in the web site > tutorial 'w3schools' and create a demonstration of xquery. > > The desired result is an xhtml web page that features a simple menu > list using an html form element 'select'. A user selects a book title, > then further meta-data (author, publisher etc. that is stored as the > xml document "database") appears in another web page. > > So far, 'jedit' with the xml plug-ins (xquery, xml, xslt) activated > has been used and an xhtml page was created by the transformation > function in jedit (proving my rudimentary understanding of xpath ;) ) > > Originally I thought that xquery could be used like xsl; open an xml > file using a web browser that refers to the xslt file that also refers > to an xq file and voila, result! Unfortunately not; once I realised > xquery needs a server, that led me here. So much next step is to try > the various software mentioned in this thread and find out which will > be the easiest for me to install and use on my old computer. > > Will ask again nearer the time; thanks very much! -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk From adam.retter at googlemail.com Wed Dec 11 16:33:53 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Thu, 12 Dec 2013 00:33:53 +0000 Subject: [xquery-talk] Functional paradigm shift In-Reply-To: References: <1687C53F-CAE6-4465-A019-C4733D937C06@macleanfogg.com> Message-ID: I should have also mentioned this free course - https://www.coursera.org/course/progfun I took it the first time it ran and it is truly excellent. I think you may be able to do it non-live as well, by just downloading all the materials and video lectures. If not I am certain it will run again soon. On 12 December 2013 00:26, Ihe Onwuka wrote: > SICP - great book :) > > Read Picturing Programs by Stephen Bloch. It is more likely to tax your > patience than your brain. If you find that too slow How to Design Programs. > Both of which are free on the web. > > Casual observation. Every time I have bought a Functional Programmng book > that was written by a developer rather than an academic, (done it about 5 > times now) I have regretted it. > > > > > > > > > On Wed, Dec 11, 2013 at 11:21 PM, Misztur, Chris > wrote: >> >> Thanks. How would you write invoking a logger and exception checking? >> >> >> >> On Dec 11, 2013, at 5:11 PM, "Adam Retter" >> wrote: >> >> I think the classic text is SICP (Structured Interpretation of Computer >> Programs). This can be downloaded for free. >> >> If you still do .Net stuff, maybe worth switching to F# to force you more >> into a functional approach. >> >> > For example I am doing this a lot: >> > >> > let $result := some-func() >> > let $a := if($result eq 0) >> > then() >> > else(logger:log($result),error()) >> > >> > It just doesn't feel right. >> >> Sequences are the key. One approach is to just map/transform on sequences, >> if you have an empty sequence then nothing happens, else you get the >> expected result ;-) >> >> > >> > -c >> > >> > >> > >> > ________________________________ >> > >> > The contents of this message may be privileged and confidential. >> > Therefore, if this message has been received in error, please delete it >> > without reading it. Your receipt of this message is not intended to waive >> > any applicable privilege. Please do not disseminate this message without the >> > permission of the author. >> > >> > Please consider the environment before printing this e-mail >> > >> > >> > _______________________________________________ >> > talk at x-query.com >> > http://x-query.com/mailman/listinfo/talk >> >> >> ________________________________ >> >> The contents of this message may be privileged and confidential. >> Therefore, if this message has been received in error, please delete it >> without reading it. Your receipt of this message is not intended to waive >> any applicable privilege. Please do not disseminate this message without the >> permission of the author. >> >> Please consider the environment before printing this e-mail >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk From msokolov at safaribooksonline.com Wed Dec 11 20:05:16 2013 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Wed, 11 Dec 2013 23:05:16 -0500 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: <7.0.1.0.2.20131211173029.0246e478@wheresmymailserver.com> References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> <7.0.1.0.2.20131211173029.0246e478@wheresmymailserver.com> Message-ID: <52A935FC.3010505@safaribooksonline.com> On 12/11/2013 5:34 PM, G. Ken Holman wrote: > At 2013-12-11 22:26 +0000, Adam Retter wrote: >> I would be happy to configure a Amazon EC2 instance running eXist for >> you, if that helps? > > I'm an EC2 user and I would find a summary list of instructions very > useful, as would I'm sure many others on this list. > > Could I impose on you, please, to itemize the instructions for all to > follow? > > And thinking about this from a student's perspective, can anyone on > this list identify publicly-available sources of XML content to load > up on the eXist instance so that when the itemized instructions are > complete that anyone would be able to run example scripts against the > installed dataset? I've been using the Shakespeare from here http://www.ibiblio.org/xml/examples/shakespeare/ for my Lux demos No attributes, though. -Mike From liam at w3.org Wed Dec 11 22:34:18 2013 From: liam at w3.org (Liam R E Quin) Date: Thu, 12 Dec 2013 01:34:18 -0500 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <1386830058.9506.93.camel@slave.barefootcomputing.com> On Wed, 2013-12-11 at 23:08 +0000, e-letter wrote: > [...] > once I realised > xquery needs a server, No, it doesn't. There are several components: 1. an XQuery engine; some of these can run directly on an XML file with no database; others require a database, and some can work either way. 2. A Web server, for hosting the Web pages - this could run on your own computer if necessary, e.g. with a Web server like Abyss or with an XQuery engine such as eXist or BaseX which include their own Web server. 3. A remote hosting system (e.g. a Linux-based server): hardware (possibly virtual) to run the Web server software if you want other people to see it all round the globe. In this regard the needs for XQuery are very similar to doing "LAMP" development with Apache and MySQL. For example, the zero-dollar Abyss personal Web server is fine for development, or if you already have Apache running on your ipad or laptop or 'phone or whatever, that's fine too. Saxon and BaseX (both Java-based) can run locally on XML files; BaseX can also use its own database, and can be called from PHP. The collection of thumbnail images on my own Web site - http://www.fromoldbooks.org/ - is currently produced with BaseX, as is the search page, using a database; some of my other pages are done with a different XQuery engine (one called Qizx) just because I've never taken the half hour or so it might need to switch them over. eXist and BaseX can provide a Web server and a forest store; you can load collections of trees from XML documents and then use XQuery to query them. There are lots of other XQuery implementations - these are just a few. My Linux system also came with a database called Virtuoso that implements SQL, SPARQL and XQuery, although I haven't tried it. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml From james.fuller.2007 at gmail.com Thu Dec 12 00:46:18 2013 From: james.fuller.2007 at gmail.com (James Fuller) Date: Thu, 12 Dec 2013 09:46:18 +0100 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On Thu, Dec 12, 2013 at 12:08 AM, e-letter wrote: > > Will ask again nearer the time; thanks very much! > As you can see, there are many helpful and friendly people here willing to pitch in when someone want to learn more. I thought I would mention that learning xquery has benefits beyond just your current app dev as in XQuery is perhaps the easiest functional programming language to learn and once you learn the fundamentals of programming with fp, you can apply it to other languages. Without sounding too over the top, learning XQuery and functional programming idioms that go along with it, will make you a better programmer in any programming language. good luck, Jim Fuller -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlee at calldei.com Thu Dec 12 04:41:39 2013 From: dlee at calldei.com (David Lee) Date: Thu, 12 Dec 2013 12:41:39 +0000 Subject: [xquery-talk] xquery technology now ready? In-Reply-To: References: <1386659433.26783.118.camel@slave.barefootcomputing.com> <6b93bc01be27411d96302fd95f21957c@BY2PR08MB014.namprd08.prod.outlook.com> <58ec120b9f6e42339cf9df88691c6832@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <0f434b4448f146e698afea650ebb1d8d@BY2PR08MB014.namprd08.prod.outlook.com> To pile one more on top of Jim. My personal favorite way to "play with XQuery" is (of course!) with xmlsh, free and open source http://ww.xmlsh.org Its a "shell" who's expression language is XQuery and who's variables are XDM values (anything XQuery can produce). It comes as a command line "shell" as well as a primative GUI (xmlshui) Truely excellent for a quick start at learning XQuery ... And yes, you *can* embed it into a tomcat server and run web pages. In fact you can do a "1 line web server" (very primative) with its buitlin http server support. http://www.xmlsh.org/CommandHttpserver Under the hood , the XQuery and XSLT parts come from the excellent open source XQuery and XSLT parser, Saxon ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org From: James Fuller [mailto:james.fuller.2007 at gmail.com] Sent: Thursday, December 12, 2013 3:46 AM To: e-letter Cc: Misztur, Chris; talk at x-query.com; Liam Quin; Christian Gr?n; Adam Retter; David Lee Subject: Re: [xquery-talk] xquery technology now ready? On Thu, Dec 12, 2013 at 12:08 AM, e-letter > wrote: Will ask again nearer the time; thanks very much! As you can see, there are many helpful and friendly people here willing to pitch in when someone want to learn more. I thought I would mention that learning xquery has benefits beyond just your current app dev as in XQuery is perhaps the easiest functional programming language to learn and once you learn the fundamentals of programming with fp, you can apply it to other languages. Without sounding too over the top, learning XQuery and functional programming idioms that go along with it, will make you a better programmer in any programming language. good luck, Jim Fuller -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Thu Dec 12 05:20:24 2013 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Thu, 12 Dec 2013 14:20:24 +0100 Subject: [xquery-talk] Need help with an insert query (need to reference an attribute value) In-Reply-To: References: Message-ID: > Let's say I want to do an insertion as this point: > > doc("example.html")/ABC > > where attribute x in ABC is equal to "123". How can this be achieved? If your processor supports XQuery Update, you can do the following: insert node into doc("example.html")/ABC[@x = "123"] Please note that the result may not automatically be reflected in the original document. As David indicated, it depends on the processor you are using. If you want to update a document "in-place" without storing it to disk, you can also use the transform expression: copy $c := doc("example.html") modify ( insert node into $c/ABC[@x = "123"] ) return $c From leo at woerteler.de Thu Dec 12 13:36:20 2013 From: leo at woerteler.de (=?UTF-8?B?TGVvbmFyZCBXw7ZydGVsZXI=?=) Date: Thu, 12 Dec 2013 22:36:20 +0100 Subject: [xquery-talk] [ANN] Higher-Order XQuery Modules Message-ID: <52AA2C54.4030405@woerteler.de> Hello everyone, I want to announce the small collection of XQuery 3.0 modules [1] that I've written over the last few weeks. I use them mostly for testing the BaseX optimizer, but there should be no BaseX-specific XQuery code in the repository. I have implemented some purely functional data structures including maps based on AVL and Red-Black Trees that both support arbitrary values as keys and efficient deletion. Some documentation can be found under each module's namespace URI or under [2]. Constructive feedback of any kind (suggestions, bug reports, pull requests) would be much appreciated. Hope you like it, cheers, Leo [1] https://github.com/LeoWoerteler/xq-modules/ [2] http://www.woerteler.de/xquery/modules/ From inpost at gmail.com Thu Dec 12 15:04:30 2013 From: inpost at gmail.com (e-letter) Date: Thu, 12 Dec 2013 23:04:30 +0000 Subject: [xquery-talk] novice questions mailing list Message-ID: Readers, Please could someone suggest a suitable mailing list for novices to post _very_ basic questions about xpath expressions? Thanks. From dk at basex.org Thu Dec 12 15:13:05 2013 From: dk at basex.org (Dirk Kirsten) Date: Fri, 13 Dec 2013 00:13:05 +0100 Subject: [xquery-talk] novice questions mailing list In-Reply-To: References: Message-ID: <52AA4301.4000609@basex.org> If you have very basic questions, I would recommend first to read a book or online tutorials about XPath. For everything non-trivial (so not absolutely basics, but everything from novice to expert is fine) I would recommend StackOverflow as many people from the community are also active there. But please put some effort into solving your problems by yourself first (or at least give it a try). Please use google and the SO search function before posting a question. Trivial questions might not be very popular on SO (but even then: worst thing that can happen to you is that the question is closed). But I guess the same is true on most mailing lists as well. Cheers, Dirk On 13/12/13 00:04, e-letter wrote: > Readers, > > Please could someone suggest a suitable mailing list for novices to > post _very_ basic questions about xpath expressions? Thanks. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Gesch?ftsf?hrer: | Dr. Christian Gr?n, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 From dlee at calldei.com Thu Dec 12 15:14:31 2013 From: dlee at calldei.com (David Lee) Date: Thu, 12 Dec 2013 23:14:31 +0000 Subject: [xquery-talk] novice questions mailing list In-Reply-To: References: Message-ID: <3ddb29bd8f7b4ecb872c94489857ae93@BN1PR08MB009.namprd08.prod.outlook.com> I think you will find this list very accommodating to basic questions. All of us on this list knew nothing about xpath at one point. I recommend with any question you supply sample XML and good description of what you are trying to accomplish along with any xpath or xquery code you have attempted and what it produced and why you belive it is the wrong result. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of e-letter Sent: Thursday, December 12, 2013 6:05 PM To: talk at x-query.com Subject: [xquery-talk] novice questions mailing list Readers, Please could someone suggest a suitable mailing list for novices to post _very_ basic questions about xpath expressions? Thanks. _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From inpost at gmail.com Thu Dec 12 15:38:18 2013 From: inpost at gmail.com (e-letter) Date: Thu, 12 Dec 2013 23:38:18 +0000 Subject: [xquery-talk] novice questions mailing list In-Reply-To: <3ddb29bd8f7b4ecb872c94489857ae93@BN1PR08MB009.namprd08.prod.outlook.com> References: <3ddb29bd8f7b4ecb872c94489857ae93@BN1PR08MB009.namprd08.prod.outlook.com> Message-ID: On 12/12/2013, David Lee wrote: > I think you will find this list very accommodating to basic questions. > All of us on this list knew nothing about xpath at one point. > > I recommend with any question you supply sample XML and good description of > what you are trying to accomplish along with any xpath or xquery code you > have attempted > and what it produced and why you belive it is the wrong result. > Here goes: The objective is to learn how to select nodes in an xml file and use xpath and xslt to select nodes of interest and display in a new file. An xml file was created: Everyday Italian Giada De Laurentiis 2005 30.00 Harry Potter J K. Rowling 2005 29.99 XQuery Kick Start James McGovern Per Bothner Kurt Cagle James Linn Vaidyanathan Nagarajan 2003 49.99 Learning XML Erik T. Ray 2003 39.95 An xml stylesheet was created: Test output web page

The text editor 'jedit' is used with xml plugins xslt, xquery, xml. The xslt transformer plugin is used to select the above xml file and xslt file for subsequent transformation, to create an output xhtml file. The result of this transformation is the creation of a new xhtml file (as stated in the stylesheet above): Everyday Italian Test output web page

Giada De Laurentiis

2005 30.00 Harry Potter Test output web page

J K. Rowling

2005 29.99 XQuery Kick Start Test output web page

James McGovern

Test output web page

Per Bothner

Test output web page

Kurt Cagle

Test output web page

James Linn

Test output web page

Vaidyanathan Nagarajan

2003 49.99 Learning XML Test output web page

Erik T. Ray

2003 39.95 Clearly, there's a lot to learn in specifying the transformation correctly! The ideal output is: Test output web page

Giada De Laurentiis

J K. Rowling

James McGovern

Per Bothner

Kurt Cagle

James Linn

Vaidyanathan Nagarajan

Erik T. Ray

From dlee at calldei.com Thu Dec 12 17:28:15 2013 From: dlee at calldei.com (David Lee) Date: Fri, 13 Dec 2013 01:28:15 +0000 Subject: [xquery-talk] novice questions mailing list In-Reply-To: References: <3ddb29bd8f7b4ecb872c94489857ae93@BN1PR08MB009.namprd08.prod.outlook.com>, Message-ID: I lead you down the wrong path, I'm sorry. The question you are asking is about XSLT not xpath or xquery although they share many things ... So many x's in XML land ... I suggest this mailing list xsl-list at lists.mulberrytech.com Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com > On Dec 12, 2013, at 6:38 PM, "e-letter" wrote: > >> On 12/12/2013, David Lee wrote: >> I think you will find this list very accommodating to basic questions. >> All of us on this list knew nothing about xpath at one point. >> >> I recommend with any question you supply sample XML and good description of >> what you are trying to accomplish along with any xpath or xquery code you >> have attempted >> and what it produced and why you belive it is the wrong result. >> > > Here goes: > > The objective is to learn how to select nodes in an xml file and use > xpath and xslt to select nodes of interest and display in a new file. > > An xml file was created: > > > > > > > Everyday Italian > Giada De Laurentiis > 2005 > 30.00 > > > Harry Potter > J K. Rowling > 2005 > 29.99 > > > XQuery Kick Start > James McGovern > Per Bothner > Kurt Cagle > James Linn > Vaidyanathan Nagarajan > 2003 > 49.99 > > > Learning XML > Erik T. Ray > 2003 > 39.95 > > > > An xml stylesheet was created: > > > > method="xml" > doctype-public="-//W3C//DTD XHTML Basic 1.1//EN" > doctype-system="http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd" > encoding="utf-8" > indent="no" > omit-xml-declaration="yes" > media-type="text/xml" > standalone="yes" > version="1.1" > /> > match="author"> > > > name='note' content='xhtml document created by xml transformation' /> > Test output web page > > >

> >

> > >
>
> > The text editor 'jedit' is used with xml plugins xslt, xquery, xml. > The xslt transformer plugin is used to select the above xml file and > xslt file for subsequent transformation, to create an output xhtml > file. > > The result of this transformation is the creation of a new xhtml file > (as stated in the stylesheet above): > > > > Everyday Italian > "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> > lang="en">Test output web > page

Giada De Laurentiis

> 2005 > 30.00 > > > Harry Potter > lang="en">Test output web > page

J K. Rowling

> 2005 > 29.99 > > > XQuery Kick Start > lang="en">Test output web > page

James McGovern

> lang="en">Test output web > page

Per Bothner

> lang="en">Test output web > page

Kurt Cagle

> lang="en">Test output web > page

James Linn

> lang="en">Test output web > page

Vaidyanathan Nagarajan

> 2003 > 49.99 > > > Learning XML > lang="en">Test output web > page

Erik T. Ray

> 2003 > 39.95 > > > Clearly, there's a lot to learn in specifying the transformation correctly! > > The ideal output is: > > "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> > > > content="xhtml document created by xml transformation" name="note" > /> > Test output web page > > >

Giada De Laurentiis

>

J K. Rowling

>

James McGovern

>

Per Bothner

>

Kurt Cagle

>

James Linn

>

Vaidyanathan Nagarajan

>

Erik T. Ray

> > From CMisztur at macleanfogg.com Thu Dec 12 17:48:24 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Fri, 13 Dec 2013 01:48:24 +0000 Subject: [xquery-talk] novice questions mailing list In-Reply-To: References: <3ddb29bd8f7b4ecb872c94489857ae93@BN1PR08MB009.namprd08.prod.outlook.com>, Message-ID: <7AC1D93CF590E5458FCE12A1306063570E6E060D@us09exm01.MacLean-Fogg.com> Here is a sample xquery script. It declares 1 function and a try/catch block to execute the 'main' code. xquery version '3.0'; declare %private function local:get-category( $document as document-node()?, $category as xs:string) as item()* { (: select from all book nodes :) $document/bookstore/book (: where the category attribute value is equal to our variable :) [@category/string() eq $category] }; try { let $books := doc('/Users/Waldo/Documents/xquery-list/books.xml') return local:get-category($books, 'WEB') } catch * { element exception { attribute unhandled { true() }, 'an unhandled exception occured' } } ________________________________________ From: talk-bounces at x-query.com [talk-bounces at x-query.com] on behalf of e-letter [inpost at gmail.com] Sent: Thursday, December 12, 2013 5:38 PM To: David Lee Cc: talk at x-query.com Subject: Re: [xquery-talk] novice questions mailing list On 12/12/2013, David Lee wrote: > I think you will find this list very accommodating to basic questions. > All of us on this list knew nothing about xpath at one point. > > I recommend with any question you supply sample XML and good description of > what you are trying to accomplish along with any xpath or xquery code you > have attempted > and what it produced and why you belive it is the wrong result. > Here goes: The objective is to learn how to select nodes in an xml file and use xpath and xslt to select nodes of interest and display in a new file. An xml file was created: Everyday Italian Giada De Laurentiis 2005 30.00 Harry Potter J K. Rowling 2005 29.99 XQuery Kick Start James McGovern Per Bothner Kurt Cagle James Linn Vaidyanathan Nagarajan 2003 49.99 Learning XML Erik T. Ray 2003 39.95 An xml stylesheet was created: Test output web page

The text editor 'jedit' is used with xml plugins xslt, xquery, xml. The xslt transformer plugin is used to select the above xml file and xslt file for subsequent transformation, to create an output xhtml file. The result of this transformation is the creation of a new xhtml file (as stated in the stylesheet above): Everyday Italian Test output web page

Giada De Laurentiis

2005 30.00 Harry Potter Test output web page

J K. Rowling

2005 29.99 XQuery Kick Start Test output web page

James McGovern

Test output web page

Per Bothner

Test output web page

Kurt Cagle

Test output web page

James Linn

Test output web page

Vaidyanathan Nagarajan

2003 49.99 Learning XML Test output web page

Erik T. Ray

2003 39.95 Clearly, there's a lot to learn in specifying the transformation correctly! The ideal output is: Test output web page

Giada De Laurentiis

J K. Rowling

James McGovern

Per Bothner

Kurt Cagle

James Linn

Vaidyanathan Nagarajan

Erik T. Ray

_______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From geert.josten at dayon.nl Fri Dec 13 13:42:03 2013 From: geert.josten at dayon.nl (Geert Josten) Date: Fri, 13 Dec 2013 22:42:03 +0100 Subject: [xquery-talk] novice questions mailing list In-Reply-To: References: <3ddb29bd8f7b4ecb872c94489857ae93@BN1PR08MB009.namprd08.prod.outlook.com> Message-ID: <898a667c6a56d83847c8a4aa95b0adf7@mail.gmail.com> David is right that XSLT questions are better off on the xsl list, but I am going to give a few hints anyhow. XSLT processing normally starts at template match="/", which matches the document node of your input. You likely want to write the outline of your HTML page in such a template. You also need to be aware that there are built-in templates which are selected if none of your own templates match. Their default behavior is more or less to copy character data. If you want to suppress any character data other than the author names, the simplest way is to change your current template's match attribute to match="/", and add select=".//author" to your current xsl:apply-templates statement.. Good luck, Geert > -----Oorspronkelijk bericht----- > Van: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] > Namens e-letter > Verzonden: vrijdag 13 december 2013 0:38 > Aan: David Lee > CC: talk at x-query.com > Onderwerp: Re: [xquery-talk] novice questions mailing list > > On 12/12/2013, David Lee wrote: > > I think you will find this list very accommodating to basic questions. > > All of us on this list knew nothing about xpath at one point. > > > > I recommend with any question you supply sample XML and good > description of > > what you are trying to accomplish along with any xpath or xquery code > > you > > have attempted > > and what it produced and why you belive it is the wrong result. > > > > Here goes: > > The objective is to learn how to select nodes in an xml file and use > xpath and xslt to select nodes of interest and display in a new file. > > An xml file was created: > > > > > > > Everyday Italian > Giada De Laurentiis > 2005 > 30.00 > > > Harry Potter > J K. Rowling > 2005 > 29.99 > > > XQuery Kick Start > James McGovern > Per Bothner > Kurt Cagle > James Linn > Vaidyanathan Nagarajan > 2003 > 49.99 > > > Learning XML > Erik T. Ray > 2003 > 39.95 > > > > An xml stylesheet was created: > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > > method="xml" > doctype-public="-//W3C//DTD XHTML Basic 1.1//EN" > doctype-system="http://www.w3.org/TR/xhtml-basic/xhtml- > basic11.dtd" > encoding="utf-8" > indent="no" > omit-xml-declaration="yes" > media-type="text/xml" > standalone="yes" > version="1.1" > /> > match="author"> > xml:lang='en'> > > name='note' content='xhtml > document created by xml transformation' /> > Test output web page > > >

> >

> > >
>
> > The text editor 'jedit' is used with xml plugins xslt, xquery, xml. > The xslt transformer plugin is used to select the above xml file and > xslt file for subsequent transformation, to create an output xhtml > file. > > The result of this transformation is the creation of a new xhtml file > (as stated in the stylesheet above): > > > > Everyday Italian > "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> > lang="en">Test output web > page

Giada De Laurentiis

> 2005 > 30.00 > > > Harry Potter > lang="en">Test output web > page

J K. Rowling

> 2005 > 29.99 > > > XQuery Kick Start > lang="en">Test output web > page

James McGovern

> lang="en">Test output web > page

Per Bothner

> lang="en">Test output web > page

Kurt Cagle

> lang="en">Test output web > page

James Linn

> lang="en">Test output web > page

Vaidyanathan > Nagarajan

> 2003 > 49.99 > > > Learning XML > lang="en">Test output web > page

Erik T. Ray

> 2003 > 39.95 > > > Clearly, there's a lot to learn in specifying the transformation > correctly! > > The ideal output is: > > "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> > xml:lang='en'> > > content="xhtml document created by xml > transformation" name="note" > /> > Test output web page > > >

Giada De Laurentiis

>

J K. Rowling

>

James McGovern

>

Per Bothner

>

Kurt Cagle

>

James Linn

>

Vaidyanathan Nagarajan

>

Erik T. Ray

> > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From CMisztur at macleanfogg.com Fri Dec 13 18:01:08 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Sat, 14 Dec 2013 02:01:08 +0000 Subject: [xquery-talk] Validating an attribute value Message-ID: <9790DE78-505E-4553-85A3-75F788173236@macleanfogg.com> If I want to make sure that an attribute has a value should I check with empty() and functx:all-whitespace()? -c ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From mike at saxonica.com Sat Dec 14 01:10:01 2013 From: mike at saxonica.com (Michael Kay) Date: Sat, 14 Dec 2013 09:10:01 +0000 Subject: [xquery-talk] Validating an attribute value In-Reply-To: <9790DE78-505E-4553-85A3-75F788173236@macleanfogg.com> References: <9790DE78-505E-4553-85A3-75F788173236@macleanfogg.com> Message-ID: If you want to check that an attribute exists and that its value is non-empty and not all whitespace, use if (normalize-space(@att)) then... Michael Kay Saxonica On 14 Dec 2013, at 02:01, Misztur, Chris wrote: > If I want to make sure that an attribute has a value should I check with empty() and functx:all-whitespace()? > > -c > > > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From dlee at calldei.com Sat Dec 14 05:04:15 2013 From: dlee at calldei.com (David Lee) Date: Sat, 14 Dec 2013 13:04:15 +0000 Subject: [xquery-talk] Validating an attribute value In-Reply-To: <9790DE78-505E-4553-85A3-75F788173236@macleanfogg.com> References: <9790DE78-505E-4553-85A3-75F788173236@macleanfogg.com> Message-ID: assuming your are not particularly pedantic about unicode characters that might look spacy-like ... this will work fn:exists($elem/@attribute) and fn: normalize-space( $elem/@attribute ) ne '' but it all depends on what you mean by 'has a value' ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Misztur, Chris Sent: Friday, December 13, 2013 9:01 PM To: talk at x-query.com Subject: [xquery-talk] Validating an attribute value If I want to make sure that an attribute has a value should I check with empty() and functx:all-whitespace()? -c ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From CMisztur at macleanfogg.com Sun Dec 15 09:43:15 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Sun, 15 Dec 2013 17:43:15 +0000 Subject: [xquery-talk] Validating an attribute value In-Reply-To: References: <9790DE78-505E-4553-85A3-75F788173236@macleanfogg.com>, Message-ID: <7AC1D93CF590E5458FCE12A1306063570E6EEFE8@us09exm02.MacLean-Fogg.com> Thanks. That will do. ________________________________________ From: Michael Kay [mike at saxonica.com] Sent: Saturday, December 14, 2013 3:10 AM To: Misztur, Chris Cc: talk at x-query.com Subject: Re: [xquery-talk] Validating an attribute value If you want to check that an attribute exists and that its value is non-empty and not all whitespace, use if (normalize-space(@att)) then... Michael Kay Saxonica On 14 Dec 2013, at 02:01, Misztur, Chris wrote: > If I want to make sure that an attribute has a value should I check with empty() and functx:all-whitespace()? > > -c > > > > ________________________________ > > The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. > > Please consider the environment before printing this e-mail > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From davidc at nag.co.uk Mon Dec 16 08:46:31 2013 From: davidc at nag.co.uk (David Carlisle) Date: Mon, 16 Dec 2013 16:46:31 +0000 Subject: [xquery-talk] Wrapping element conditionally In-Reply-To: <7AC1D93CF590E5458FCE12A1306063570E6F2AD6@us09exm02.MacLean-Fogg.com> References: <7AC1D93CF590E5458FCE12A1306063570E6F2AD6@us09exm02.MacLean-Fogg.com> Message-ID: <52AF2E67.5060900@nag.co.uk> On 16/12/2013 16:28, Misztur, Chris wrote: > How would I get the output to look like: > >

> > Or just: > >

something here

/ (if($wrap) then . else body/p) 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 dlee at calldei.com Mon Dec 16 09:01:18 2013 From: dlee at calldei.com (David Lee) Date: Mon, 16 Dec 2013 17:01:18 +0000 Subject: [xquery-talk] Wrapping element conditionally In-Reply-To: <52AF2E67.5060900@nag.co.uk> References: <7AC1D93CF590E5458FCE12A1306063570E6F2AD6@us09exm02.MacLean-Fogg.com> <52AF2E67.5060900@nag.co.uk> Message-ID: <9f3a0c1909f24d6e84f69bbd6346a273@BY2PR08MB014.namprd08.prod.outlook.com> FYI the key to understanding XQuery (and XSLT) is that you are not "printing lines" your generating element. *full elements* with these constructs. You cant just printf("") then later printf("") You are constructing an entire element including the start, end and body all at once. So you cant conditionally include or exclude half the markup. -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of David Carlisle Sent: Monday, December 16, 2013 11:47 AM To: Misztur, Chris; talk at x-query.com Subject: Re: [xquery-talk] Wrapping element conditionally On 16/12/2013 16:28, Misztur, Chris wrote: > How would I get the output to look like: > >

> > Or just: > >

something here

/ (if($wrap) then . else body/p) 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. ________________________________________________________________________ _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From james.fuller.2007 at gmail.com Mon Dec 16 09:09:37 2013 From: james.fuller.2007 at gmail.com (James Fuller) Date: Mon, 16 Dec 2013 18:09:37 +0100 Subject: [xquery-talk] Wrapping element conditionally In-Reply-To: <9f3a0c1909f24d6e84f69bbd6346a273@BY2PR08MB014.namprd08.prod.outlook.com> References: <7AC1D93CF590E5458FCE12A1306063570E6F2AD6@us09exm02.MacLean-Fogg.com> <52AF2E67.5060900@nag.co.uk> <9f3a0c1909f24d6e84f69bbd6346a273@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: and for a bit of xquery 3.0 fun xquery version "3.0"; let $apply:= function($bool,$fn,$el){ ($fn($el)[$bool], $el)[1] } let $wrap := true() , $p :=

something here

return $apply( $wrap, function($el){{$el}}, $p) On Mon, Dec 16, 2013 at 6:01 PM, David Lee wrote: > FYI the key to understanding XQuery (and XSLT) is that you are not > "printing lines" your generating element. *full elements* with these > constructs. > You cant just printf("") then later printf("") > > You are constructing an entire element including the start, end and body > all at once. > So you cant conditionally include or exclude half the markup. > > > -----Original Message----- > From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On > Behalf Of David Carlisle > Sent: Monday, December 16, 2013 11:47 AM > To: Misztur, Chris; talk at x-query.com > Subject: Re: [xquery-talk] Wrapping element conditionally > > On 16/12/2013 16:28, Misztur, Chris wrote: > > How would I get the output to look like: > > > >

> > > > Or just: > > > >

> >

something here

/ > (if($wrap) then . else body/p) > > 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. > ________________________________________________________________________ > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From CMisztur at macleanfogg.com Mon Dec 16 09:33:24 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Mon, 16 Dec 2013 17:33:24 +0000 Subject: [xquery-talk] Wrapping element conditionally In-Reply-To: References: <7AC1D93CF590E5458FCE12A1306063570E6F2AD6@us09exm02.MacLean-Fogg.com> <52AF2E67.5060900@nag.co.uk> <9f3a0c1909f24d6e84f69bbd6346a273@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <7AC1D93CF590E5458FCE12A1306063570E6F2E5B@us09exm02.MacLean-Fogg.com> Can you explain this more: ($fn($el)[$bool], $el)[1] [Description: Description: C:\Users\bduffy\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\WXCD6RUK\MF_4C_email (2).jpeg] Chris Misztur | Engineer, Business Systems 1000 Allanson Rd, Mundelein, IL 60060 (Map) Office +1 847 837-3729 | Cell +1 312 504-0681 www.macleanfoggcs.com From: James Fuller [mailto:james.fuller.2007 at gmail.com] Sent: Monday, December 16, 2013 11:10 AM To: David Lee Cc: David Carlisle; Misztur, Chris; talk at x-query.com Subject: Re: [xquery-talk] Wrapping element conditionally and for a bit of xquery 3.0 fun xquery version "3.0"; let $apply:= function($bool,$fn,$el){ ($fn($el)[$bool], $el)[1] } let $wrap := true() , $p :=

something here

return $apply( $wrap, function($el){{$el}}, $p) On Mon, Dec 16, 2013 at 6:01 PM, David Lee > wrote: FYI the key to understanding XQuery (and XSLT) is that you are not "printing lines" your generating element. *full elements* with these constructs. You cant just printf("") then later printf("") You are constructing an entire element including the start, end and body all at once. So you cant conditionally include or exclude half the markup. -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of David Carlisle Sent: Monday, December 16, 2013 11:47 AM To: Misztur, Chris; talk at x-query.com Subject: Re: [xquery-talk] Wrapping element conditionally On 16/12/2013 16:28, Misztur, Chris wrote: > How would I get the output to look like: > >

> > Or just: > >

something here

/ (if($wrap) then . else body/p) 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. ________________________________________________________________________ _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 3479 bytes Desc: image001.jpg URL: From dlee at calldei.com Mon Dec 16 10:10:46 2013 From: dlee at calldei.com (David Lee) Date: Mon, 16 Dec 2013 18:10:46 +0000 Subject: [xquery-talk] Wrapping element conditionally In-Reply-To: <7AC1D93CF590E5458FCE12A1306063570E6F2E5B@us09exm02.MacLean-Fogg.com> References: <7AC1D93CF590E5458FCE12A1306063570E6F2AD6@us09exm02.MacLean-Fogg.com> <52AF2E67.5060900@nag.co.uk> <9f3a0c1909f24d6e84f69bbd6346a273@BY2PR08MB014.namprd08.prod.outlook.com> <7AC1D93CF590E5458FCE12A1306063570E6F2E5B@us09exm02.MacLean-Fogg.com> Message-ID: <5662baea844b4e90b2e2c5820c5fb10e@BY2PR08MB014.namprd08.prod.outlook.com> Can you explain this more: ($fn($el)[$bool], $el)[1] Construct a sequence of ( Call the function $fn given the argument $el if $bool is true the the result of the function is used otherwise () , The element $el ) This produces a 1 or 2 element sequence. [1] takes the first element which is either the wrapped $el or just $el I would put this example in the camp of "advanced xquery" From: Misztur, Chris [mailto:CMisztur at macleanfogg.com] Sent: Monday, December 16, 2013 12:33 PM To: James Fuller; David Lee Cc: David Carlisle; talk at x-query.com Subject: RE: [xquery-talk] Wrapping element conditionally Can you explain this more: ($fn($el)[$bool], $el)[1] [Description: Description: C:\Users\bduffy\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\WXCD6RUK\MF_4C_email (2).jpeg] Chris Misztur | Engineer, Business Systems 1000 Allanson Rd, Mundelein, IL 60060 (Map) Office +1 847 837-3729 | Cell +1 312 504-0681 www.macleanfoggcs.com From: James Fuller [mailto:james.fuller.2007 at gmail.com] Sent: Monday, December 16, 2013 11:10 AM To: David Lee Cc: David Carlisle; Misztur, Chris; talk at x-query.com Subject: Re: [xquery-talk] Wrapping element conditionally and for a bit of xquery 3.0 fun xquery version "3.0"; let $apply:= function($bool,$fn,$el){ ($fn($el)[$bool], $el)[1] } let $wrap := true() , $p :=

something here

return $apply( $wrap, function($el){{$el}}, $p) On Mon, Dec 16, 2013 at 6:01 PM, David Lee > wrote: FYI the key to understanding XQuery (and XSLT) is that you are not "printing lines" your generating element. *full elements* with these constructs. You cant just printf("") then later printf("") You are constructing an entire element including the start, end and body all at once. So you cant conditionally include or exclude half the markup. -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of David Carlisle Sent: Monday, December 16, 2013 11:47 AM To: Misztur, Chris; talk at x-query.com Subject: Re: [xquery-talk] Wrapping element conditionally On 16/12/2013 16:28, Misztur, Chris wrote: > How would I get the output to look like: > >

> > Or just: > >

something here

/ (if($wrap) then . else body/p) 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. ________________________________________________________________________ _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 3479 bytes Desc: image001.jpg URL: From dsewell at virginia.edu Thu Dec 19 10:21:08 2013 From: dsewell at virginia.edu (David Sewell) Date: Thu, 19 Dec 2013 13:21:08 -0500 (EST) Subject: [xquery-talk] XQuery 3 try/catch and duplicate attributes Message-ID: I'm trying to clean up some old code of ours that is throwing server errors when fed buggy data. To simplify greatly, the code is something like this: let $element := text return element new { $element/attribute(), attribute id { "new-id" }, $element/node() } where the content of $element comes from XML data where is not supposed to carry an @id attribute. Of course if the data is buggy and $element has a child @id, the above code throws a dynamic error (XQDY0025, duplicate attribute names). I naively thought this might be a quick fix to prevent runtime errors: xquery version "3.0"; let $element := text return element new { $element/attribute(), try {attribute id { "new-id" }} catch * {()}, $element/node() } but it doesn't trap the error (in any XQuery 3 processor I've checked). The try/catch will work only if put around the entire element constructor. Can someone who understands the 3.0 spec better than I do explain the general principle behind this? Is it that the processor cannot be expected to evaluate the legality of the constructed element until all its parts have been assembled? David -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA Email: dsewell at virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ From inpost at gmail.com Thu Dec 19 10:24:10 2013 From: inpost at gmail.com (e-letter) Date: Thu, 19 Dec 2013 18:24:10 +0000 Subject: [xquery-talk] flwor expression result Message-ID: Readers, According to the xquery specification , the flwor expression (? 3.8) syntax has optional parts, i.e. the 'let' part of the clause. Therefore the following expression was saved as an 'xq' file:
    for $x in fn:doc("xmldatabasefile.xml")/bookstore/book/author order by $x/author return $x/author
This xquery file was processed using jedit xml plug-ins; xml file: Everyday Italian Giada De Laurentiis 2005 30.00 ... The output was:
    for $x in fn:doc("xmldatabasefile.xml")/bookstore/book/author order by $x/author return $x/author
The expected output was a list of authors within the html un-ordered list element. What is my mistake please? From christian.gruen at gmail.com Thu Dec 19 10:31:10 2013 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Thu, 19 Dec 2013 19:31:10 +0100 Subject: [xquery-talk] XQuery 3 try/catch and duplicate attributes In-Reply-To: References: Message-ID: Hi David, > [?] > try {attribute id { "new-id" }} catch * {()}, > [?] > > but it doesn't trap the error (in any XQuery 3 processor I've checked). The > try/catch will work only if put around the entire element constructor. The reason for this is that the attribute constructor itself is correct. The error occurs when trying to add the newly created attribute to the element. The following query should work: let $element := text return element new { $element/attribute(), if($element/@id) then () else attribute id { "new-id" }, $element/node() } Hope this helps, Christian From dsewell at virginia.edu Thu Dec 19 11:23:07 2013 From: dsewell at virginia.edu (David Sewell) Date: Thu, 19 Dec 2013 14:23:07 -0500 (EST) Subject: [xquery-talk] XQuery 3 try/catch and duplicate attributes In-Reply-To: References: Message-ID: Thanks. As I say, I'm cleaning up legacy code that has a lot of mess in it, and in fact a try/catch isn't the solution I'll be using to avoid the problem in this case; I was just curious about the (in)ability of try/catch to prevent duplicate attributes within an element constructor. Clearly there are better ways to prevent them than relying on that. David On Thu, 19 Dec 2013, Ryan Dew wrote: > Adding to this, my personal opinion is that try/catches should be a last > resort and you'll be a better programmer for avoiding them. Not to mention, > you can often see performance increases by avoiding them if the code is > something that is called repeatedly and are less likely to unintentionally > mask problems. For example you can do the following (please excuse the > formatting): > > xquery version "3.0"; > let $element := text > return element new { > $element/attribute(), > if (fn:empty($element/@id)) then attribute id { "new-id" } else (), > $element/node() > } > > > > On Thu, Dec 19, 2013 at 11:31 AM, Christian Gr?n > wrote: > >> Hi David, >> >>> [?] >>> try {attribute id { "new-id" }} catch * {()}, >>> [?] >>> >>> but it doesn't trap the error (in any XQuery 3 processor I've checked). >> The >>> try/catch will work only if put around the entire element constructor. >> >> The reason for this is that the attribute constructor itself is >> correct. The error occurs when trying to add the newly created >> attribute to the element. >> >> The following query should work: >> >> let $element := text >> return element new { >> $element/attribute(), >> if($element/@id) then () else attribute id { "new-id" }, >> $element/node() >> } >> >> Hope this helps, >> Christian >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk >> > -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA Email: dsewell at virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ From mike at saxonica.com Thu Dec 19 11:32:27 2013 From: mike at saxonica.com (Michael Kay) Date: Thu, 19 Dec 2013 19:32:27 +0000 Subject: [xquery-talk] flwor expression result In-Reply-To: References: Message-ID: <7F0AADC5-4EFB-4EE1-8A0F-5481E706DBE7@saxonica.com> If you put an expression inside the content of an element node, it needs to go in curly braces. Otherwise it's just literal element content. Michael Kay Saxonica On 19 Dec 2013, at 18:24, e-letter wrote: > Readers, > > According to the xquery specification , the flwor expression (? 3.8) > syntax has optional parts, i.e. the 'let' part of the clause. > Therefore the following expression was saved as an 'xq' file: > > > >
    > for $x in fn:doc("xmldatabasefile.xml")/bookstore/book/author > order by $x/author > return $x/author >
> > > > This xquery file was processed using jedit xml plug-ins; xml file: > > > > > > category="COOKING"> > Everyday Italian > Giada De Laurentiis > 2005 > 30.00 > > ... > > The output was: > > > >
    > for $x in fn:doc("xmldatabasefile.xml")/bookstore/book/author > order by $x/author > return $x/author > >
> > > > The expected output was a list of authors within the html un-ordered > list element. What is my mistake please? > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From inpost at gmail.com Thu Dec 19 11:34:15 2013 From: inpost at gmail.com (e-letter) Date: Thu, 19 Dec 2013 19:34:15 +0000 Subject: [xquery-talk] flwor expression result In-Reply-To: <7F0AADC5-4EFB-4EE1-8A0F-5481E706DBE7@saxonica.com> References: <7F0AADC5-4EFB-4EE1-8A0F-5481E706DBE7@saxonica.com> Message-ID: On 19/12/2013, Michael Kay wrote: > If you put an expression inside the content of an element node, it needs to > go in curly braces. Otherwise it's just literal element content. > Yes, understood this from the description of constructors, but did not assume this was applicable also to these flwor expressions From inpost at gmail.com Sat Dec 21 03:20:56 2013 From: inpost at gmail.com (e-letter) Date: Sat, 21 Dec 2013 11:20:56 +0000 Subject: [xquery-talk] restxq status Message-ID: Readers, Having decided to use basex as an xml database, encountered an unofficial draft 'restxq' (http://exquery.github.io/exquery/exquery-restxq-specification/restxq-1.0-specification.html). According to this document, there is no facility within xquery to use it on a web server to process requests to and from a web browser client. This is surprising; is it true? What is the long term future of restxq, from the perspective of learning its language? From adam.retter at googlemail.com Sat Dec 21 09:10:49 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Sat, 21 Dec 2013 17:10:49 +0000 Subject: [xquery-talk] restxq status In-Reply-To: References: Message-ID: RESTXQ itself is supported in eXist, BaseX and to a certain extent in Marklogic. XQuery has no support for processing or responding to HTTP requests, this is what RESTXQ is trying to solve. If you would like some background I would recommend reading the paper from the XML Prague 2012 conference, it's available in the proceedings or at my website www.adamretter.org/presentations.xml. RESTXQ will continue to develop, personally I have just lacked time to update the spec. On 21 Dec 2013 12:23, "e-letter" wrote: > Readers, > > Having decided to use basex as an xml database, encountered an > unofficial draft 'restxq' > ( > http://exquery.github.io/exquery/exquery-restxq-specification/restxq-1.0-specification.html > ). > According to this document, there is no facility within xquery to use > it on a web server to process requests to and from a web browser > client. This is surprising; is it true? > > What is the long term future of restxq, from the perspective of > learning its language? > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inpost at gmail.com Sat Dec 21 09:36:25 2013 From: inpost at gmail.com (e-letter) Date: Sat, 21 Dec 2013 17:36:25 +0000 Subject: [xquery-talk] restxq status In-Reply-To: References: Message-ID: On 21/12/2013, Adam Retter wrote: > > XQuery has no support for processing or responding to HTTP requests, this > is what RESTXQ is trying to solve. > Again, this is surprising; was expecting to re-visit the w3 web site to find another x... to review! ;) > If you would like some background I would recommend reading the paper from > the XML Prague 2012 conference, it's available in the proceedings or at my > website www.adamretter.org/presentations.xml. > UK domain required in the URL: www.adamretter.org.uk/presentations.xml From dlee at calldei.com Sat Dec 21 10:01:55 2013 From: dlee at calldei.com (David Lee) Date: Sat, 21 Dec 2013 18:01:55 +0000 Subject: [xquery-talk] restxq status In-Reply-To: References: Message-ID: Its useful to consider "layers" of software. XQuery itself is a data processing language with very minimal (almost none) support for application level services. This is like C or core Java or basic languages ... the language itself doesnt have support for application services (http, web services etc). Those are supplied by infrastrucdture, frameworks, libraries or other products. XQuery is *embedded* into many products that DO support these services. Like C or Java. Java as a language by itself knows nothing about web servers , but Java inside of a J2EE environment (like Tomcat or JBoss) does. Same with XQuery. So when you are looking for app sevice support you generally are exiting the realm of pure XQuery and entering the realm of a particular host framework. -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of e-letter Sent: Saturday, December 21, 2013 12:36 PM To: Adam Retter Cc: talk at x-query.com Subject: Re: [xquery-talk] restxq status On 21/12/2013, Adam Retter wrote: > > XQuery has no support for processing or responding to HTTP requests, > this is what RESTXQ is trying to solve. > Again, this is surprising; was expecting to re-visit the w3 web site to find another x... to review! ;) > If you would like some background I would recommend reading the paper > from the XML Prague 2012 conference, it's available in the proceedings > or at my website www.adamretter.org/presentations.xml. > UK domain required in the URL: www.adamretter.org.uk/presentations.xml _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From msokolov at safaribooksonline.com Sat Dec 21 12:29:56 2013 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Sat, 21 Dec 2013 15:29:56 -0500 Subject: [xquery-talk] restxq status In-Reply-To: References: Message-ID: <52B5FA44.7020907@safaribooksonline.com> There is also this spec: http://expath.org/spec/webapp which defines a protocol for providing web services in xquery. Lux (luxdb.org) supports this (the request/response protocol, not the packaging spec); I'm not sure whether it has been adopted by BaseX or any other system -Mike On 12/21/13 6:20 AM, e-letter wrote: > Readers, > > Having decided to use basex as an xml database, encountered an > unofficial draft 'restxq' > (http://exquery.github.io/exquery/exquery-restxq-specification/restxq-1.0-specification.html). > According to this document, there is no facility within xquery to use > it on a web server to process requests to and from a web browser > client. This is surprising; is it true? > > What is the long term future of restxq, from the perspective of > learning its language? > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From inpost at gmail.com Fri Dec 27 01:20:22 2013 From: inpost at gmail.com (e-letter) Date: Fri, 27 Dec 2013 09:20:22 +0000 Subject: [xquery-talk] xpath1 text node contains attribute, equivalent in xpath2 Message-ID: Readers, For an xml file: ... Learning XML Erik T. Ray 2003 39.95 ... An xquery file was created and processed using jedit xml plugins:

{ let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title[contains(text(),'XML')]/parent::* return $x }

Xpath1 specification ? 4.2 string functions (http://www.w3.org/TR/xpath/#section-String-Functions) describes a "contains" function, but this was not found in xpath2; what is the equivalent function in xpath2 please? The resultant output:

Learning XML Erik T. Ray 2003 39.95

Is it possible to remove the xml elements from the output file? An alternative xquery was attempted: ...

{ let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title/text() return $x }

... Resultant output: ...

Everyday Italian Harry Potter XQuery Kick Start Learning XML

... Is it possible to select a specific title text with this xquery syntax? From liam at w3.org Fri Dec 27 01:30:03 2013 From: liam at w3.org (Liam R E Quin) Date: Fri, 27 Dec 2013 04:30:03 -0500 Subject: [xquery-talk] xpath1 text node contains attribute, equivalent in xpath2 In-Reply-To: References: Message-ID: <1388136603.21352.236.camel@slave.barefootcomputing.com> On Fri, 2013-12-27 at 09:20 +0000, e-letter wrote: > Xpath1 specification ? 4.2 string functions > (http://www.w3.org/TR/xpath/#section-String-Functions) describes a > "contains" function, but this was not found in xpath2; Better to use the XPath 2 Functions and Operators spec, which does indeed list fn:contains(). In XQuery you might need to call it fn:contains() rather than contains(), depending on options. > Is it possible to remove the xml elements from the output file? Change return $x to return $x/text() maybe > An alternative xquery was attempted: > > ...

> { > let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title/text() > return $x > } >

... > Is it possible to select a specific title text with this xquery syntax? Yes. E.g. ......bookstore/book/title[fn:contains(., 'Learning XML')] Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml From inpost at gmail.com Fri Dec 27 04:03:35 2013 From: inpost at gmail.com (e-letter) Date: Fri, 27 Dec 2013 12:03:35 +0000 Subject: [xquery-talk] xpath1 text node contains attribute, equivalent in xpath2 In-Reply-To: <1388136603.21352.236.camel@slave.barefootcomputing.com> References: <1388136603.21352.236.camel@slave.barefootcomputing.com> Message-ID: On 27/12/2013, Liam R E Quin wrote: > On Fri, 2013-12-27 at 09:20 +0000, e-letter wrote: >> Xpath1 specification ? 4.2 string functions >> (http://www.w3.org/TR/xpath/#section-String-Functions) describes a >> "contains" function, but this was not found in xpath2; > > Better to use the XPath 2 Functions and Operators spec, which does > indeed list fn:contains(). > { let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title[fn:contains(.,'Learning XML')]/parent::* return $x } returns: ...

Learning XML Erik T. Ray 2003 39.95

... Why is the full stop applied before the comma, because this is not specified as an option in the specification about 'fn:contains'? >> Is it possible to remove the xml elements from the output file? > > Change return $x to return $x/text() maybe > Not quite, returns: ...

... if 'return' is changed to 'return $x/element()', the result is as 'return $x', but interestingly a removal of new line white space. From CMisztur at macleanfogg.com Fri Dec 27 08:02:07 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Fri, 27 Dec 2013 16:02:07 +0000 Subject: [xquery-talk] xpath1 text node contains attribute, equivalent in xpath2 In-Reply-To: References: <1388136603.21352.236.camel@slave.barefootcomputing.com> Message-ID: <7AC1D93CF590E5458FCE12A130606357153A94A0@us09exm01.MacLean-Fogg.com> The period '.' in contains() means that you are passing the current sequence item (aka context) into the contains() function. Imagine that query [1] is actually doing a for-each loop on each and the predicate in square brackets is applying a 'where' statement on each iteration. You can also rewrite query [1] as query [3]. Your other query [2] returned multiple items or a sequence of strings. You did not specify a predicate / selection criteria so you got an 'array' of strings. [1] fn:doc("xmldatabasefile.xml")/bookstore/book/title[fn:contains(.,'Learning XML')] [2] fn:doc("xmldatabasefile.xml")/bookstore/book/title/text() [3] for $book-title in doc('xmldatabasefile.xml')/bookstore/book/title Where contains($book-title/text(), 'Learning XML') Return $book-title/text() -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of e-letter Sent: Friday, December 27, 2013 6:04 AM To: liam at w3.org Cc: talk at x-query.com Subject: Re: [xquery-talk] xpath1 text node contains attribute, equivalent in xpath2 On 27/12/2013, Liam R E Quin <liam at w3.org> wrote: > On Fri, 2013-12-27 at 09:20 +0000, e-letter wrote: >> Xpath1 specification ? 4.2 string functions >> (http://www.w3.org/TR/xpath/#section-String-Functions) describes a >> "contains" function, but this was not found in xpath2; > > Better to use the XPath 2 Functions and Operators spec, which does > indeed list fn:contains(). > { let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title[fn:contains(.,'Learning XML')]/parent::* return $x } returns: ...<p> <book category="WEB"> <title lang="en"> Learning XML Erik T. Ray 2003 39.95

... Why is the full stop applied before the comma, because this is not specified as an option in the specification about 'fn:contains'? >> Is it possible to remove the xml elements from the output file? > > Change return $x to return $x/text() maybe > Not quite, returns: ...

... if 'return' is changed to 'return $x/element()', the result is as 'return $x', but interestingly a removal of new line white space. _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail From inpost at gmail.com Fri Dec 27 10:07:30 2013 From: inpost at gmail.com (e-letter) Date: Fri, 27 Dec 2013 18:07:30 +0000 Subject: [xquery-talk] xpath1 text node contains attribute, equivalent in xpath2 In-Reply-To: <7AC1D93CF590E5458FCE12A130606357153A94A0@us09exm01.MacLean-Fogg.com> References: <1388136603.21352.236.camel@slave.barefootcomputing.com> <7AC1D93CF590E5458FCE12A130606357153A94A0@us09exm01.MacLean-Fogg.com> Message-ID: On 27/12/2013, Misztur, Chris wrote: > Imagine that query [1] is actually doing a for-each loop on each > and the predicate in square brackets is applying a 'where' statement on each > iteration. You can also rewrite query [1] as query [3]. > The 'let' clause was chosen because it was not considered necessary to perform any multiple iterations, just a single search for the target. Is this an incorrect thought-process? > [3] for $book-title in doc('xmldatabasefile.xml')/bookstore/book/title > Where contains($book-title/text(), 'Learning XML') > Return $book-title/text() > This is understood, but the request was also to retrieve the text nodes of the parent (and parent siblings - uncles/aunts? or maybe referred to as sibling text nodes? ;) ) elements, i.e.: Learning XML Erik T. Ray 2003 39.95 I am unable to append sucessfully '/parent::*' to the 'for' statement above. From CMisztur at macleanfogg.com Fri Dec 27 11:05:44 2013 From: CMisztur at macleanfogg.com (Misztur, Chris) Date: Fri, 27 Dec 2013 19:05:44 +0000 Subject: [xquery-talk] xpath1 text node contains attribute, equivalent in xpath2 In-Reply-To: <CAET1fe5TCB280mczNiSm2QwNGgkD6BN-Q7WLCdyTiRE5YLvm3w@mail.gmail.com> References: <CAET1fe5TCB280mczNiSm2QwNGgkD6BN-Q7WLCdyTiRE5YLvm3w@mail.gmail.com> Message-ID: <7AC1D93CF590E5458FCE12A130606357153AA7F4@us09exm01.MacLean-Fogg.com> Oh I see what you're trying to do... xquery version "3.0"; let $bookstore := <bookstore> <book category="WEB"> <title lang="en">Learning XML Erik T. Ray 2003 39.95 Best XML book you 2014 1.00
let $my-book := $bookstore/book[contains(./title/text(), "Learning")] (: this works too :) (: let $my-book := $bookstore/book/title[contains(./text(), "Learning")]/.. :) (: let $my-book := $bookstore/book/title[contains(./text(), "Learning")]/parent::* :) (: return

{string-join($my-book/string(), codepoints-to-string(10))}

:) return element table { for $element in $my-book/child::* return element tr { element td { local-name($element)||':' }, element td { $element/text() } } } -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of e-letter Sent: Friday, December 27, 2013 3:20 AM To: talk at x-query.com Subject: [xquery-talk] xpath1 text node contains attribute, equivalent in xpath2 Readers, For an xml file: ... Learning XML Erik T. Ray 2003 39.95 ... An xquery file was created and processed using jedit xml plugins:

{ let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title[contains(text(),'XML')]/parent::* return $x }

Xpath1 specification ? 4.2 string functions (http://www.w3.org/TR/xpath/#section-String-Functions) describes a "contains" function, but this was not found in xpath2; what is the equivalent function in xpath2 please? The resultant output:

Learning XML Erik T. Ray 2003 39.95

Is it possible to remove the xml elements from the output file? An alternative xquery was attempted: ...

{ let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title/text() return $x }

... Resultant output: ...

Everyday Italian Harry Potter XQuery Kick Start Learning XML

... Is it possible to select a specific title text with this xquery syntax? _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk ________________________________ The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. Please consider the environment before printing this e-mail