Hi, I would like to print a comment containing only a dash (i.e., <!----->) , but this is not allowed. I tried to use "-" instead of - in comment { "-” }, but such a string is converted to ‘-', so the error is still there. How can I print <!-----> ? Should I simply use <----->? In any case, I see that data(<!----->) does not convert - into -: how can I get the conversion? Thanks. Best, Giuseppe
On Fri, 2020-06-12 at 03:46 +0200, Giuseppe G. A. Celano wrote:
Hi,
I would like to print a comment containing only a dash (i.e., <!-----
) , but this is not allowed.
This is not permitted in XML; it's a syntax error. A - in a comment must be followed by a character that is not a hyphen. You can do, <!--- --> or <!-- - --> but not <!-----> There are no tricks or workarounds, it's illegal. Liam https://www.w3.org/TR/REC-xml/#sec-comments -- 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)
-
Giuseppe G. A. Celano -
Liam R. E. Quin