[oXygen-user] XML Catalog puzzle
Tue Dec 22 10:58:19 CST 2015
On 12/22/2015 08:41 AM, Oxygen XML Editor Support (Adrian Buza) wrote:
> When relying on the namespace instead of an explicit schema
> association (xsi:schemaLocation), Oxygen only associates one schema
> for the root element namespace of the XML instance. Any other
> namespaces from the XML instance are ignored.
I have since confirmed this.
Were it feasible, a promiscuous, sub-root, implicit namespace to schema
mapping would be beneficial. That would provide a comprehensive implicit
association based solely on namespace (of course requiring appropriate
XML Catalog mappings to be supplied).
> Why do you consider using xsi:schemaLocation is a problem?
> As long as you have an XML catalog that resolves the schema location,
> it doesn't really matter what location is being used.
I was unsure of this, but will consider it (particularly for unlinked
sub-schemas, such as in OVAL). Now that you have pointed that out, I
will use it where necessary (I have found yet another example here
which falls prey to the same disjointed nature of the OVAL schemata).
I'd prefer to rely solely on namespace whenever possible.
I continue to find a non-trivial amount of inferior xsi:schemaLocation
usage in many documents from various sources. These typically result in
failed validations due to non-existent relative references, failed
absolute references to external sources, and the like.
> Instead of using a canonical location, you could use the actual
> namespace as the schema location in xsi:schemaLocation and it would
> work in Oxygen.
> <oval_definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" ...
> The alternative is to modify the main XML schema (or create another
> main XML schema) to import all namespaces that are used in the XML
I have tried the latter, which worked well, and will likely additionally
adopt the former method.
Thanks much for the explanations.
More information about the oXygen-user