Re: ACTION 614-12: Smart Quotes

We haven’t really discussed this, but I have been assuming this syntax will be XQuery and not XPath.

For XSLT I think the text value templates introduced in XSLT 3.0 meet the requirement, though we haven’t done anything to make it easier to generate content such as CSS with lots of curly braces.

Michael Kay
Saxonica


> On 16 Sep 2015, at 08:10, Abel Braaksma <abel.braaksma@xs4all.nl> wrote:
> 
> 
>> How about <[ ]> <{ }> ? I like the fact that it retains the tradition of using
>> angle brackets for switching between literal text and non-text information.
>> “<[“ has vague connotations of CDATA sections, and <{ retains the “{“ which
>> is associated with embedded expressions elsewhere in the language. And it’s
>> visually clear.
>> 
>> let $json := <[ { “name”: { “first”:<{ $first }>,  “last”:<{ $last }> } ]>
>> 
> 
> If used in an XML context, i.e. in XSLT with XP31, this would become
> 
> let $json := &lt;[ { “name”: { “first”: &lt;{ $first }>,  “last”: &lt;{ $last }> } ]>
> 
> I didn't see a decision in the minutes from yesterday, so I'm going to assume that the discussion is still open? If not, please ignore... ;)
> 
> Even if the syntax is going to be proposed only for XQ, it stands to reason that at some point it will adapted by XSLT processors, perhaps as a user option to support this syntax. It would be awkward to have the angle brackets syntax there.
> 
> What about a simpler syntax? I like the C# style with @"....". Quotes need to be escaped in C# with double quotes. But if we were to use @"..."@ such escaping is not needed. We could use the #-symbol for expressions inside the string. It is not as ubiquitous in json, css and other languages as $ or {. A # would open and close an expression, a double hash would be an escape. Since @ is only used with a following EQName, I think this can be made sound in EBNF.
> 
> This does not have the visual appearance of balancing brackets/parentheses, but still it stands out strong enough.
> 
> Another variant you may want to consider is a variant of the smiley-syntax. Something like (=....=). The equal sign has the mnemonic of "assign", it is balanced, easy to remember, and the current rules for places where the equal sign can be used is never just before or after a parenthesis.
> 
> Both these approaches are easy to type with any western or non-western keyboard.
> 
> Cheers,
> Abel 
> 
> 
> 
> 

Received on Wednesday, 16 September 2015 07:54:05 UTC