Is this correct? I have changed to version of XML from 1.0 to 1.1 that my DS reads and I now get an error saying it cannot read this version. Is there anyway around this?
The reason I'm doing this is for v1.1's ability to account for such things as unit separators.
This is the exception I receive:
An unhandled exception of type 'System.Xml.XmlException'
occurred in System.Xml.dll
Additional information: Version number '1.1' is invalid. Line 1, position 16.
An XML 1.0 parser might, or might not accept to parse documents that have other version number than 1.0
. The behaviour of your XML parser depends on what edition of XML 1.0 recommendation it conforms to.
W3C XML recommendations editions 1 & 2 said:
The version number "1.0" should be used to indicate conformance to this version of this specification; it is an error for a document to use the value "1.0" if it does not conform to this version of this specification.
...
Processors may signal an error if they receive documents labeled with versions they do not support.
and the valid values for version
in XML declaration were
[26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+
ref: http://www.w3.org/TR/1998/REC-xml-19980210#sec-prolog-dtd
This was changed for the 3rd edition. The paragraph that I quoted above, was removed and value of version
was fixed to 1.0
[26] VersionNum ::= '1.0'
This practically meant, that XML 1.0 parser should see other version numbers as errors.
ref: http://www.w3.org/XML/xml-V10-2e-errata#E38
Parsing of other versions was again allowed in 5th edition, when a new change practically reversed the previous change. Two new paragraphs were added
Even though the VersionNum production matches any version number of the form '1.x', XML 1.0 documents SHOULD NOT specify a version number other than '1.0'.
Note: When an XML 1.0 processor encounters a document that specifies a 1.x version number other than '1.0', it will process it as a 1.0 document. This means that an XML 1.0 processor will accept 1.x documents provided they do not use any non-1.0 features.
The valid values for version
now have form 1.x
[26] VersionNum ::= '1.' [0-9]+
ref: http://www.w3.org/XML/xml-V10-4e-errata#E10
It is risky to use other version number than 1.0
(also for XML 1.0 documents), since a parser might refuse to process it. If you make such change, you need to know that the document will only be handled with XML 1.1 compatible tools (or XML 1.0 5th Ed. compatible tools, but then you can't use any XML 1.1 features).