Document instance incorrectly validating
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 7
- Joined: Fri May 14, 2010 1:34 am
Document instance incorrectly validating
I'm not sure if this is an oXygen issue or not.
I have the following simple mods document
<?xml version="1.0" encoding="UTF-8"?>
<mods xmlns:xlink="http://www.w3.org/1999/xlink" version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd">
<titleInfo>
<title supplied="yes">something</title>
</titleInfo>
</mods>
The document validates but the problem is it shouldn't. Although the most recent version of the MODS schema is mods-3-4, neither it or 3-0 above allow <title> to take an @supplied. @supplied isn't available on any element in an xsd prior to 3-4 and 3-4 only allows it on a <titleInfo> and a few other elements. I'm running 13.1 and haven't made any changes to the default validation settings. Can anyone explain why this is happening and/or at least clarify if it is a non-oXygen issue? Thanks.
I have the following simple mods document
<?xml version="1.0" encoding="UTF-8"?>
<mods xmlns:xlink="http://www.w3.org/1999/xlink" version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd">
<titleInfo>
<title supplied="yes">something</title>
</titleInfo>
</mods>
The document validates but the problem is it shouldn't. Although the most recent version of the MODS schema is mods-3-4, neither it or 3-0 above allow <title> to take an @supplied. @supplied isn't available on any element in an xsd prior to 3-4 and 3-4 only allows it on a <titleInfo> and a few other elements. I'm running 13.1 and haven't made any changes to the default validation settings. Can anyone explain why this is happening and/or at least clarify if it is a non-oXygen issue? Thanks.
-
- Posts: 7
- Joined: Fri May 14, 2010 1:34 am
Re: Document instance incorrectly validating
I've been able to get correct validation by changing the schemaLocation URI to point to the most current version, mods-3-4.xsd However, the document continues to validate incorrectly when pointing at the mods-3-0.xsd. This is strange since the @supplied is nowhere declared in the mods-3-0.xsd document. Or in any MODS schema prior to 3-4. In fact, it behaves in exactly the opposite fashion as when validating with the most recent schema. That is, when pointing at 3-0.xsd, applying @supplied to <titleInfo> will cause validation to fail (it would validate with the 3-4.xsd as it should) but succeed with @supplied on <title>.
Is this a fault of Oxygen or some complex problem involving the schema, which seem pretty straight-forward to my admittedly inexperienced eye? Since no declaration for @supplied exists and the only declaration for <title> seems to be <xsd:element name="title"/>, I'm really at a loss to understand where this behavior is coming from other than Oxygen.
Is this a fault of Oxygen or some complex problem involving the schema, which seem pretty straight-forward to my admittedly inexperienced eye? Since no declaration for @supplied exists and the only declaration for <title> seems to be <xsd:element name="title"/>, I'm really at a loss to understand where this behavior is coming from other than Oxygen.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: Document instance incorrectly validating
If the type is not specified for an element as in
then you can put anything as its content and as its attributes. The specification pointers to that are:
http://www.w3.org/TR/xmlschema-1/#element-element
see the last otherwise clause:
http://www.w3.org/TR/xmlschema-1/#ur-type-itself
where you can see that this type accepts anything.
Best Regards,
George
Code: Select all
<xsd:element name="title"/>
http://www.w3.org/TR/xmlschema-1/#element-element
see the last otherwise clause:
which points to{type definition} The type definition corresponding to the <simpleType> or <complexType> element information item in the [children], if either is present, otherwise the type definition ·resolved· to by the ·actual value· of the type [attribute], otherwise the {type definition} of the element declaration ·resolved· to by the ·actual value· of the substitutionGroup [attribute], if present, otherwise the ·ur-type definition·.
http://www.w3.org/TR/xmlschema-1/#ur-type-itself
where you can see that this type accepts anything.
Best Regards,
George
George Cristian Bina
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Document instance incorrectly validating
Hi,
I'd like to add that if you want to see the definition of the element from the schema you can simply right click on that element name in the XML file and from the popup menu choose Show Definition. This will open the schema at the location where the element is defined.
Regards,
Adrian
I'd like to add that if you want to see the definition of the element from the schema you can simply right click on that element name in the XML file and from the popup menu choose Show Definition. This will open the schema at the location where the element is defined.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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