2

I have a simple xml file. It defined an element in that file as...

<xs:element name="Comments" >
  <xs:simpleType>
   <xs:restriction base="xs:string">
     <xs:maxLength value="4000" />
   </xs:restriction>
  </xs:simpleType>
</xs:element>

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).

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.

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 2.11 End-of-Line Handling

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.

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?

BlackMael
  • 3,198
  • 5
  • 25
  • 42
  • Not having used the XML task, I can't offer any insight. If no one responds, perhaps you can accomplish the same processing via a script task? – billinkc Jan 30 '12 at 02:32
  • I was looking for a fix to the Xml Task, otherwise if I were to fix the problem via a Script Task I'd prefer to jump to my real solution and rewrite the whole package (and significant number of other simple packages) as a even simpler console app. – BlackMael Jan 30 '12 at 07:26

0 Answers0