
Hello Gary, 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. 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. 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. e.g. <oval_definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-definitions-5 http://oval.mitre.org/XMLSchema/oval-definitions-5 http://oval.mitre.org/XMLSchema/oval-definitions-5#independent 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 instance. Regards, Adrian Adrian Buza oXygen XML Editor and Author Support Tel: +1-650-352-1250 ext.2020 Fax: +40-251-461482 On 21.12.2015 14:56, Gary Gapinski wrote:
I am attempting (perhaps wrongly) to have OVAL <https://github.com/OVALProject/Language> document validation to occur based on namespace (_without_ using xsi:schemaLocation).
I suspect my problem is related to the rather complex OVAL schemata relationships, but I have not determined how best (if at all) to accomplish this.
I have a sample document <https://s3.amazonaws.com/xml.garygapinski.com/OVAL/example-oval-unknown.xml> and a related XML catalog <https://s3.amazonaws.com/xml.garygapinski.com/OVAL/catalog.zip>. The XML catalog has been configured in the project preferences.
When I attempt to validate the document, it appears that the schema in namespace http://oval.mitre.org/XMLSchema/oval-definitions-5#independent has not been associated. The primary (root) schema is associated and is obtained from the catalog.
If this sort of implicit association is not possible, any suggestions on how to knit together the many discrete (sub-)schemata of OVAL would be much appreciated. I would prefer to avoid the use of xsi:schemaLocation if at all possible (since a "canonical" location for such is not assured).
Regards,
Gary
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hello, Adrian: 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 <http://scap.nist.gov/schema/scap/1.2/scap-source-data-stream_1.2.xsd>, 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. e.g. <oval_definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-definitions-5 http://oval.mitre.org/XMLSchema/oval-definitions-5 http://oval.mitre.org/XMLSchema/oval-definitions-5#independent 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 instance.
I have tried the latter, which worked well, and will likely additionally adopt the former method. Thanks much for the explanations. Regards, Gary
participants (2)
-
Gary Gapinski
-
Oxygen XML Editor Support (Adrian Buza)