[xquery-talk] parsing xml fragments
Leo Studer
leo.studer at varioweb.ch
Sun Jun 21 13:15:51 PDT 2015
I think this is a bug of parse-xml-fragment() since the string passed in $feed is a wellformed escaped xml fragment.
The xQuery-processor is trying to replace & by & which makes no sense and produces like that an error ;-(
What do the experts say ?
Blessings
Leo
> On 21.06.2015, at 20:22, Leo Studer <leo.studer at varioweb.ch> wrote:
>
> Yes, $feed contains the expected info, no namespace issue here…
>
> Try it out.
> BaseX does not report an error however the code does not work and Saxon reports
>
> Engine name: Saxon-PE XQuery 9.6.0.5
> Severity: fatal
> Description: FODC0006: First argument to parse-xml-fragment() is not a well-formed and namespace-well-formed XML fragment. XML parser reported: org.xml.sax.SAXParseException: The reference to entity "service" must end with the ';' delimiter.
>
>
>> On 21.06.2015, at 19:10, Dannes Wessels <dannes at exist-db.org <mailto:dannes at exist-db.org>> wrote:
>>
>> Does the doc()//item/... expression return anything? I expect a namespace issue here...
>>
>> Cheers
>>
>> Dannes
>>
>>
>> --
>> www.exist-db.org <http://www.exist-db.org/>
>>
>> On 21 Jun 2015, at 17:15, Leo Studer <leo.studer at varioweb.ch <mailto:leo.studer at varioweb.ch>> wrote:
>>
>>> Hello
>>>
>>> I tried the following
>>>
>>> declare variable $feed := doc("http://www.meteotest.ch/meteotest-extras/rss/rss-sio.xml <http://www.meteotest.ch/meteotest-extras/rss/rss-sio.xml>")//item/description/string();
>>>
>>> <html>
>>> <body>{
>>> parse-xml-fragment($feed)/*}
>>> </body>
>>> </html>
>>>
>>> to use the weather infos from this feed.
>>> Unfortunately parse-xml-fragment($feed) does not work since & is used in a URL. Is there a easy way to do that?
>>>
>>> Thanks in advance
>>> Leo
>>> _______________________________________________
>>> talk at x-query.com <mailto:talk at x-query.com>
>>> http://x-query.com/mailman/listinfo/talk <http://x-query.com/mailman/listinfo/talk>_______________________________________________
>> talk at x-query.com <mailto:talk at x-query.com>
>> http://x-query.com/mailman/listinfo/talk
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://x-query.com/pipermail/talk/attachments/20150621/6dfbb6e3/attachment.html>
More information about the talk
mailing list