There seems to be problem with cookie-param when the cookie is NOT set. The
error is
[XPDY0002] No value assigned to $c.
See code below for an example.
I understand the restxq stuff is in development/experimental and I wonder
what plans you have in that direction?
I think there are issues/limitations with the url limited to restxq/ and
that xqm can be accessed directly (as text) etc, but one limitation of the
spec seems to be that one can read a named header or cookie ( chosen at
design time ) but not list all headers in the request.
I wonder if an extension to get the full serialization of the request in
the http:send-request response format might be useful. e.g.
%rest:request("{$req}")
/Andy
declare %rest:path("/showcookie")
%output:method("xhtml")
%rest:cookie-param("abc","{$c}","a")
%rest:query-param("answer", "{$answer}", 42, 43, 44)
function test:showcookie($c,$answer)
{
<rest:response>
<http:response status="200" />
</rest:response>,
<div>showcookie *{$c}*
<div>answer *{$answer}*</div>
</div>
};
declare %rest:path("/redirect2")
%output:method("xhtml")
function test:redirect2()
{
<rest:response>
<http:response status="301" >
<http:header name="Location" value="
http://localhost:8984/restxq/showcookie"/>
<http:header name="Set-Cookie" value="abc=cookme"/>
</http:response>
</rest:response>
};
Is there a way to parse html file located in local hard drive?
Http module of xquery is fantastic, you can retrieve any url content.
but I have already html file locally and need to parse. Can I do it
http://docs.basex.org/wiki/HTTP_Module
I would like to do this successfully:
let $l := http:send-request(<http:request method='get'
status-only='false'/>, 'file:///D:/tmp/b000187585.htm')
return $l
Thanks
Erol Akarsu
On Tue, May 1, 2012 at 5:24 PM, Christian Grün <christian.gruen(a)gmail.com>wrote:
> ...by the way, you can also use our own map implementation to store
> key/value pairs in XQuery:
>
> http://docs.basex.org/wiki/Map_Module
> ___________________________
>
> On Tue, May 1, 2012 at 11:22 PM, Christian Grün
> <christian.gruen(a)gmail.com> wrote:
> >> I am having problem in making new of Properties object.
> >
> > Thanks; this has been fixed in the latest snapshot, which I've just
> uploaded.
> > Christian
> > __________________________________
> >
> >> Query: declare namespace system = "java:java.lang.System";
> >> declare namespace fis = "java:java.io.FileInputStream";
> >> declare namespace p = "java:java.util.Properties";
> >>
> >> let $a := 555
> >> return <a>{(p:new ())}</a>
> >> Error: Improper use? Potential bug? Your feedback is welcome:
> >> Contact: basex-talk(a)mailman.uni-konstanz.de
> >> Version: BaseX 7.2.1
> >> Java: Sun Microsystems Inc., 1.6.0_22
> >> OS: Windows XP, x86
> >> Stack Trace:
> >> java.lang.RuntimeException: {}
> >> org.basex.util.Util.notexpected(Util.java:55)
> >> org.basex.query.item.FuncType.cast(FuncType.java:88)
> >> org.basex.query.func.JavaMapping.toValue(JavaMapping.java:102)
> >> org.basex.query.func.JavaMapping.value(JavaMapping.java:77)
> >> org.basex.query.func.JavaMapping.iter(JavaMapping.java:67)
> >> org.basex.query.QueryContext.iter(QueryContext.java:275)
> >> org.basex.query.expr.Constr.add(Constr.java:62)
> >> org.basex.query.expr.CElem.item(CElem.java:82)
> >> org.basex.query.expr.CElem.item(CElem.java:1)
> >> org.basex.query.expr.CFrag.item(CFrag.java:1)
> >> org.basex.query.expr.ParseExpr.iter(ParseExpr.java:42)
> >> org.basex.query.QueryContext.iter(QueryContext.java:275)
> >> org.basex.query.QueryContext.iter(QueryContext.java:229)
> >> org.basex.query.QueryContext.execute(QueryContext.java:448)
> >> org.basex.query.QueryProcessor.execute(QueryProcessor.java:94)
> >> org.basex.core.cmd.AQuery.query(AQuery.java:86)
> >> org.basex.core.cmd.XQuery.run(XQuery.java:22)
> >> org.basex.core.Command.run(Command.java:325)
> >> org.basex.core.Command.exec(Command.java:304)
> >> org.basex.core.Command.execute(Command.java:76)
> >> org.basex.gui.GUI.exec(GUI.java:390)
> >> org.basex.gui.GUI$6.run(GUI.java:342)
> >>
> >>
> >> Erol Akarsu
> >>
> >> On Mon, Apr 30, 2012 at 3:49 PM, Christian Grün <
> christian.gruen(a)gmail.com>
> >> wrote:
> >>>
> >>> > The new XQJ does not support xquery 3.0 syntax. That is why I have
> >>> > facing
> >>> > issue.
> >>>
> >>> Right, thanks for the update. A future version of XQJ will support all
> >>> current BaseX language features, such as XQuery 3.0 and the Update and
> >>> Full-Text and map extensions. Once again, feel free to ask Charles
> >>> Foster for his timeline (the more feedback he gets, the faster it
> >>> might get implemented).
> >>>
> >>> > How can I use 721 basex with old XQJ?
> >>>
> >>> I'm sorry that's not possible, as we have removed all links to XQJ
> >>> from our core.
> >>>
> >>> Christian
> >>
> >>
>