XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[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?

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 "&#13;&#10;">

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 "&#38;#13;&#38;#10;">

Note: do *not* escape the ampersand with &amp;

/Roger


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS