- 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>
<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>
<para>Generally, an <acronym>XHTML</acronym> page should have
@ -186,13 +186,13 @@
<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>
</sect2>
@ -459,10 +459,6 @@
</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>
</tr>

View file

@ -813,18 +813,18 @@ example.xml:5: element head: validity error : Element head content does not foll
<example>
<title>XML Generic Comment</title>
<programlisting>&lt;!-- test comment --></programlisting>
<programlisting>&lt;!-- test comment --&gt;</programlisting>
<programlisting><![CDATA[
<!-- This is inside the comment -->
<programlisting>
&lt;!-- This is inside the comment --&gt;
<!-- This is another comment -->
&lt;!-- This is another comment --&gt;
<!-- This is one way
of doing multiline comments -->
&lt;!-- This is one way
of doing multiline comments --&gt;
<!-- This is another way of --
-- doing multiline comments -->]]></programlisting>
&lt;!-- This is another way of --
-- doing multiline comments --&gt;]]></programlisting>
</example>
<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>
<title>Erroneous XML Comments</title>
<programlisting><![CDATA[
<!-- This is in the comment --
<programlisting>
&lt;!-- This is in 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
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
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
comments like that.</para>
<programlisting><![CDATA[<!--===================================================-->]]></programlisting>
<programlisting>&lt;!--===================================================--&gt;</programlisting>
<para>That is a (slightly) better approach, but it still
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>
<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" [
<!ENTITY % param.some "some">
<!ENTITY % param.text "text">
<!ENTITY % param.new "%param.some more %param.text">
&lt;!ENTITY % param.some "some"&gt;
&lt;!ENTITY % param.text "text"&gt;
&lt;!ENTITY % param.new "%param.some more %param.text"&gt;
<!-- %param.new now contains "some more text" -->
]>]]></programlisting>
&lt;!-- %param.new now contains "some more text" --&gt;
</programlisting>
</example>
<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
<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" [
<!ENTITY version "1.1">
]>
&lt;!ENTITY version "1.1"&gt;
]&gt;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>An Example XHTML File</title>
</head>
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;An Example XHTML File&lt;/title&gt;
&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>
<p>This is a paragraph containing some text.</p>
&lt;body&gt;
&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>
</body>
</html>]]></programlisting>
&lt;p&gt;The current version of this document is: &amp;version;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</programlisting>
</step>
<step>
@ -1110,21 +1110,21 @@ example.xml:5: element head: validity error : Element head content does not foll
<example>
<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" [
<!ENTITY chapter.1 SYSTEM "chapter1.xml">
<!ENTITY chapter.2 SYSTEM "chapter2.xml">
<!ENTITY chapter.3 SYSTEM "chapter3.xml">
<!-- And so forth -->
]>
&lt;!ENTITY chapter.1 SYSTEM "chapter1.xml"&gt;
&lt;!ENTITY chapter.2 SYSTEM "chapter2.xml"&gt;
&lt;!ENTITY chapter.3 SYSTEM "chapter3.xml"&gt;
&lt;!-- And so forth --&gt;
]&gt;
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Use the entities to load in the chapters -->
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;!-- Use the entities to load in the chapters --&gt;
&chapter.1;
&chapter.2;
&chapter.3;
</html>]]></programlisting>
&amp;chapter.1;
&amp;chapter.2;
&amp;chapter.3;
&lt;/html&gt;</programlisting>
</example>
<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
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" [
<!-- Define a parameter entity to load in the chapter general entities -->
<!ENTITY % chapters SYSTEM "chapters.ent">
&lt;!-- Define a parameter entity to load in the chapter general entities --&gt;
&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;
]>
]&gt;
<html xmlns="http://www.w3.org/1999/xhtml">
&chapter.1;
&chapter.2;
&chapter.3;
</html>]]></programlisting>
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&amp;chapter.1;
&amp;chapter.2;
&amp;chapter.3;
&lt;/html&gt;</programlisting>
</example>
</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
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" [
<!ENTITY version "1.1">
<!ENTITY para1 SYSTEM "para1.xml">
<!ENTITY para2 SYSTEM "para2.xml">
<!ENTITY para3 SYSTEM "para3.xml">
]>
&lt;!ENTITY version "1.1"&gt;
&lt;!ENTITY para1 SYSTEM "para1.xml"&gt;
&lt;!ENTITY para2 SYSTEM "para2.xml"&gt;
&lt;!ENTITY para3 SYSTEM "para3.xml"&gt;
]&gt;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>An Example XHTML File</title>
</head>
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;An Example XHTML File&lt;/title&gt;
&lt;/head&gt;
<body>
<p>The current version of this document is: &version;</p>
&lt;body&gt;
&lt;p&gt;The current version of this document is: &amp;version;&lt;/p&gt;
&para1;
&para2;
&para3;
</body>
</html>]]></programlisting>
&amp;para1;
&amp;para2;
&amp;para3;
&lt;/body&gt;
&lt;/html&gt;</programlisting>
</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
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" [
<!ENTITY % entities SYSTEM "entities.ent"> %entities;
]>
&lt;!ENTITY % entities SYSTEM "entities.ent"&gt; %entities;
]&gt;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>An Example XHTML File</title>
</head>
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;An Example XHTML File&lt;/title&gt;
&lt;/head&gt;
<body>
<p>The current version of this document is: &version;</p>
&lt;body&gt;
&lt;p&gt;The current version of this document is: &amp;version;&lt;/p&gt;
&para1;
&para2;
&para3;
</body>
</html>]]></programlisting>
&amp;para1;
&amp;para2;
&amp;para3;
&lt;/body&gt;
&lt;/html&gt;</programlisting>
</step>
<step>