[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
[Summary] Why does validation fail with a named ENTITY for carriagereturn and line feed?
- From: "Costello, Roger L." <costello@mitre.org>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Wed, 24 Oct 2012 18:10:21 +0000
Hi Folks,
Thanks Martin, John, David, and Pete for the excellent inputs.
Here is a summary of the issue and its solution.
---------
ISSUE
---------
For reuse you create an ENTITY for carriage return (decimal 13) followed by line feed (decimal 10):
<!ENTITY CRLF " ">
There are multiple XML Schema pattern facets where you use the ENTITY:
<xs:pattern value="... &CRLF; ..."/>
However, due to Attribute Value Normalization, that ENTITY will get converted to two spaces, which is not what we want (we want carriage return followed by line feed).
How do we retain the carriage return and line feed?
-------------
SOLUTION
-------------
In the ENTITY declaration escape the ampersand, using its decimal (38) value:
<!ENTITY CRLF "&#13;&#10;">
Note: do *not* escape the ampersand with &
/Roger
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]