title: Validating xml through xsd takes entities as referred character
body: <p>I'm struggling with something strange. We have to send some xml generated documents to a website, where they are going to be parsed against a xsd. This xsd includes a data type for text fields where a regular expression is used to exclude different characters (in fact the reg exp includes a definite list of valid characters, excluding everything outside the rule).</p>
  
  <p>For example, standard double quotes (") are excluded.</p>
  
  <p>On our xml generator I've changed (") with it's entity <code>&amp;quot;</code> and with this change, those data that includes (") pass the validation.</p>
  
  <p>Of course, quotes aren't our only problem, there are lots of different characters excluded from the reg exp that can be found on our source data. </p>
  
  <p>So I made a little function on our Oracle package that checks units of data against the reg exp before adding them to the xml, and if any doesn't fit, loops through it's content seeking invalid characters and changing them by the html entity associated to their encoding (thus, quotes are changed by <code>&amp;#34;</code>)</p>
  
  <p>My surprise is that, although the reg exp validates a piece of data with <code>&amp;quot;</code>, it doesn't validate a piece of data with <code>&amp;#34;</code> (and yes, (#) are included in the reg exp).</p>
  
  <p>There are any reason for this? I don't know... are #numeric entities parsed before making the validation against a xsd or something like that?</p>
  
  <p>BTW, the regExp is this: </p>
  
  <pre><code>[0-9a-zA-ZñáàéèíìóòúùÁÉÍÓÚÑü\s/çÇ¡!¿=\?%€@&amp;#,;:\.\-_''\*\+\(\) ÀÈÌÒÙÜ’´´`·äëïöÄËÏÖ“”’]+
  </code></pre>