Valid Schema by itself?
Oxygen general issues.
Valid Schema by itself?
Hi,
In OxygenXML, is there a way to tell if the schema defined in a particular file is not a valid schema if it were to be used by itself? For example, if the schema defined a bunch of child elements and never defined the root element, the resulting document would not be well-formed. So, it stands to reason that a parser of the schema should be able to detect that sort of thing.
Does OxygenXML do this?
Thanks,
Yaakov.
In OxygenXML, is there a way to tell if the schema defined in a particular file is not a valid schema if it were to be used by itself? For example, if the schema defined a bunch of child elements and never defined the root element, the resulting document would not be well-formed. So, it stands to reason that a parser of the schema should be able to detect that sort of thing.
Does OxygenXML do this?
Thanks,
Yaakov.
Exactly, all the elements that are defined as global elements in W3C XML Schema can be used as root elements in a document. This is true also for DTDs where all the elements can be used as root element. Relax NG defines a start pattern that contains the name class that mathes the possible root elements, it also allows more possible root elements.
Best regards,
George
Best regards,
George
Yes, but XML Schema doesn't force you to define every element as global element. You can define 1 global element and define the rest of the things as just types that contain elements of some other types and so on. This way, you CAN enforce that only 1 element be the root element and sort of express the fact that the XML document has to be well-formed.
Am I wrong about this?
However, I do see the point you are making regarding my original question... Just as a side... Why does XML Schema inherently allow constructs that can result in a no well-formed documents?
Am I wrong about this?
However, I do see the point you are making regarding my original question... Just as a side... Why does XML Schema inherently allow constructs that can result in a no well-formed documents?
XML Schema does not have any impact in the wellformedness of a document. XML Schema defines only validity for a document. If a document is not wellformed then it is not an XML document.
So I do not understand your question. XML Schema specifies some constraints and it is used in a validation process on a wellformed, (that means XML) document. There are no constructs in XML Schema that can result in not wellformed documents.
Best Regards,
George
So I do not understand your question. XML Schema specifies some constraints and it is used in a validation process on a wellformed, (that means XML) document. There are no constructs in XML Schema that can result in not wellformed documents.
Best Regards,
George
Sorry... I am not explaining myself clearly...
Yes, I understand that validation doesn't even come into the picture if the document is not well-formed. The question I was wondering about is why even allow more than one global element in an XML Schema? You can just define a root element with a "choice".
However, if I understand you correctly, you are saying that defining multiple global elements is, in fact, the only way to define that you want to allow a CHOICE of the root element itself.
Is that correct?
Thanks,
Yaakov.
Yes, I understand that validation doesn't even come into the picture if the document is not well-formed. The question I was wondering about is why even allow more than one global element in an XML Schema? You can just define a root element with a "choice".
However, if I understand you correctly, you are saying that defining multiple global elements is, in fact, the only way to define that you want to allow a CHOICE of the root element itself.
Is that correct?
Thanks,
Yaakov.
Hi Yaakov,
There are more considerations to define global elements than to have those elements used as root elements in an instance document. Local elements for instance cannot be referred, so if you have XHTML and XForms embedded in XHTML then you want many of the XForms elements to be global in order to be able to allow them inside the XHTML document in different places where thay can appear.
Another use is for instance when you want to XInclude content and you want to use the schema to validate also the included fragments, so you want to have more global elements than the root of the master document.
Best Regards,
George
There are more considerations to define global elements than to have those elements used as root elements in an instance document. Local elements for instance cannot be referred, so if you have XHTML and XForms embedded in XHTML then you want many of the XForms elements to be global in order to be able to allow them inside the XHTML document in different places where thay can appear.
Another use is for instance when you want to XInclude content and you want to use the schema to validate also the included fragments, so you want to have more global elements than the root of the master document.
Best Regards,
George
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