- Avoid comments in CDATA, which the DB 5.0 converter does not handle

This commit is contained in:
Gabor Kovesdan 2013-07-05 18:30:43 +00:00
parent bbdf6ab008
commit d3645b9d4e
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/projects/db5/; revision=42160
2 changed files with 99 additions and 103 deletions

View file

@ -153,21 +153,21 @@
<para>Usage:</para> <para>Usage:</para>
<programlisting><![CDATA[<h1>First section</h1> <programlisting>&lt;h1&gt;First section&lt;/h1&gt;
<!-- Document introduction goes here --> &lt;!-- Document introduction goes here --&gt;
<h2>This is the heading for the first section</h2> &lt;h2&gt;This is the heading for the first section&lt;/h2&gt;
<!-- Content for the first section goes here --> &lt;!-- Content for the first section goes here --&gt;
<h3>This is the heading for the first sub-section</h3> &lt;h3&gt;This is the heading for the first sub-section&lt;/h3&gt;
<!-- Content for the first sub-section goes here --> &lt;!-- Content for the first sub-section goes here --&gt;
<h2>This is the heading for the second section</h2> &lt;h2&gt;This is the heading for the second section&lt;/h2&gt;
<!-- Content for the second section goes here -->]]></programlisting> &lt;!-- Content for the second section goes here --&gt;</programlisting>
</example> </example>
<para>Generally, an <acronym>XHTML</acronym> page should have <para>Generally, an <acronym>XHTML</acronym> page should have
@ -186,13 +186,13 @@
<para>Usage:</para> <para>Usage:</para>
<programlisting><![CDATA[<h1>First section</h1> <programlisting>&lt;h1&gt;First section&lt;/h1&gt;
<!-- Document introduction --> &lt;!-- Document introduction --&gt;
<h3>Sub-section</h3> &lt;h3&gt;Sub-section&lt;/h3&gt;
<!-- This is bad, <h2> has been left out -->]]></programlisting> &lt;!-- This is bad, &lt;h2&gt; has been left out --&gt;</programlisting>
</example> </example>
</sect2> </sect2>
@ -459,10 +459,6 @@
</tr> </tr>
<tr> <tr>
<!-- Because the large cell on the left merges into
this row, the first <td> will occur on its
right -->
<td>Middle right cell</td> <td>Middle right cell</td>
</tr> </tr>

View file

