Problem with attribute parsing?
Hello I was doing some experiments and I ended up with this: let $c := <Class Source='{ttt'></Class> return $c/@Source When this is compiled in the BaseX GUI app, an error message ensues: Error: Stopped at ... /file3, 1/30: [XPST0003] Expecting '}', found '''. Query: let $c := <Class Source='{ttt'></Class> return $c/@Source Query plan: <QueryPlan compiled="false" updating="false"/> Surely that is not correct? If I add a } there, everything is fine: let $c := <Class Source='{ttt}'></Class> return $c/@Source I don't think there is an XML requirement forcing escaping start brace ('{') inside an attribute value? I know that XQuery supports <X A='{...}' /> where the inside of the {} is evaluated to give the value for the A attribute, but the example above is not XQuery, just an XML literal. I am sure I would have noticed this if it were a general problem. Best Regards Peter Villadsen Principal Architect Microsoft Business Applications Group
On Sun, 2020-04-05 at 22:21 +0000, Peter Villadsen wrote:
Hello
I was doing some experiments and I ended up with this:
let $c := <Class Source='{ttt'></Class>
This is an error because the braces surround expresions: <Class Source='{ concat("t", "ttt") }'> would work. Similarly you can write <boy>{ concat('dirt', 'noise') }</boy> of course. Liam -- 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
participants (2)
-
Liam R. E. Quin -
Peter Villadsen