Re: [basex-talk] Cannot instantiate java.net.URLEncoder

2014-07-30 Thread Dirk Kirsten
We are not responsible for weird Java design decisions ;-) On 30/07/14 18:36, Marc van Grootel wrote: > Hi Dirk, > > Great. What a weird asymmetry though. At least there's a way to call it. > Thanks. > > --Marc > > > On Wed, Jul 30, 2014 at 6:25 PM, Dirk Kirsten wrote: > >> Hello Marc, >> >>

Re: [basex-talk] Cannot instantiate java.net.URLEncoder

2014-07-30 Thread Marc van Grootel
Hi Dirk, Great. What a weird asymmetry though. At least there's a way to call it. Thanks. --Marc On Wed, Jul 30, 2014 at 6:25 PM, Dirk Kirsten wrote: > Hello Marc, > > URLEncoder has no public constructor, URLDecoder has. Using import to > bind to Java, BaseX tries to create a new instance, w

Re: [basex-talk] Cannot instantiate java.net.URLEncoder

2014-07-30 Thread Dirk Kirsten
Hello Marc, URLEncoder has no public constructor, URLDecoder has. Using import to bind to Java, BaseX tries to create a new instance, which is not possible without a constructor. Use declare, i.e. declare namespace encoder = "java:java.net.URLEncoder"; to access static methods. Cheers, Dirk

[basex-talk] Cannot instantiate java.net.URLEncoder

2014-07-30 Thread Marc van Grootel
Hi, What could be the reason that importing java.net.URLDecoder works as expected but doing the same with java.net.URLEncoder doesn't. The following works: import module namespace decoder = "java.net.URLDecoder"; decoder:decode('foo/bar%20baz') => 'foo/bar baz' This gives a "Could not in