Xml Schema namespace
This should cover W3C XML Schema, Relax NG and DTD related problems.
Re: Xml Schema namespace
Dear Matrick,
There is a W3C standard for XML Schema which defines how XML Schemas are constructed and how they are referenced from the XML documents. There is a committee which created that standard, we (the Oxygen XML team) are/were not part of that committee, we just implement the editing/validation functionality on top of that standard.
With this in mind, please see some replies below for your queries:
This is specific not only to the XML Schema standard, but also to the Relax NG standard as well.
So an XML Schema has a target namespace specified but it uses xsd:import to import other XML Schemas which have other target namespaces specified. And the XML document can be created having multiple elements from different namespaces.
Regards,
Radu
There is a W3C standard for XML Schema which defines how XML Schemas are constructed and how they are referenced from the XML documents. There is a committee which created that standard, we (the Oxygen XML team) are/were not part of that committee, we just implement the editing/validation functionality on top of that standard.
With this in mind, please see some replies below for your queries:
I think the main idea is to restrict the choices for people creating the XML documents. A company designs the XML Schema, they choose the target namespace, they set that inside the XML Schema. All people or processes which create XML documents based on that schema are forced to use that target namespace in the XML instances.1) I realize namespaces are a means of differentiating between different schemas/vocabularies specified using XML Schema, but I don’t understand why it’s a good idea that a namespace ( for which the schema is developing a vocabulary ) is specified within the schema itself ( via targetNamespace attribute ).
This is specific not only to the XML Schema standard, but also to the Relax NG standard as well.
Same as above.a) Wouldn’t it be better if we were able to instead associate particular namespace with particular vocabulary/schema within instance documents? That way those writing instance documents would have a complete freedom to associate a schema with whichever namespace name they’d desire?!
Actually you can combine using xsd:import multiple schemas from multiple namespaces and use them for XML editing and validation.b) Only benefit I see in the schema specifying a target namespace is that its creators have an option to put a document at the end of namespace that can describe the elements of that namespace ( assuming schema uses URL for a namespace ). Are there also other benefits?
So an XML Schema has a target namespace specified but it uses xsd:import to import other XML Schemas which have other target namespaces specified. And the XML document can be created having multiple elements from different namespaces.
The "schemaLocation" requires its values to be pairs of "namespace schemaLocation", by the way they can be multiple pairs of like"xsi:schemaLocation="namespace1 schemaLocation1 namespace2 schemaLocation2"". The "noNamespaceSchemaLocation" takes a single value which is the reference to the XML Schema.2) If a schema has no targetNamespace, you must refer ( within instance document ) to the particular schema using the noNamespaceSchemaLocation attribute instead of schemaLocation attribute.
I think this flexibility which in 99.9% of cases is not needed derives from the fact that inside an XML Schema you can have multiple xsd:imports to XML Schemas having other target namespaces. So when you refer to an XML Schema using xsi:schemaLocation you also specify the namespace of the elements you are interested in.Wouldn’t it be simpler if instead document instance would just specify the location of the schema and let the XML Schema validator figure out whether or not schema specifies a targetNamespace?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service