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]
RE: [xml-dev] Why does validation fail with a named ENTITY forcarriage return and line feed?

Martin Honnen wrote:

>  I think you would need
>        <!ENTITY CRLF "&#38;#13;&#38;#10;">
>  to get the result you want when using a reference to that entity CRLF in 
>  an attribute value.

That is a fantastic idea: escape the ampersand (decimal value 38) in the character entity reference to carriage return and to line feed.

I gave it a try and it works!

Recap: 

If you have many pattern facets that need to use CRLF, then create an ENTITY like so:

<!ENTITY CRLF "&#38;#13;&#38;#10;">

Now, in your pattern facets you can reference the ENTITY like so:

<xs:pattern value="From:[a-z]+@[a-z\.]+&CRLF;"/>

In your instance document use the character entities for carriage return and line feed:

<from>From:jdoe@machine.example&#13;&#10;</from>

All right!

Thanks Martin!

/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