Re: [basex-talk] Writing

2020-06-11 Thread Liam R. E. Quin
On Fri, 2020-06-12 at 03:46 +0200, Giuseppe G. A. Celano wrote:
> Hi,
> 
> I would like to print a comment containing only a dash (i.e.,  >) , but this is not allowed.

This is not permitted in XML; it's a syntax error. A - in a comment
must be followed by a character that is not a hyphen. You can do,

or

but not


There are no tricks or workarounds, it's illegal.

Liam

https://www.w3.org/TR/REC-xml/#sec-comments

-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org



[basex-talk] Writing

2020-06-11 Thread Giuseppe G. A. Celano
Hi,

I would like to print a comment containing only a dash (i.e., ) , but 
this is not allowed. I tried to use "-" instead of - in comment { "-” 
}, but such a string is converted to ‘-', so the error is still there. How can 
I print  ? Should I simply use <->? In any case, I see that 
data() does not convert - into -: how can I get the conversion? 
Thanks.

Best,
Giuseppe

Re: [basex-talk] Writing out

2012-04-17 Thread Christian Grün
> The following function takes a lot of time execute. If I don't write the
> fetched binary image into file with fn:write-binary function, then it is
> quick and no delay.
> Somehow, write-binary function call is killing performance here.

This sounds surprising to me; could you send me the query without the
write-binary function?
Christian


