Bug 204893

Summary: [patch] FDP, section 7.6.2: Wrong example for defining parameter entities
Product: Documentation Reporter: Andreas Perstinger <andipersti>
Component: Books & ArticlesAssignee: Sevan Janiyan <sevan>
Status: Closed FIXED    
Severity: Affects Many People CC: sevan
Priority: --- Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://reviews.freebsd.org/D16680
Attachments:
Description Flags
Replace example for defining parameter entities none

Description Andreas Perstinger 2015-11-29 09:41:43 UTC
In section 7.6.2 ("Parameter Entities") of the FDP (https://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/xml-primer-entities.html#xml-primer-parameter-entities) the example given is wrong. The XML standard doesn't allow references to parameter entities within markup declarations in an internal subset of the DTD (see http://www.w3.org/TR/2006/REC-xml11-20060816/#wfc-PEinInternalSubset). Thus, the line 5 in the example (<!ENTITY % param.new "%param.some more %param.text">) is not well-formed XML. (The delimiting semicolons are also missing in both references.) 

I suggest to replace that example with a more realistic one like

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!ENTITY % entity "<!ENTITY version '1.0'>">
<!-- use the parameter entity -->
%entity;
]>

(The attached patch also fixes a typo and adds a sentence about the usefulness of parameter entities.)
Comment 1 Andreas Perstinger 2015-11-29 09:42:37 UTC
Created attachment 163647 [details]
Replace example for defining parameter entities
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-08-11 15:52:40 UTC
A commit references this bug:

Author: sevan
Date: Sat Aug 11 15:52:26 UTC 2018
New revision: 52103
URL: https://svnweb.freebsd.org/changeset/doc/52103

Log:
  Example snippet uses invalid syntax which creates errors when used in a doc.
  Fix spelling mistake while here.

  PR:		204893
  Submitted by:	Andreas Perstinger <andipersti at gmail>
  Approved by:	bcr (mentor) rene
  Differential Revision:	https://reviews.freebsd.org/D16680

Changes:
  head/en_US.ISO8859-1/books/fdp-primer/xml-primer/chapter.xml
Comment 3 Sevan Janiyan freebsd_committer freebsd_triage 2018-08-11 16:02:27 UTC
Greeting from Essen Hackathon!
Thank you for the patch & appologies it took so long to get it into the tree.