← Prev in month ← Prev in thread

Invalid Markup in External DTD conditionals

From
Daniel Murphy <>
To
Date
2023-07-25T00:14:08Z
ID
<>
Thread
Invalid Markup in External DTD conditionals
Hello all,

If I look at the XML conformance tests, I can find the test with the ID 
ibm-valid-P65-ibm65v02.xml has the below external DTD

<?xml version="1.0" encoding='UTF-8'?>
<!--dtd for production 65-->
<![IGNORE[
this is some stringwithout brackets
<![
<!ELEMENT animal EMPTY>
]]>
this is another string without brackets
]]>
<!--Positive test. Pattern2-->

This is in line with the spec, which has the below definition

[61]       conditionalSect       ::= includeSect | ignoreSect
[62]       includeSect           ::=       '<![' S? 'INCLUDE' S? '[' 
extSubsetDecl ']]>'     [VC: Proper Conditional Section/PE Nesting]
[63]       ignoreSect            ::=       '<![' S? 'IGNORE' S? '[' 
ignoreSectContents* ']]>'    [VC: Proper Conditional Section/PE Nesting]
[64]       ignoreSectContents    ::=       Ignore ('<![' 
ignoreSectContents ']]>' Ignore)*
[65]       Ignore                ::=       Char* - (Char* ('<![' | 
']]>') Char*)

"Validity constraint: Proper Conditional Section/PE Nesting

If any of the "<![", "[", or "]]>" of a conditional section is contained 
in the replacement text for a parameter-entity reference, all of them 
MUST be contained in the same replacement text."

My question is: Why is the ignore section not expected to be valid 
declarations like an <![INCLUDE[]]> section? I mean, if you have to 
check the IgnoreSection of a DTD anyway to ensure that the <![ and ]]> 
are all correct, it seems a bit of a waste to have to implement 
dedicated parsing rules for something you are going to be discarding 
regardless. Is this a holdover from SGML? Or was there some other 
motiviation?

Just curiosity really; would be interested to learn more about XMLs history.

Thanks in advance,

Regards,

Daniel
← Prev in month ← Prev in thread