Writing <!----->
Friday, 12 June 2020 · 2 messages
GC
Giuseppe G. A. Celano12 Jun 2020 03:46 #
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
LQ
Liam R. E. Quin12 Jun 2020 06:26 #
Quoted text · Giuseppe G. A. Celano · 5 lines
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
Written for BaseX 9.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery