Page 1 of 1

Document instance incorrectly validating

Posted: Thu Oct 27, 2011 6:46 pm
by TPulhamus
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.

Re: Document instance incorrectly validating

Posted: Fri Oct 28, 2011 10:13 pm
by TPulhamus
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.

Re: Document instance incorrectly validating

Posted: Fri Oct 28, 2011 11:01 pm
by george
If the type is not specified for an element as in

Code: Select all


<xsd:element name="title"/>
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:
{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·.
which points to
http://www.w3.org/TR/xmlschema-1/#ur-type-itself
where you can see that this type accepts anything.

Best Regards,
George

Re: Document instance incorrectly validating

Posted: Sat Oct 29, 2011 1:25 am
by TPulhamus
Thank you very much for your reply. I appreciate it.

Re: Document instance incorrectly validating

Posted: Mon Oct 31, 2011 5:14 pm
by adrian
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