[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: Question about the erratum E15
  • From: Takahide Muramoto <murah@f...>
  • Date: Wed, 23 Jan 2002 15:01:54 +0900

I have a question about E15 in XML 1.0 Second Edition Specification
Errata.

I don't know whether correctly I understood the second sentence of
the numbered paragraph 2 in the Element valid VC ; "Note that a
CDATA section ..."

I tried validating the following samples. Please check the results.

Thanks.



sample 1:
   <!DOCTYPE sec [
     <!ELEMENT sec (title, para)>
     <!ELEMENT title (#PCDATA)>
     <!ELEMENT para (#PCDATA)>
   ]>
   <sec>
     <![CDATA[ ]]>
     <title>CData Section</title>
     <para>This is a sample.</para>
   </sec>

     -> It is invalid, since the white space doesn't match S.


sample 2:
   <!DOCTYPE sec [
     <!ELEMENT sec (title, para)>
     <!ELEMENT title (#PCDATA)>
     <!ELEMENT para (#PCDATA)>
     <!ENTITY ent " ">
   ]>
   <sec>
     <![CDATA[&ent;]]>
     <title>CData Section</title>
     <para>This is a sample.</para>
   </sec>

     -> It is valid, since its replacement text matches S.


sample 3:
   <!DOCTYPE sec [
     <!ELEMENT sec (title, para)>
     <!ELEMENT title (#PCDATA)>
     <!ELEMENT para (#PCDATA)>
     <!ENTITY ent "&#38;#x20;">
   ]>
   <sec>
     <![CDATA[&ent;]]>
     <title>CData Section</title>
     <para>This is a sample.</para>
   </sec>

     -> It is invalid, since its replacement text doesn't match S.


sample 4:
   <!DOCTYPE sec [
     <!ELEMENT sec (title, para)>
     <!ELEMENT title (#PCDATA)>
     <!ELEMENT para (#PCDATA)>
     <!ENTITY ent "&#x20;">
   ]>
   <sec>
     <![CDATA[&ent;]]>
     <title>CData Section</title>
     <para>This is a sample.</para>
   </sec>

     -> It is valid, since its replacement text matches S.


sample 5:
   <!DOCTYPE sec [
     <!ELEMENT sec (title, para)>
     <!ELEMENT title (#PCDATA)>
     <!ELEMENT para (#PCDATA)>
   ]>
   <sec>
     <![CDATA[]]>
     <title>CData Section</title>
     <para>This is a sample.</para>
   </sec>

     -> It is invalid, since the empty string doesn't match S.


sample 6:
   <!DOCTYPE sec [
     <!ELEMENT sec (title, para)>
     <!ELEMENT title (#PCDATA)>
     <!ELEMENT para (#PCDATA)>
   ]>
   <sec>
     <![CDATA[test]]>
     <title>CData Section</title>
     <para>This is a sample.</para>
   </sec>

     -> It is invalid, since the string doesn't match S.


sample 7:
   <!DOCTYPE sec [
     <!ELEMENT sec (title, para)>
     <!ELEMENT title (#PCDATA)>
     <!ELEMENT para (#PCDATA)>
   ]>
   <sec>
     <![CDATA[<!-- test -->]]>
     <title>CData Section</title>
     <para>This is a sample.</para>
   </sec>

     -> It is invalid, since the string doesn't match S.


sample 8:
   <!DOCTYPE sec [
     <!ELEMENT sec (title, para)>
     <!ELEMENT title (#PCDATA)>
     <!ELEMENT para (#PCDATA)>
   ]>
   <sec>
     <![CDATA[<?test1 test2?>]]>
     <title>CData Section</title>
     <para>This is a sample.</para>
   </sec>

     -> It is invalid, since the string doesn't match S.

---
Takahide Muramoto <murah@f...>
Fujitsu Ltd. 


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member