title: How do I manage line-endings when reading XML file in SSIS 2005
body: <p>I have a simple xml file.  It defined an element in that file as...</p>
  
  <pre><code>&lt;xs:element name="Comments" &gt;
    &lt;xs:simpleType&gt;
     &lt;xs:restriction base="xs:string"&gt;
       &lt;xs:maxLength value="4000" /&gt;
     &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>I create two Xml files that matches that supposedly match that schema, one uses CR/LF line endings (Windows) and the other used LF line endings (Unix).</p>
  
  <p>The length of the Comments value is 4000 bytes for the Unix file.  The corresponding length for the Windows file is greater than 4000 bytes unsurprisingly because of the extra CR bytes.</p>
  
  <p>When validating the Xml files with Xml Notepad, both files are valid.  As expected as the CR/LF are supposed to be automatically converted to single LF as per Xml spec <a href="http://www.w3.org/TR/REC-xml/#sec-line-ends" rel="nofollow">2.11 End-of-Line Handling</a></p>
  
  <p>Now when I load the files via the Xml Task, it only sees the Unix file as being valid, it sees the Windows version as having more than 4000 characters.</p>
  
  <p>Can the Xml Task be configured to work per Xml spec?  Or do I have to convert the CR/LF line endings myself and then re-validate?</p>