[xquery-talk] parsing xml fragments

Leo Studer leo.studer at varioweb.ch
Sun Jun 21 13:33:39 PDT 2015


Hi George

thanks for your thoughts. 
I thought the same in the beginning. And when you look in the source $feed there it is escaped but parse-xml-fragment does the mess…

Always
Leo


> On 21.06.2015, at 22:27, George Bina <george at oxygenxml.com> wrote:
> 
> Hi Leo,
> 
> You have ampersand unescaped:
> 
> <img src="https://mdx.meteotest.ch/api_v1?key=A8FEFD4159D9934E4808641EE063254F&service=prod2data...
> 
> and thus the content is not XML wellformed, the parser thinks that you have a service entity because it sees &service= and thus it expects a ; after service.
> 
> You should escape & to &
> 
> Best Regards,
> George
> --
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
> 
> On 21/06/15 19:15, Leo Studer wrote:
>> Hello
>> 
>> I tried the following
>> 
>> *declare variable
>> **$feed*:=/doc/("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?




More information about the talk mailing list