@ -813,18 +813,18 @@ example.xml:5: element head: validity error : Element head content does not foll
<example> <example>
<title>XML Generic Comment</title> <title>XML Generic Comment</title>
<programlisting>&lt;!-- test comment --></programlisting> <programlisting>&lt;!-- test comment --&gt;</programlisting>
<programlisting><![CDATA[ <programlisting>
<!-- This is inside the comment --> &lt;!-- This is inside the comment --&gt;
<!-- This is another comment --> &lt;!-- This is another comment --&gt;
<!-- This is one way &lt;!-- This is one way
of doing multiline comments --> of doing multiline comments --&gt;
<!-- This is another way of -- &lt;!-- This is another way of --
-- doing multiline comments -->]]></programlisting> -- doing multiline comments --&gt;]]></programlisting>
</example> </example>
<para>If you have used XHTML before you may have been shown <para>If you have used XHTML before you may have been shown
@ -841,12 +841,12 @@ example.xml:5: element head: validity error : Element head content does not foll
<example> <example>
<title>Erroneous XML Comments</title> <title>Erroneous XML Comments</title>
<programlisting><![CDATA[ <programlisting>
<!-- This is in the comment -- &lt;!-- This is in the comment --
THIS IS OUTSIDE THE COMMENT! THIS IS OUTSIDE THE COMMENT!
-- back inside the comment -->]]></programlisting> -- back inside the comment --&gt;</programlisting>
<para>The XML parser will treat this as though it were <para>The XML parser will treat this as though it were
actually:</para> actually:</para>
@ -856,12 +856,12 @@ example.xml:5: element head: validity error : Element head content does not foll
<para>This is not valid XML, and may give confusing error <para>This is not valid XML, and may give confusing error
messages.</para> messages.</para>
<programlisting><![CDATA[<!--------------- This is a very bad idea --------------->]]></programlisting> <programlisting>&lt;!--------------- This is a very bad idea ---------------&gt;</programlisting>
<para>As the example suggests, <emphasis>do not</emphasis> write <para>As the example suggests, <emphasis>do not</emphasis> write
comments like that.</para> comments like that.</para>
<programlisting><![CDATA[<!--===================================================-->]]></programlisting> <programlisting>&lt;!--===================================================--&gt;</programlisting>
<para>That is a (slightly) better approach, but it still <para>That is a (slightly) better approach, but it still
potentially confusing to people new to XML.</para> potentially confusing to people new to XML.</para>
@ -992,14 +992,14 @@ example.xml:5: element head: validity error : Element head content does not foll
<example> <example>
<title>Defining Parameter Entities</title> <title>Defining Parameter Entities</title>
<programlisting><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <programlisting>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!ENTITY % param.some "some"> &lt;!ENTITY % param.some "some"&gt;
<!ENTITY % param.text "text"> &lt;!ENTITY % param.text "text"&gt;
<!ENTITY % param.new "%param.some more %param.text"> &lt;!ENTITY % param.new "%param.some more %param.text"&gt;
<!-- %param.new now contains "some more text" --> &lt;!-- %param.new now contains "some more text" --&gt;
]>]]></programlisting> </programlisting>
</example> </example>
<para>This may not seem particularly useful. It will be.</para> <para>This may not seem particularly useful. It will be.</para>
@ -1013,28 +1013,28 @@ example.xml:5: element head: validity error : Element head content does not foll
<para>Add a general entity to <para>Add a general entity to
<filename>example.xml</filename>.</para> <filename>example.xml</filename>.</para>
<programlisting><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <programlisting>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!ENTITY version "1.1"> &lt;!ENTITY version "1.1"&gt;
]> ]&gt;
<html xmlns="http://www.w3.org/1999/xhtml"> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head> &lt;head&gt;
<title>An Example XHTML File</title> &lt;title&gt;An Example XHTML File&lt;/title&gt;
</head> &lt;/head&gt;
<!-- You might well have some comments in here as well --> &lt;!-- You might well have some comments in here as well --&gt;
<body> &lt;body&gt;
<p>This is a paragraph containing some text.</p> &lt;p&gt;This is a paragraph containing some text.&lt;/p&gt;
<p>This paragraph contains some more text.</p> &lt;p&gt;This paragraph contains some more text.&lt;/p&gt;
<p align="right">This paragraph might be right-justified.</p> &lt;p align="right"&gt;This paragraph might be right-justified.&lt;/p&gt;
<p>The current version of this document is: &version;</p> &lt;p&gt;The current version of this document is: &amp;version;&lt;/p&gt;
</body> &lt;/body&gt;
</html>]]></programlisting> &lt;/html&gt;</programlisting>
</step> </step>
<step> <step>
@ -1110,21 +1110,21 @@ example.xml:5: element head: validity error : Element head content does not foll
<example> <example>
<title>Using General Entities to Include Files</title> <title>Using General Entities to Include Files</title>
<programlisting><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <programlisting>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!ENTITY chapter.1 SYSTEM "chapter1.xml"> &lt;!ENTITY chapter.1 SYSTEM "chapter1.xml"&gt;
<!ENTITY chapter.2 SYSTEM "chapter2.xml"> &lt;!ENTITY chapter.2 SYSTEM "chapter2.xml"&gt;
<!ENTITY chapter.3 SYSTEM "chapter3.xml"> &lt;!ENTITY chapter.3 SYSTEM "chapter3.xml"&gt;
<!-- And so forth --> &lt;!-- And so forth --&gt;
]> ]&gt;
<html xmlns="http://www.w3.org/1999/xhtml"> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
<!-- Use the entities to load in the chapters --> &lt;!-- Use the entities to load in the chapters --&gt;
&chapter.1; &amp;chapter.1;
&chapter.2; &amp;chapter.2;
&chapter.3; &amp;chapter.3;
</html>]]></programlisting> &lt;/html&gt;</programlisting>
</example> </example>
<warning> <warning>
@ -1177,20 +1177,20 @@ example.xml:5: element head: validity error : Element head content does not foll
entities available for use. Then use the general entities entities available for use. Then use the general entities
as before:</para> as before:</para>
<programlisting><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <programlisting>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!-- Define a parameter entity to load in the chapter general entities --> &lt;!-- Define a parameter entity to load in the chapter general entities --&gt;
<!ENTITY % chapters SYSTEM "chapters.ent"> &lt;!ENTITY % chapters SYSTEM "chapters.ent"&gt;
<!-- Now use the parameter entity to load in this file --> &lt;!-- Now use the parameter entity to load in this file --&gt;
%chapters; %chapters;
]> ]&gt;
<html xmlns="http://www.w3.org/1999/xhtml"> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&chapter.1; &amp;chapter.1;
&chapter.2; &amp;chapter.2;
&chapter.3; &amp;chapter.3;
</html>]]></programlisting> &lt;/html&gt;</programlisting>
</example> </example>
</sect2> </sect2>
@ -1216,27 +1216,27 @@ example.xml:5: element head: validity error : Element head content does not foll
<para>Edit <filename>example.xml</filename> so that it <para>Edit <filename>example.xml</filename> so that it
looks like this:</para> looks like this:</para>
<programlisting><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <programlisting>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!ENTITY version "1.1"> &lt;!ENTITY version "1.1"&gt;
<!ENTITY para1 SYSTEM "para1.xml"> &lt;!ENTITY para1 SYSTEM "para1.xml"&gt;
<!ENTITY para2 SYSTEM "para2.xml"> &lt;!ENTITY para2 SYSTEM "para2.xml"&gt;
<!ENTITY para3 SYSTEM "para3.xml"> &lt;!ENTITY para3 SYSTEM "para3.xml"&gt;
]> ]&gt;
<html xmlns="http://www.w3.org/1999/xhtml"> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head> &lt;head&gt;
<title>An Example XHTML File</title> &lt;title&gt;An Example XHTML File&lt;/title&gt;
</head> &lt;/head&gt;
<body> &lt;body&gt;
<p>The current version of this document is: &version;</p> &lt;p&gt;The current version of this document is: &amp;version;&lt;/p&gt;
&para1; &amp;para1;
&para2; &amp;para2;
&para3; &amp;para3;
</body> &lt;/body&gt;
</html>]]></programlisting> &lt;/html&gt;</programlisting>
</step> </step>
<step> <step>
@ -1268,24 +1268,24 @@ example.xml:5: element head: validity error : Element head content does not foll
<para>Edit <filename>example.xml</filename> so that it <para>Edit <filename>example.xml</filename> so that it
looks like this:</para> looks like this:</para>
<programlisting><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <programlisting>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!ENTITY % entities SYSTEM "entities.ent"> %entities; &lt;!ENTITY % entities SYSTEM "entities.ent"&gt; %entities;
]> ]&gt;
<html xmlns="http://www.w3.org/1999/xhtml"> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head> &lt;head&gt;
<title>An Example XHTML File</title> &lt;title&gt;An Example XHTML File&lt;/title&gt;
</head> &lt;/head&gt;
<body> &lt;body&gt;
<p>The current version of this document is: &version;</p> &lt;p&gt;The current version of this document is: &amp;version;&lt;/p&gt;
&para1; &amp;para1;
&para2; &amp;para2;
&para3; &amp;para3;
</body> &lt;/body&gt;
</html>]]></programlisting> &lt;/html&gt;</programlisting>
</step> </step>
<step> <step>