[basex-talk] Using BaseX as a standalone xquery library in Java

2014-02-18 Thread Johan Mörén
Anything special to think about when using BaseX outside the database-context? I have built some solutions using the QueryProcessor for generating filesystem reports using the supplied modules for calculating file-sizes and checksums. I hava also built a number of wrappers for calling and

Re: [basex-talk] Using BaseX as a standalone xquery library in Java

2014-02-18 Thread Christian Grün
Hi Johan, Anything special to think about when using BaseX outside the database-context? Thanks for the kudos and for describing your use case. It's perfectly fine to BaseX outside the database context! I'm aware of many scenarios, in which BaseX is used without databases, or in which the data

[basex-talk] Sought: a pattern of file:list usage

2014-02-18 Thread Hans-Juergen Rennau
Dear BaseX team, perhaps you have a recommendation concerning the use of the file module. The issue at hand is this. The function file:list (like any function in the file module, per EXPath specification) resolves relative paths against the current working directory. But the fn:doc function,

Re: [basex-talk] Sought: a pattern of file:list usage

2014-02-18 Thread Christian Grün
Dear Hans-Jürgen, This is how you can list all files in the directory of your query file: let $dir := file:parent(static-base-uri()) for $file in file:list($dir) return $dir || $file And this is how you can find out the current working directory: file:parent('.') Does this help?

Re: [basex-talk] Using BaseX as a standalone xquery library in Java

2014-02-18 Thread Hans-Juergen Rennau
Hi Johan, here comes an example of user experience. For many years I have used XQuery exclusively with the Saxon processor. I could not imagine that any other processor might offer comparable reliability, conformance and performance. But about three years ago I started to use BaseX, too - in

Re: [basex-talk] Sought: a pattern of file:list usage

2014-02-18 Thread Hans-Juergen Rennau
Oh, this greatly helped indeed! I was not aware of file:parent. I conclude that an application which expects external input for both, fn:doc and file:list, has the choice between two ways of providing consistent resolution of relative paths: (a) always resolve against tool location: when

Re: [basex-talk] Sought: a pattern of file:list usage

2014-02-18 Thread Christian Grün
On a Windows system, file:parent returns a path with backslashes. When supplying this as second argument to fn:resolve-uri, an error occurs: resolve-uri('abc.xml',file:parent('.')) = [FORG0002] URI argument is invalid: C:\user\ptools\. This should help: resolve-uri('abc.xml',

Re: [basex-talk] Sought: a pattern of file:list usage

2014-02-18 Thread Hans-Juergen Rennau
I correct myself - probably one should use file:path-to-uri(file:parent('.')) rather than replace(file:parent('.'),'\\', '/') in order to make the result of file:parent('.') usable in fn:resolve-uri. Come to think of it - maybe a convenience function 'file:current-dir()' (=

Re: [basex-talk] Sought: a pattern of file:list usage

2014-02-18 Thread Christian Grün
Come to think of it - maybe a convenience function 'file:current-dir()' (= file:parent('.')) would be worthwhile, considering the importance of the current directory. True; maybe we could add even two functions... file:current-dir() file:base-dir() ...as in many cases it's also

Re: [basex-talk] Sought: a pattern of file:list usage

2014-02-18 Thread Christian Grün
Helpful input! I'll propose it to the EXPath list. Christian On Tue, Feb 18, 2014 at 1:29 PM, Hans-Juergen Rennau hren...@yahoo.de wrote: This makes very much sense to me, as these two functions deliver exactly the two alternatives for normalization (current working dir and tool dir).

[basex-talk] issue with HTML:parse

2014-02-18 Thread Sophie Petit
Dear BaseX team, I'm using BaseX for my studies with Xavier-Laurent Salvador from Paris13. I've got a puzzling issue with html:parse. I'm trying the request below using html:parse in order to get a list of the urls from a webpage and I'm getting this message error: Ligne 19: Invalid character

Re: [basex-talk] issue with HTML:parse

2014-02-18 Thread Christian Grün
Dear Sophie, I assume that TagSoup is missing in your BaseX classpath. TagSoup is responsible for converting HTML pages to XML (see [1] for more details). By calling html:parser(), you can find out if HTML can be correctly converted [2]. By the way, the following query is an alternative solution

Re: [basex-talk] Revisiting XMLPrague

2014-02-18 Thread Lars Johnsen
It was great meeting so many of the BaseX developers. I especially appreciated all the help with the distinction between Semmelknödel vs. Serviettenknödel! Thanks again for a great time in Prague Lars National Library of Norway 2014-02-17 18:29 GMT+01:00 Christian Grün

[basex-talk] fn:doc-available()

2014-02-18 Thread Hans-Juergen Rennau
Dear BaseX team, I am puzzled by the behaviour of fn:doc-available when applied to a zip file: doc-available('/user/xsd/niem-2.1.zip') yields this error: [BXDB0006] Database path '/user/xsd/niem-2.1.zip' yields no documents. Kind regards, Hans-Juergen

Re: [basex-talk] fn:doc-available()

2014-02-18 Thread Christian Grün
Hi Hans-Jürgen, I am puzzled by the behaviour of fn:doc-available when applied to a zip file: doc-available('/user/xsd/niem-2.1.zip') yields this error: [BXDB0006] Database path '/user/xsd/niem-2.1.zip' yields no documents. I tried to reproduce this behavior; could you please tell me what