Validation Against DTD Fails For No Obvious Reason
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 10
- Joined: Fri Jul 16, 2004 11:25 pm
Validation Against DTD Fails For No Obvious Reason
When I open documents with DOCTYPE declarations and external DTD subsets, when I validate I consistently get this type of response:
http://www.w3.org/TR/xmlschema-1/#cvc-elt E cvc-elt.1: Cannot find the declaration of element 'user_guide'. symbian_help_test_en_2.xml file:/C:/users/MODEClient/eliot/symbian_help_test/en/issue_2/symbian_help_test_en_2.xml 4:1
The document in question is unquestionably valid (I can validate it with any number of tools) and tagsense appears to work (insertion only shows elements that are actually valid at a particular location--I don't think that's just learning).
The doctype declaration has this form:
<!DOCTYPE user_guide SYSTEM "../../../dtds/mode_userguide/mode_userguide.dtd">
And I can do "open file at cursor" and the mode_userguide.dtd file opens. I am not using catalogs (all external entities are referenced via relative URIs and all dependencies are present).
I'm getting this behavior with several doctypes, including custom ones and the DocBook XML DTD.
Any idea what might be causing this or how I can debug it?
Thanks,
Eliot
http://www.w3.org/TR/xmlschema-1/#cvc-elt E cvc-elt.1: Cannot find the declaration of element 'user_guide'. symbian_help_test_en_2.xml file:/C:/users/MODEClient/eliot/symbian_help_test/en/issue_2/symbian_help_test_en_2.xml 4:1
The document in question is unquestionably valid (I can validate it with any number of tools) and tagsense appears to work (insertion only shows elements that are actually valid at a particular location--I don't think that's just learning).
The doctype declaration has this form:
<!DOCTYPE user_guide SYSTEM "../../../dtds/mode_userguide/mode_userguide.dtd">
And I can do "open file at cursor" and the mode_userguide.dtd file opens. I am not using catalogs (all external entities are referenced via relative URIs and all dependencies are present).
I'm getting this behavior with several doctypes, including custom ones and the DocBook XML DTD.
Any idea what might be causing this or how I can debug it?
Thanks,
Eliot
----
Eliot Kimber
Innodata Isogen
Eliot Kimber
Innodata Isogen
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: Validation Against DTD Fails For No Obvious Reason
Dear Eliot,
Best Regards,
George
This error is specific to schema validation. In oXygen there is a feature we added to allow both external entities and XML Schema validation to go together: Options->Preferences->XML->XML Parser options->Use XML Schema for validation. When this feature is enabled oXygen will disregard the DTD declaration and will always try to validate the document against an XML Schema. I think that you have this feature enabled and that is why you are getting these errors.drmacro wrote:http://www.w3.org/TR/xmlschema-1/#cvc-elt E cvc-elt.1: Cannot find the declaration of element 'user_guide'. symbian_help_test_en_2.xml file:/C:/users/MODEClient/eliot/symbian_help_test/en/issue_2/symbian_help_test_en_2.xml 4:1
Best Regards,
George
-
- Posts: 10
- Joined: Fri Jul 16, 2004 11:25 pm
You are correct--I changed the settings and DTD validation worked (almost).
However, my expectation would be that if a document neither specifies xsi:schemaLocation nor has an explicilty-associated schema but does have a DOCTYPE declaration, that the DOCTYPE would be used. It's certainly incovenient to have to change this setting, which requires restarting the editor, just to work on documents that do and do not use schemas.
Also, it appears that, at least by default, oXygen is using a non-conforming parser that does not respect namespace declarations that are declared in fixed attributes in the DTD. I know this is an issue with MSXML and possibly other parsers. It is not an issue for Aelfred or Xerces.
I have not looked if there is a way to change the parser that oXygen is using (since it's Java-based, I'm assuming there is).
Cheers,
Eliot
However, my expectation would be that if a document neither specifies xsi:schemaLocation nor has an explicilty-associated schema but does have a DOCTYPE declaration, that the DOCTYPE would be used. It's certainly incovenient to have to change this setting, which requires restarting the editor, just to work on documents that do and do not use schemas.
Also, it appears that, at least by default, oXygen is using a non-conforming parser that does not respect namespace declarations that are declared in fixed attributes in the DTD. I know this is an issue with MSXML and possibly other parsers. It is not an issue for Aelfred or Xerces.
I have not looked if there is a way to change the parser that oXygen is using (since it's Java-based, I'm assuming there is).
Cheers,
Eliot
----
Eliot Kimber
Innodata Isogen
Eliot Kimber
Innodata Isogen
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Eliot,
Best Regards,
George
Your expectation is the default behavior of oXygen. There is however a possible situation when both schema and DTD are specified, in this case by default the DTD is used for validation. To get oXygen ignore the DTD for validation but get the DTD defined entities and validate against the specified schema one should enable the "Use XML Schema for validation" feature. This will turn off DTD validation completely.drmacro wrote:However, my expectation would be that if a document neither specifies xsi:schemaLocation nor has an explicilty-associated schema but does have a DOCTYPE declaration, that the DOCTYPE would be used.
See my comment above. An additional note is that there is no need to restart the editor when you change the "Use XML Schema for validation" flag. The restart is needed only for the "Enable XInclude processing" preference in that preferences dialog.drmacro wrote:It's certainly incovenient to have to change this setting, which requires restarting the editor, just to work on documents that do and do not use schemas.
You may consider posting the problem you have, FYI Oxygen uses Xerces 2.6.2, the latest Xerces release. Also DTDs are not namespace aware.drmacro wrote: Also, it appears that, at least by default, oXygen is using a non-conforming parser that does not respect namespace declarations that are declared in fixed attributes in the DTD. I know this is an issue with MSXML and possibly other parsers. It is not an issue for Aelfred or Xerces.
You cannot change the parser used by oXygen, as I said above it is Xerces 2.6.2. It is possible however to use the External tools options to add a validation with a different parser as an external tool. I configured for instance Saxon 8SA to perfrom XML Schema validation on the current edited file as an external tool.drmacro wrote: I have not looked if there is a way to change the parser that oXygen is using (since it's Java-based, I'm assuming there is).
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