Invalid Markup in External DTD conditionals

Daniel Murphy <[email protected]> Tue, 25 Jul 2023 01:14:08 +0100
Newsgroups gmane.text.xml.devel
Message-ID <[email protected]>
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


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: [email protected]
subscribe: [email protected]
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php