> do you have any other suggestion to solve this performance issue?
>
> declare function local:fetchDigData ($fileName as xs:string,$url as
> xs:string,$binFolder as xs:string) as element()*
> {
>     let $content:=
>         try {
>                 let $uri := fn:encode-for-uri($url)
>             let $content := http:send-request( status-only='false'/>, $url)
>
>             let $res :=
> file:write-binary(fn:concat($binFolder,$fileName),$content[2])
>             return $res
>
>         }
>         catch * {
>             {$err:code, $err:value, " module: ",
>             $err:module, "(", $err:line-number, ",", $err:column-number, "in
> url:",$url,")"}
>         }
>         return $content
> };
>
>
> Erol Akarsu
>
> On Tue, Apr 17, 2012 at 3:34 PM, Christian Grün 
> wrote:
>>
>> > Dow we have equivalent function in basex xquery for java static method
>> > URLEncoder.encode ?
>>
>> ..just try encode-for-uri($uri).
>> Christian
>>
>>
>> > I need it before sending url request,
>> >
>> > Thanks
>> >
>> > Erol Akarsu
>> >
>> >
>> > On Mon, Apr 16, 2012 at 9:32 AM, Dimitar Popov
>> >  wrote:
>> >>
>> >> http://docs.basex.org/wiki/XQuery_3.0#Serialization
>> >>
>> >> On Apr 16, 2012, at 2:25 PM, Erol Akarsu wrote:
>> >>
>> >> I would like to write this line into the beginning of an xml file I am
>> >> generating. This is a must because I am generating csv file in xml form
>> >> that
>> >> should be opened Microsoft Excell.
>> >>
>> >>
>> >> 
>> >>
>> >>
>> >> I tried to use "processing-instruction" like this
>> >>
>> >> processing-instruction {"xml"}  {'version="1.0"'}
>> >>
>> >> But I am getting
>> >>
>> >> Error: [XQDY0064] Processing instruction has illegal name: 'xml'.
>> >>
>> >> Erol Akarsu
>> >>
>> >> On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy 
>> >> wrote:
>> >>>
>> >>> Howdy --
>> >>>
>> >>> The following is arguably a bug in my REST bindings rather than the
>> >>> server, but it worked as of the 7.2 release but fails as of the
>> >>> current
>> >>> 7.2.1 snapshot.
>> >>>
>> >>> A request akin to the following:
>> >>>
>> >>> POST /rest HTTP/1.1
>> >>> Host: 127.0.0.1:8984
>> >>> Content-Length: 86
>> >>> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk=
>> >>> Content-Type: application/x-www-form-urlencoded
>> >>> Accept-Encoding: identity, deflate, compress, gzip
>> >>> Accept: */*
>> >>> User-Agent: python-requests/0.10.6
>> >>>
>> >>> > >>>
>> >>> xmlns:rest="http://basex.org/rest";>1+1
>> >>>
>> >>> Yields the following response:
>> >>>
>> >>> HTTP/1.1 400 Bad Request
>> >>> Content-Length: 40
>> >>> Server: Jetty(6.1.26)
>> >>>
>> >>> Unknown option '> >>>
>> >>> ...but did not do so previously.
>> >>> ___
>> >>> BaseX-Talk mailing list
>> >>> BaseX-Talk@mailman.uni-konstanz.de
>> >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>> >>>
>> >>
>> >> ___
>> >> BaseX-Talk mailing list
>> >> BaseX-Talk@mailman.uni-konstanz.de
>> >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>> >>
>> >>
>> >
>> >
>> > ___
>> > BaseX-Talk mailing list
>> > BaseX-Talk@mailman.uni-konstanz.de
>> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>> >
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Writing out

2012-04-17 Thread Erol Akarsu
Thanks Christian

The following function takes a lot of time execute. If I don't write the
fetched binary image into file with fn:write-binary function, then it is
quick and no delay.
Somehow, write-binary function call is killing performance here.

do you have any other suggestion to solve this performance issue?

declare function local:fetchDigData ($fileName as xs:string,$url as
xs:string,$binFolder as xs:string) as element()*
{
let $content:=
try {
let $uri := fn:encode-for-uri($url)
let $content := http:send-request(, $url)

let $res :=
file:write-binary(fn:concat($binFolder,$fileName),$content[2])
return $res

}
catch * {
{$err:code, $err:value, " module: ",
$err:module, "(", $err:line-number, ",", $err:column-number,
"in url:",$url,")"}
}
return $content
};


Erol Akarsu
On Tue, Apr 17, 2012 at 3:34 PM, Christian Grün
wrote:

> > Dow we have equivalent function in basex xquery for java static method
> > URLEncoder.encode ?
>
> ..just try encode-for-uri($uri).
> Christian
>
>
> > I need it before sending url request,
> >
> > Thanks
> >
> > Erol Akarsu
> >
> >
> > On Mon, Apr 16, 2012 at 9:32 AM, Dimitar Popov
> >  wrote:
> >>
> >> http://docs.basex.org/wiki/XQuery_3.0#Serialization
> >>
> >> On Apr 16, 2012, at 2:25 PM, Erol Akarsu wrote:
> >>
> >> I would like to write this line into the beginning of an xml file I am
> >> generating. This is a must because I am generating csv file in xml form
> that
> >> should be opened Microsoft Excell.
> >>
> >>
> >> 
> >>
> >>
> >> I tried to use "processing-instruction" like this
> >>
> >> processing-instruction {"xml"}  {'version="1.0"'}
> >>
> >> But I am getting
> >>
> >> Error: [XQDY0064] Processing instruction has illegal name: 'xml'.
> >>
> >> Erol Akarsu
> >>
> >> On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy 
> wrote:
> >>>
> >>> Howdy --
> >>>
> >>> The following is arguably a bug in my REST bindings rather than the
> >>> server, but it worked as of the 7.2 release but fails as of the current
> >>> 7.2.1 snapshot.
> >>>
> >>> A request akin to the following:
> >>>
> >>> POST /rest HTTP/1.1
> >>> Host: 127.0.0.1:8984
> >>> Content-Length: 86
> >>> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk=
> >>> Content-Type: application/x-www-form-urlencoded
> >>> Accept-Encoding: identity, deflate, compress, gzip
> >>> Accept: */*
> >>> User-Agent: python-requests/0.10.6
> >>>
> >>>  >>> xmlns:rest="http://basex.org/rest
> ">1+1
> >>>
> >>> Yields the following response:
> >>>
> >>> HTTP/1.1 400 Bad Request
> >>> Content-Length: 40
> >>> Server: Jetty(6.1.26)
> >>>
> >>> Unknown option ' >>>
> >>> ...but did not do so previously.
> >>> ___
> >>> BaseX-Talk mailing list
> >>> BaseX-Talk@mailman.uni-konstanz.de
> >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
> >>>
> >>
> >> ___
> >> BaseX-Talk mailing list
> >> BaseX-Talk@mailman.uni-konstanz.de
> >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
> >>
> >>
> >
> >
> > ___
> > BaseX-Talk mailing list
> > BaseX-Talk@mailman.uni-konstanz.de
> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
> >
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Writing out

