Re: ACTION 614-12: Smart Quotes

Even if it is XQuery only, is putting HTML in a smart quote a valid use case?  I randomly selected 8 web pages that came to mind and searched the source for the string “]>”.  5 out of 8 pages had “]>” in the source.

One page had something like this:

    <script type="text/javascript">/*<![CDATA[ ……. ]> */</script>

The other occurrences were things like this:

    <!--[if gt IE 8]>...

In such cases, the string “]>” would need to be escaped.  

Thanks,
Josh
   

> On Sep 16, 2015, at 4:42 AM, Michael Kay <mike@saxonica.com> wrote:
> 
> 
>> On 16 Sep 2015, at 11:41, Abel Braaksma <abel.braaksma@xs4all.nl> wrote:
>> 
>>> 
>>> We haven’t really discussed this, but I have been assuming this syntax will be
>>> XQuery and not XPath.
>> 
>> FWIW, I think it makes sense to make such a fundamental feature (quoted, interpolated strings) part of the XPath core language.
>> 
> 
> 
> I don’t think it’s fundamental, it is fairly cosmetic. And I think the requirements when you’re within the context of an attribute in an XML document are very different from the requirements in XQuery. For example, newlines in XML attributes get corrupted (sorry, “normalized”) by the XML parser, so you would never use them to hold templates for substantial pieces of external content such as parameterised CSS or JSON. In XSLT you would do that in an xsl:variable, something like
> 
> <xsl:variable name=“css”>
>  Some CSS here
> </xsl:variable>
> 
> So whatever we might need for this requirement in XSLT, it doesn’t belong in XPath.
> 
> Michael Kay
> Saxonica

Received on Wednesday, 16 September 2015 14:21:26 UTC