[rfc-i] CDATA, was: Fwd: New Version Notification for draft-hoffman-xml2rfc-06.txt

Tony Hansen tony at att.com
Tue Apr 29 08:44:29 PDT 2014


On 4/29/14, 4:11 AM, Julian Reschke wrote:
> On 2014-04-28 21:34, Tony Hansen wrote:
>> On 4/28/14, 2:16 PM, Paul Hoffman wrote:
>>> Greetings again. As always, thanks for the input on the v3 draft. The
>>> changes include:
>>> ...
>>> - Pointing out that artwork that contains the string "]]>" also needs
>>> to be protected in a CDATA structure
>>
>> Good start on this. Unfortunately, it's a bit more tricky than you
>> describe.
>>
>> The string "]]>" is problematic both in and out of a CDATA structure.
>> The string is not allowed in XML and is a terminator for CDATA, so it
>> cannot exist either place.
>
> That is true, but I don't think it's really relevant here.
>
> People who use CDATA frequently think "anything can go in here", and 
> it's good to warn that this is not the case.

This is the issue I'm trying to address. The text in the document states 
that a ]]> needs to be put into a CDATA block in order to be expressed. 
This is false.

Here are suggested wording changes:

Section 2.5 <artwork>:

    If the artwork includes either "&" or "<" characters, or the string
    "]]>" those characters need to be encoded using escaping or CDATA block(s).
    See <sourcecode> (Section 2.49) for a fuller description of these solutions.


     I also added a target to the <sourcecode> reference.

Section  2.49 <sourcecode>:

    A common problem authors have with <sourcecode> is that the XML
    processor returns errors if the text in the artwork contains either
    the "&" or "<" character, or the string "]]>".  To avoid these
    problems, the "&" and "<" characters may be escaped using the strings
    "&" and "<", respectively. Alternatively, they may be
    surrounded in a CDATA structure: "<![CDATA[]]>".  For example:

    <sourcecode>
    <![CDATA[allowed-chars = "." | "," | "&" | "<" | ">" | "|"]]>
    </sourcecode>

    The string "]]>" MUST be escaped, as in "]]>", or expressed in
    multiple CDATA structures.

	<![CDATA[Dealing with "]]]><![CDATA[&" is tricky.]]>


Tony Hansen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rfc-editor.org/pipermail/rfc-interest/attachments/20140429/1c0a91b1/attachment.html>


More information about the rfc-interest mailing list