2012-04-17 Thread Christian Grün
> Dow we have equivalent function in basex xquery for java static method
> URLEncoder.encode ?

..just try encode-for-uri($uri).
Christian


> I need it before sending url request,
>
> Thanks
>
> Erol Akarsu
>
>
> On Mon, Apr 16, 2012 at 9:32 AM, Dimitar Popov
>  wrote:
>>
>> http://docs.basex.org/wiki/XQuery_3.0#Serialization
>>
>> On Apr 16, 2012, at 2:25 PM, Erol Akarsu wrote:
>>
>> I would like to write this line into the beginning of an xml file I am
>> generating. This is a must because I am generating csv file in xml form that
>> should be opened Microsoft Excell.
>>
>>
>> 
>>
>>
>> I tried to use "processing-instruction" like this
>>
>> processing-instruction {"xml"}  {'version="1.0"'}
>>
>> But I am getting
>>
>> Error: [XQDY0064] Processing instruction has illegal name: 'xml'.
>>
>> Erol Akarsu
>>
>> On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy  wrote:
>>>
>>> Howdy --
>>>
>>> The following is arguably a bug in my REST bindings rather than the
>>> server, but it worked as of the 7.2 release but fails as of the current
>>> 7.2.1 snapshot.
>>>
>>> A request akin to the following:
>>>
>>> POST /rest HTTP/1.1
>>> Host: 127.0.0.1:8984
>>> Content-Length: 86
>>> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk=
>>> Content-Type: application/x-www-form-urlencoded
>>> Accept-Encoding: identity, deflate, compress, gzip
>>> Accept: */*
>>> User-Agent: python-requests/0.10.6
>>>
>>> >> xmlns:rest="http://basex.org/rest";>1+1
>>>
>>> Yields the following response:
>>>
>>> HTTP/1.1 400 Bad Request
>>> Content-Length: 40
>>> Server: Jetty(6.1.26)
>>>
>>> Unknown option '>>
>>> ...but did not do so previously.
>>> ___
>>> BaseX-Talk mailing list
>>> BaseX-Talk@mailman.uni-konstanz.de
>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>>>
>>
>> ___
>> BaseX-Talk mailing list
>> BaseX-Talk@mailman.uni-konstanz.de
>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>>
>>
>
>
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Writing out

2012-04-17 Thread Dimitar Popov
Am Dienstag, 17. April 2012, 15:20:02 schrieb Erol Akarsu:
> Thanks Dimitar,
> 
> I have one more question.
> 
> Dow we have equivalent function in basex xquery for java static method
> URLEncoder.encode ?

I'm not aware of such XQuery function - maybe someone else one the ML
would know better. If there isn't, you could very easily create your own by
using the Java binding [1]:

declare namespace enc = "java:java.net.URLEncoder";
enc:encode("test data")

Regards,
Dimitar

[1] http://docs.basex.org/wiki/Java_Bindings

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Writing out

2012-04-17 Thread Erol Akarsu
Thanks Dimitar,

I have one more question.

Dow we have equivalent function in basex xquery for java static method
URLEncoder.encode ?

I need it before sending url request,

Thanks

Erol Akarsu

On Mon, Apr 16, 2012 at 9:32 AM, Dimitar Popov <
dimitar.po...@uni-konstanz.de> wrote:

> http://docs.basex.org/wiki/XQuery_3.0#Serialization
>
> On Apr 16, 2012, at 2:25 PM, Erol Akarsu wrote:
>
> I would like to write this line into the beginning of an xml file I am
> generating. This is a must because I am generating csv file in xml form
> that should be opened Microsoft Excell.
>
>
> 
>
> I tried to use "processing-instruction" like this
>
> processing-instruction {"xml"}  {'version="1.0"'}
>
> But I am getting
>
> Error: [XQDY0064] Processing instruction has illegal name: 'xml'.
>
> Erol Akarsu
>
> On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy  wrote:
>
>> Howdy --
>>
>> The following is arguably a bug in my REST bindings rather than the
>> server, but it worked as of the 7.2 release but fails as of the current
>> 7.2.1 snapshot.
>>
>> A request akin to the following:
>>
>> POST /rest HTTP/1.1
>> Host: 127.0.0.1:8984
>> Content-Length: 86
>> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk=
>> Content-Type: application/x-www-form-urlencoded
>> Accept-Encoding: identity, deflate, compress, gzip
>> Accept: */*
>> User-Agent: python-requests/0.10.6
>>
>> http://basex.org/rest
>> ">1+1
>>
>> Yields the following response:
>>
>> HTTP/1.1 400 Bad Request
>> Content-Length: 40
>> Server: Jetty(6.1.26)
>>
>> Unknown option '>
>> ...but did not do so previously.
>> ___
>> BaseX-Talk mailing list
>> BaseX-Talk@mailman.uni-konstanz.de
>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>>
>>
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Writing out

2012-04-16 Thread Dimitar Popov
http://docs.basex.org/wiki/XQuery_3.0#Serialization

On Apr 16, 2012, at 2:25 PM, Erol Akarsu wrote:

> I would like to write this line into the beginning of an xml file I am 
> generating. This is a must because I am generating csv file in xml form that 
> should be opened Microsoft Excell.
> 
> 
> 
> 
> 
> 
> I tried to use "processing-instruction" like this
> 
> processing-instruction {"xml"}  {'version="1.0"'}
> 
> But I am getting 
> 
> Error: [XQDY0064] Processing instruction has illegal name: 'xml'.
> 
> Erol Akarsu
> 
> On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy  wrote:
> Howdy --
> 
> The following is arguably a bug in my REST bindings rather than the server, 
> but it worked as of the 7.2 release but fails as of the current 7.2.1 
> snapshot.
> 
> A request akin to the following:
> POST /rest HTTP/1.1 
> Host: 127.0.0.1:8984 
> Content-Length: 86 
> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk= 
> Content-Type: application/x-www-form-urlencoded 
> Accept-Encoding: identity, deflate, compress, gzip 
> Accept: */* 
> User-Agent: python-requests/0.10.6 
>  
>  xmlns:rest="http://basex.org/rest";>1+1
> Yields the following response:
> HTTP/1.1 400 Bad Request 
> Content-Length: 40 
> Server: Jetty(6.1.26) 
>  
> Unknown option ' ...but did not do so previously. 
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
> 
> 
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] Writing out

2012-04-16 Thread Erol Akarsu
I would like to write this line into the beginning of an xml file I am
generating. This is a must because I am generating csv file in xml form
that should be opened Microsoft Excell.




I tried to use "processing-instruction" like this

processing-instruction {"xml"}  {'version="1.0"'}

But I am getting

Error: [XQDY0064] Processing instruction has illegal name: 'xml'.

Erol Akarsu

On Mon, Apr 9, 2012 at 8:41 PM, Charles Duffy  wrote:

> Howdy --
>
> The following is arguably a bug in my REST bindings rather than the
> server, but it worked as of the 7.2 release but fails as of the current
> 7.2.1 snapshot.
>
> A request akin to the following:
>
> POST /rest HTTP/1.1
> Host: 127.0.0.1:8984
> Content-Length: 86
> Authorization: Basic cmVhZG9ubHk6cmVhZG9ubHk=
> Content-Type: application/x-www-form-urlencoded
> Accept-Encoding: identity, deflate, compress, gzip
> Accept: */*
> User-Agent: python-requests/0.10.6
>
> http://basex.org/rest
> ">1+1
>
> Yields the following response:
>
> HTTP/1.1 400 Bad Request
> Content-Length: 40
> Server: Jetty(6.1.26)
>
> Unknown option '
> ...but did not do so previously.
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
>
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Writing JDom Elements into BaseX

