Re: [basex-talk] Invoking database update from RESTXQ
Hi Lars, are you annotating your RESTXQ endpoints with %updating? F.i.: declare %rest:path('/somepath') *%updating* function _:update() { updates ... }; Cheers, Lukas On Tue, Mar 3, 2015 at 10:36 AM, Lars Johnsen yoon...@gmail.com wrote: Hello all I was wondering how to perform database updating, like db:add, in RESTXQ, since the adding and updating functions throw errors when invoked inside functions defined in RESTXQ-modules. Have been trying to use the forward mechanism, transferring the data to a script without functions, with no success. Best, Lars G Johnsen
[basex-talk] Handling special characters
Hi, I need to be able write some special characters into output xml file. I have HTTML3 characters like #961; (phase), #916; (delta) in XML. But they are printed into xml file as expanded as amp; They was being written as amp;#961; and amp;#916; But I want #961; and #916; How can I do it? Thanks Erol Akarsu
Re: [basex-talk] Handling special characters
I think I need one thing. How can I convert an HTML3 code to proper form? Let's say I have the number 174 and like convert it to form #174; (don't want amp;#174;) how can I get it? On Tue, Mar 3, 2015 at 3:48 PM, Erol Akarsu eaka...@gmail.com wrote: Hi, I need to be able write some special characters into output xml file. I have HTTML3 characters like #961; (phase), #916; (delta) in XML. But they are printed into xml file as expanded as amp; They was being written as amp;#961; and amp;#916; But I want #961; and #916; How can I do it? Thanks Erol Akarsu
[basex-talk] Invoking database update from RESTXQ
Hello all I was wondering how to perform database updating, like db:add, in RESTXQ, since the adding and updating functions throw errors when invoked inside functions defined in RESTXQ-modules. Have been trying to use the forward mechanism, transferring the data to a script without functions, with no success. Best, Lars G Johnsen
Re: [basex-talk] Comparing NxDs
Hi Mansi, adding to the excellent advice given by Christian and Marco I would like to add two points: 1. I guess you could turn the question around: Why would you store your XML data in a relational database? To me it feels the most natural thing to store XML (or in general hierarchical data) in an XML database like BaseX, to store JSON data in a json database like MongoDB and table-like data in a relational database like Oracle and DB2. Of course, there are also other technical reasons why you might want to use a more mature system like DB2, but also non-technical reasons, for example a deep knowledge of your employees with SQL. 2. Choosing a database system is not just a technical, but also a business decision. So one point for this to keep in mind: Systems like DB2 and Oracle aren't cheap, I am sure the folks at IBM and Oracle will tell you that. On the other hand, BaseX is open-source (but provides commercial support). Of course, there are also many other open-source dbms like Postgres. Cheers Dirk On 03/01/2015 02:36 PM, Marco Lettere wrote: Hi Mansi, my 2 cents here are mainly that none of the RDBMS based solution deliver the full support of the complete stack of XML technologies to their complete power (XPath, XQuery 3.x, XSLT, XSD, eXPath , aso). As far as I remember you can hardly find HTTP server functionality with RestXQ support there too. As soon as you have to write an application or service of a respectable complexity you will nee all of those functionalities. Another point to use here, at least with BaseX, is the footprint of the application. I don't know how large DB2 is but for sure installing, managing and using PostgreSQL is several levels of complexity higher than using BaseX. Finally I also think that for implementing a really performing tree based database the relational technology is not suited and a proper datamodel is required but I don't have figures or demonstrations for that so I'm also very curious to see those performance comparison results! :-D Hope this helps somehow. Greetings, Marco. On 28/02/2015 12:11, Christian Grün wrote: Hi Mansi, No one answered so far, so there is probably no simple answer to your question. As you indicated, many relational DBMS (such as DB2 and PostgreSQL) provide support for XPath as well, but in most cases, the systems do not create additional index structures on top of the XML nodes to speed up querying. However, as the queries you presented on the mailing list are simple XPath expressions, there are probably not so many chances to benefit from values index structures anyway. If teams in your companies are trying DB2 and PostgreSQL anyway, I'll be looking forward to hearing more about their experiences. Commercial systems often disallow their users to publish performance results (and presenting them on the list is some way of publishing them), so you can also send them to me privately. If you go for PostgreSQL, this won't be a problem of course. Hope this helps, Christian -- Dirk Kirsten, BaseX GmbH, http://basexgmbh.de |-- 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
[basex-talk] XSLT transformations in BaseX with XSLTforms fails
Hello! I try to transform XForms with XSLTforms with the xslt module in BaseX but fail. I use the examples given by XSLTForms which work in the browser. My xslt:processor() gives 'Java' and xslt:version() gives '1.0'. The error message I get is: *type* Status report *message* _Stopped at /usr/share/tomcat/webapps/BaseX80-20150207.113013/hans.xq, 242/23: [bxerr:BXSL0001] ERROR: 'Could not compile stylesheet' FATAL ERROR: 'Error checking type of the expression 'FilterParentPath(variable-ref(profiler0/result-tree), step(child, 1))'.' :Error checking type of the expression 'FilterParentPath(variable-ref(profiler0/result-tree), step(child, 1))'. Stack Trace: - /usr/share/tomcat/webapps/BaseX80-20150207.113013/hans.xq, 165/10_ *description* _The request sent by the client was syntactically incorrect._ My XQuery looks like this: declare %rest:path(hans/xforms) %rest:GET %output:method(text) function hans:xforms() { let $page := html xmlns=http://www.w3.org/1999/xhtml; xmlns:xf=http://www.w3.org/2002/xforms; head titleMany to one/title xf:model ... snip ... /html return xslt:transform($page, 'static/xsltforms/xsltforms/xsltforms.xsl') }; The only difference between the input given in the function and the one given at http://www.agencexml.com/xsltforms/incremental.xml is the removal of two processing instruments: ?xml-stylesheet href=xsltforms/xsltforms.xsl type=text/xsl? ?xsltforms-options debug=yes? What could be the source of this error? How should I continue debugging this? Best wishes Kristian Kankainen
Re: [basex-talk] Invoking database update from RESTXQ
Hi, it works for me when the XQuery module resides in the repo folder, and the RESTXQ function only calls it inside restxq module import module namespace coll = http://foo.org/collections;; coll:new(some-db) inside repo module declare updating function _:new($name as xs:string) { let $foo := bar/ return db:create($name, concat(/Some/Path/, $foo, $name, .xml) ) }; 2015-03-03 10:36 GMT+01:00 Lars Johnsen yoon...@gmail.com: Hello all I was wondering how to perform database updating, like db:add, in RESTXQ, since the adding and updating functions throw errors when invoked inside functions defined in RESTXQ-modules. Have been trying to use the forward mechanism, transferring the data to a script without functions, with no success. Best, Lars G Johnsen