Re: apostroph in group-separator (@xxforms:format)

Posted by Erik Bruchez on
URL: https://discuss.orbeon.com/apostroph-in-group-separator-xxforms-format-tp32790p32797.html

 > but I receive always "unmatched expression" : the ' cannot be
 > escaped and there is no way of calling a variable as in xslt...

Apostrophes cannot be escaped in XPath 1.0, but in XPath 2.0, you
simply double it, e.g. you can write something like:

   translate(..., ',', '''')

A precision as some may be confused: after all, why doesn't '
escape the apostrophe? Well, it's just that ' is an XML character
entity, and it is escaped during *XML parsing*. So after your XForms
page is loaded, the XForms engine just sees an attribute which
contains some apostrophe characters, and has no idea that some were
initially written literally, and others written as '. You could
even write the apostrophe as a numeric character entity (') and
it would not make a difference.

The content of the attribute is then passed to an XPath engine, which
really has nothing to do with the XML syntax anymore. The XPath engine
just sees a bunch of characters that it tries to analyze as a valid
XPath 2.0 expression. This explains why escaping an apostrophe in an
XPath string is a feature of the XPath language, and not a feature of
XML.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws