René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Attribute normalization

<?xml version="1.0" standalone="yes"?>
<!DOCTYPE foo 
[
<!ELEMENT foo  (bar*)                                          >
<!ELEMENT bar  (bar*)                                          >

<!ATTLIST bar bla CDATA #IMPLIED>
<!ENTITY cr   "&#xD;">
<!ENTITY lf   "&#xA;">
<!ENTITY crlf "&#xD;&#xA;">
]>

<foo>


  <bar bla="&cr;"       />
  <bar bla="&lf;"       />
  <bar bla="&crlf;"     />

  <bar bla="a &cr;"     />
  <bar bla="a &lf;"     />
  <bar bla="a &crlf;"   />

  <bar bla="a &cr; b"   />
  <bar bla="a &lf; c "  />
  <bar bla="a &crlf; d" />

  <bar bla=" a &crlf; d " />

</foo>