[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

[Summary] Why does validation fail with a named ENTITY for carriageretur

  • 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

[Summary] Why does validation fail with a named ENTITY for carriageretur
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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.