From d3645b9d4e579848048c132a6761f58adb034c46 Mon Sep 17 00:00:00 2001 From: Gabor Kovesdan Date: Fri, 5 Jul 2013 18:30:43 +0000 Subject: [PATCH] - Avoid comments in CDATA, which the DB 5.0 converter does not handle --- .../books/fdp-primer/xhtml-markup/chapter.xml | 28 ++- .../books/fdp-primer/xml-primer/chapter.xml | 174 +++++++++--------- 2 files changed, 99 insertions(+), 103 deletions(-) diff --git a/en_US.ISO8859-1/books/fdp-primer/xhtml-markup/chapter.xml b/en_US.ISO8859-1/books/fdp-primer/xhtml-markup/chapter.xml index 43e0f8adbe..cb7aa0e13a 100644 --- a/en_US.ISO8859-1/books/fdp-primer/xhtml-markup/chapter.xml +++ b/en_US.ISO8859-1/books/fdp-primer/xhtml-markup/chapter.xml @@ -153,21 +153,21 @@ Usage: - First section + <h1>First section</h1> - +<!-- Document introduction goes here --> -

This is the heading for the first section

+<h2>This is the heading for the first section</h2> - +<!-- Content for the first section goes here --> -

This is the heading for the first sub-section

+<h3>This is the heading for the first sub-section</h3> - +<!-- Content for the first sub-section goes here --> -

This is the heading for the second section

+<h2>This is the heading for the second section</h2> -]]>
+<!-- Content for the second section goes here -->
Generally, an XHTML page should have @@ -186,13 +186,13 @@ Usage: - First section + <h1>First section</h1> - +<!-- Document introduction --> -

Sub-section

+<h3>Sub-section</h3> -]]>
+<!-- This is bad, <h2> has been left out -->
@@ -459,10 +459,6 @@ - - Middle right cell diff --git a/en_US.ISO8859-1/books/fdp-primer/xml-primer/chapter.xml b/en_US.ISO8859-1/books/fdp-primer/xml-primer/chapter.xml index 53098b1911..745bcdb16f 100644 --- a/en_US.ISO8859-1/books/fdp-primer/xml-primer/chapter.xml +++ b/en_US.ISO8859-1/books/fdp-primer/xml-primer/chapter.xml @@ -813,18 +813,18 @@ example.xml:5: element head: validity error : Element head content does not foll XML Generic Comment - <!-- test comment --> + <!-- test comment --> - + +<!-- This is inside the comment --> - +<!-- This is another comment --> - +<!-- This is one way + of doing multiline comments --> -]]> +<!-- This is another way of -- + -- doing multiline comments -->]]> 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 Erroneous XML Comments - +<!-- This is in the comment -- THIS IS OUTSIDE THE COMMENT! - -- back inside the comment -->]]> + -- back inside the comment --> The XML parser will treat this as though it were actually: @@ -856,12 +856,12 @@ example.xml:5: element head: validity error : Element head content does not foll This is not valid XML, and may give confusing error messages. - ]]> + <!--------------- This is a very bad idea ---------------> As the example suggests, do not write comments like that. - ]]> + <!--===================================================--> That is a (slightly) better approach, but it still potentially confusing to people new to XML. @@ -992,14 +992,14 @@ example.xml:5: element head: validity error : Element head content does not foll Defining Parameter Entities - <!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"> - -]>]]> +<!-- %param.new now contains "some more text" --> + This may not seem particularly useful. It will be. @@ -1013,28 +1013,28 @@ example.xml:5: element head: validity error : Element head content does not foll Add a general entity to example.xml. - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ - -]> +<!ENTITY version "1.1"> +]> - - - An Example XHTML File - +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>An Example XHTML File</title> + </head> - + <!-- You might well have some comments in here as well --> - -

This is a paragraph containing some text.

+ <body> + <p>This is a paragraph containing some text.</p> -

This paragraph contains some more text.

+ <p>This paragraph contains some more text.</p> -

This paragraph might be right-justified.

+ <p align="right">This paragraph might be right-justified.</p> -

The current version of this document is: &version;

- -]]>
+ <p>The current version of this document is: &version;</p> + </body> +</html> @@ -1110,21 +1110,21 @@ example.xml:5: element head: validity error : Element head content does not foll Using General Entities to Include Files - <!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 --> +]> - - +<html xmlns="http://www.w3.org/1999/xhtml"> + <!-- Use the entities to load in the chapters --> - &chapter.1; - &chapter.2; - &chapter.3; -]]> + &chapter.1; + &chapter.2; + &chapter.3; +</html> @@ -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:
- <!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"> - +<!-- Now use the parameter entity to load in this file --> %chapters; -]> +]> - - &chapter.1; - &chapter.2; - &chapter.3; -]]> +<html xmlns="http://www.w3.org/1999/xhtml"> + &chapter.1; + &chapter.2; + &chapter.3; +</html> @@ -1216,27 +1216,27 @@ example.xml:5: element head: validity error : Element head content does not foll Edit example.xml so that it looks like this: - <!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"> +]> - - - An Example XHTML File - +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>An Example XHTML File</title> + </head> - -

The current version of this document is: &version;

+ <body> + <p>The current version of this document is: &version;</p> - ¶1; - ¶2; - ¶3; - -]]>
+ &para1; + &para2; + &para3; + </body> +</html> @@ -1268,24 +1268,24 @@ example.xml:5: element head: validity error : Element head content does not foll Edit example.xml so that it looks like this: - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ - %entities; -]> +<!ENTITY % entities SYSTEM "entities.ent"> %entities; +]> - - - An Example XHTML File - +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>An Example XHTML File</title> + </head> - -

The current version of this document is: &version;

+ <body> + <p>The current version of this document is: &version;</p> - ¶1; - ¶2; - ¶3; - -]]>
+ &para1; + &para2; + &para3; + </body> +</html>