Quantcast

Import module from URI (eXist 1.4.0)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Import module from URI (eXist 1.4.0)

exist_newbie
Hello,

Accordingly to the specs (http://www.w3.org/TR/xquery/), the import module syntax is:
"import" "module" ("namespace" NCName "=")? URILiteral ("at" URILiteral ("," URILiteral)*)?
and the URI should always be escaped (from my knowledge)...

However, when I'm trying to import an xQuery module from a file URI using the following syntax:
import module namespace initializer="init" at "file:/C:/Program%20Files/MyApplicationPath/init.xq";
I get the following error:
Failed to invoke method query in class org.exist.xmlrpc.RpcConnection: org.exist.xquery.XPathException: error found while loading module initializer: source for module 'init' not found at 'file:/C:/Program%20Files/MyApplicationPath/init.xq': cannot read module source from file at C:/Program%20Files/MyApplicationPath/init.xq.  
When providing the unescaped URI:
import module namespace initializer="init" at "file:/C:/Program Files/MyApplicationPath/init.xq";
the module import is correctly done...

Is eXist not able to import modules from URIs unless they are explicitly unescaped or am I missing something? Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Import module from URI (eXist 1.4.0)

Dannes Wessels-3

On 27 Jul 2011, at 17:36 , exist_newbie wrote:

Is eXist not able to import modules from URIs unless they are explicitly
unescaped or am I missing something? Thanks! 

please could you rewrite your mail without some of the markups? There are quite some "/"-es and it reads  "file:/C:/*Program Files*/MyApplicationPath/init.xq";/ ; that is with "*"  (asterisks) in the pattern ; making your mail very difficult to understand….

cheers

Dannes

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Import module from URI (eXist 1.4.0)

exist_newbie
This post was updated on .
What I mean is that:

import module namespace initializer="init" at "file:/C:/Program%20Files/MyApplicationPath/init.xq";

seems to follow the specs, but it doesn't work, while:

import module namespace initializer="init" at "file:/C:/Program Files/MyApplicationPath/init.xq";

works, but doesn't seem to respect the specs, because the URI is not escaped (the URI is not obtained using String concatenation etc, but using File.toURI().toString())...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Import module from URI (eXist 1.4.0)

Dannes Wessels-3

On 27 Jul 2011, at 20:44 , exist_newbie wrote:

works, but doesn't seem to respect the specs, because the URI is not escaped
(the URI is not obtained using String concatenation etc, but using
File.toURI().toString())...

hmmm you might be right here :-) Well lots of development has done since 1.4.0 (1.4.1 will be released verrrrrry soon), you might want to recheck it on the pre-release 1.4.1 (see our wiki). The codebase will not really change until the "final" version…..

regards

Dannes

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Import module from URI (eXist 1.4.0)

exist_newbie
And how the file URI should be constructed on Linux, to be accepted?

Because:
import module namespace initializer="init" at "file:/opt/MyApplicationPath/init.xq";
is definitely NOT working...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Import module from URI (eXist 1.4.0)

Dmitriy Shabanov
On 7/28/11, exist_newbie <[hidden email]> wrote:
> And how the file URI should be constructed on Linux, to be accepted?
>
> Because:
> import module namespace initializer="init" at
> "file:/opt/MyApplicationPath/init.xq";

try "/opt/MyApplicationPath/init.xq"

--
Dmitriy Shabanov

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Import module from URI (eXist 1.4.0)

exist_newbie
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Import module from URI (eXist 1.4.0)

Adam Retter
In reply to this post by exist_newbie
> Accordingly to the specs (/http://www.w3.org/TR/xquery//), the import module
> syntax is:
> /"import" "module" ("namespace" NCName "=")? URILiteral ("at" URILiteral
> ("," URILiteral)*)?/
> and the URI should always be escaped (from my knowledge)...

URILiteral just says that the at expression must contain a valid URI,
this does not specify which schemes it must support. The schemes
supported are implementation defined. So whether an implementation
supports file:// or http:// is really up to the implementor and not
the spec.

> However, when I'm trying to import an xQuery module from a file URI using
> the following syntax:
> /import module namespace initializer="init" at
> "file:/C:/*Program%20Files*/MyApplicationPath/init.xq";/

try "file:///C:/*Program%20Files*/MyApplicationPath/init.xq"

> I get the following error:
> /Failed to invoke method query in class org.exist.xmlrpc.RpcConnection:
> org.exist.xquery.XPathException: error found while loading module
> initializer: source for module 'init' not found at
> 'file:/C:/Program%20Files/MyApplicationPath/init.xq': cannot read module
> source from file at C:/Program%20Files/MyApplicationPath/init.xq. /
> When providing the unescaped URI:
> /import module namespace initializer="init" at "file:/C:/*Program
> Files*/MyApplicationPath/init.xq";/
> the module import is correctly done...
>
> Is eXist not able to import modules from URIs unless they are explicitly
> unescaped or am I missing something? Thanks!
>
>
> --
> View this message in context: http://exist.2174344.n4.nabble.com/Import-module-from-URI-eXist-1-4-0-tp3698904p3698904.html
> Sent from the exist-open mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Got Input?   Slashdot Needs You.
> Take our quick survey online.  Come on, we don't ask for help often.
> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> http://p.sf.net/sfu/slashdot-survey
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>



--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...