2012-03-01 Thread Dimitar Popov

On Mar 1, 2012, at 1:53 PM, Kavuma, J.M. wrote:

> Thanks; JDOM seems to be required by one of the additional API libraries 
> (maybe WebDAV?).

Correct. The JDOM library is needed by the Milton WebDAV implementation, which 
we used in basex-api.

Regards,
Dimitar

> The core of BaseX runs without any additional libraries.
> 
>> On Fri, Feb 17, 2012 at 4:52 PM, Kavuma, J.M.  wrote:
>>> Hi Christian,
>>> Thanks for the reply. I browsed the libraries bundle with baseX and 
>>> jdom-1.1 is included. I have attached a snapshot of this.
>>> Martin
>>> 
>>> -Original Message-
>>> From: christian.gr...@gmail.com [mailto:christian.gr...@gmail.com] On 
>>> Behalf Of Christian Grün
>>> Sent: vrijdag 17 februari 2012 16:40
>>> To: Kavuma, J.M.
>>> Subject: Re: Please advise me
>>> 
>>> Hi Martin,
>>> 
 Since baseX uses jdom, I wonder if it is possible to write an xml 
 jdom element or document to baseX. If it is possible could you 
 advise me on how to do this. Thank you in advance.
>>> 
>>> we're having our own storage and main representation of xml data, which is 
>>> why you can't use any jdom connectors. where did you read that we're using 
>>> jdom?
>>> 
>>> Christian
>>> From: Kavuma, J.M. 
>>> Sent: vrijdag 17 februari 2012 16:30
>>> To: 'c...@basex.org'
>>> Subject: Please advise me
>>> 
>>> Hello Christian,
>>> I start by thanking you for your informative examples. I though find myself 
>>> in a tricky situation.
>>> I am using the jdom library to create xml elements that I would like to 
>>> write into the baseX database directly. In your examples I see you use a 
>>> string for example "Hello Universe!", of which you extract the bytes 
>>> that are then written to stream.
>>> Since baseX uses jdom, I wonder if it is possible to write an xml jdom 
>>> element or document to baseX. If it is possible could you advise me on how 
>>> to do this. Thank you in advance.
>>> Best regards,
>>> Martin
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] Writing JDom Elements into BaseX

2012-03-01 Thread Kavuma, J.M.

 Thanks; JDOM seems to be required by one of the additional API libraries 
(maybe WebDAV?). The core of BaseX runs without any additional libraries.

> On Fri, Feb 17, 2012 at 4:52 PM, Kavuma, J.M.  wrote:
>> Hi Christian,
>> Thanks for the reply. I browsed the libraries bundle with baseX and jdom-1.1 
>> is included. I have attached a snapshot of this.
>> Martin
>>
>> -Original Message-
>> From: christian.gr...@gmail.com [mailto:christian.gr...@gmail.com] On 
>> Behalf Of Christian Grün
>> Sent: vrijdag 17 februari 2012 16:40
>> To: Kavuma, J.M.
>> Subject: Re: Please advise me
>>
>> Hi Martin,
>>
>>> Since baseX uses jdom, I wonder if it is possible to write an xml 
>>> jdom element or document to baseX. If it is possible could you 
>>> advise me on how to do this. Thank you in advance.
>>
>> we're having our own storage and main representation of xml data, which is 
>> why you can't use any jdom connectors. where did you read that we're using 
>> jdom?
>>
>> Christian
>> From: Kavuma, J.M. 
>> Sent: vrijdag 17 februari 2012 16:30
>> To: 'c...@basex.org'
>> Subject: Please advise me
>>
>> Hello Christian,
>> I start by thanking you for your informative examples. I though find myself 
>> in a tricky situation.
>> I am using the jdom library to create xml elements that I would like to 
>> write into the baseX database directly. In your examples I see you use a 
>> string for example "Hello Universe!", of which you extract the bytes 
>> that are then written to stream.
>> Since baseX uses jdom, I wonder if it is possible to write an xml jdom 
>> element or document to baseX. If it is possible could you advise me on how 
>> to do this. Thank you in advance.
>> Best regards,
>> Martin
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk