Datetime Complaining About Whitespace In Xsd Validation (lxml)
I'm trying to validate a document using XSD, and lxml is complaining about whiteSpace in a dateTime value (though it should be collapsing it). I'm not sure if this is a broken beha
Solution 1:
It looks like the whitespace is causing the problems. Can you removed the leading and trailing whitespace from createdAt so it becomes
<createdAt>2008-06-10T01:32:08</createdAt>
and see what happens? If that solves it and you created the XML then change the XML generation so it doesn't have the whitespace. Otherwise, if you are in charge of the schema then try changing xsd:whitespace to "collapse" and see if that fixes it.
The other possibility is that it may need the timezone. It's supposed to match [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] so the timezone is optional, but try putting a 'Z' in there to see if that fixes things. That's what this post suggests.
Post a Comment for "Datetime Complaining About Whitespace In Xsd Validation (lxml)"