From: Chris A. <ch...@ma...> - 2009-07-21 14:24:45
|
Matthew Chambers wrote: > As we discussed at least week's call, there's some debate about the > value of having a separate version attribute. There seem to be two sides > to the debate: Just out of interest: What's the intention with backwards compatibility policy here? If there are breaking changes to the schema that render previous instance documents no longer valid, anyone using a validating parser (eg. XercesC, MSXML) will struggle to support reading more than one major version without a namespace change since you can only map each unique namespace URI to one xsd file^^, and that mapping has to be given to the parser _before_ it starts reading the document (chicken and egg). Relying only on a version attribute in the document or the "schemaLocation" would require a 2-pass approach, which isn't very practical if you're reading the document from a (forward-only) stream. See also: http://209.85.229.132/search?q=cache%3AVyWUtbQUsFAJ%3Awww.xfront.com%2FVersioning.pdf+%22XML+Schema+Versioning+Best+Practices%22&hl=en&gl=uk ^^ Yes, instance documents can also provide this mapping (via "schemaLocation") but it is only a hint and quite often it's not practical to rely on for an application because it is optional and may point to a schema location that doesn't exist locally (eg. transferring file between platforms) or isn't accessible for some reason. Usually the application will ship with a copy of the schema that it supports and it will want to use that instead. btw, if you choose to encode the full version number in the XSD filename, that potentially means the application requires a copy of each and every version it will support. If the changes are backwards compatible that seems over the top since the newer version will still validate older instance documents. Regards, Chris |