[oXygen-user] A question concerning depth of validation using 5.1
Sorin Ristache
Thu May 26 09:59:50 CDT 2005
Dear Stefan,
The line 648 of the schema *jhove.xsd* contains:
<xs:any namespace="http://www.aes.org/audioObject
http://www.loc.gov/mix/" processContents="skip" minOccurs="0"
maxOccurs="unbounded"/>
You say that the element *mix:DateTimeCreated* from line 32 of
*mix2.xml* contained in an element *mix:mix* should not be validated.
But the element *mix:mix* is in the namespace *http://www.loc.gov/mix/*,
allowed by the above attribute *namespace* of *xs:any*, and the
attribute *processContents* has the value *skip* (that means no
validation for any element from the allowed namespaces). So *mix2.xml*
is valid. For more information please read the section *Wildcards* of
the W3C XML Schema recommendation:
http://www.w3.org/TR/xmlschema-1/#Wildcards
Best regards,
Sorin
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com/
Stefan Funk wrote:
> Dear Sorin.
>
> Please have a look at the examples following:
>
>
> (1) The first one is not valid according to oxygen 5.1, as the
> <mix:DateTimeCreated> turns out wrong (it's value must be
> "2002-10-23T16:47:53" following the xml schema). This is ok:
>
> ----------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <mix:mix xmlns:mix="http://www.loc.gov/mix/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.loc.gov/mix/ http://www.loc.gov/mix/mix.xsd">
> <mix:ImageCreation>
> <mix:DateTimeCreated>2002:10:23 16:47:53</mix:DateTimeCreated>
> </mix:ImageCreation>
> </mix:mix>
> ----------------------------------------
>
>
> (2) The second example validates correctly, and it has the correct value.
> That's ok, too:
>
> ----------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <mix:mix xmlns:mix="http://www.loc.gov/mix/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.loc.gov/mix/ http://www.loc.gov/mix/mix.xsd">
> <mix:ImageCreation>
> <mix:DateTimeCreated>2002-10-23T16:47:53</mix:DateTimeCreated>
> </mix:ImageCreation>
> </mix:mix>
> ----------------------------------------
>
>
> (3) The third example is the same (incorrect) <mix:DateTimeCreated> field
> shown in (1) encapsulated in a Jhove object, and it is valid according to
> oxygen 5.1, althought the <mix:DateTimeCreated> should turn out not to be
> valid. That is (I think) not ok:
>
> ----------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <jhove date="2005-02-04" name="Jhove" release="1.0 (beta 3)"
> xmlns="http://hul.harvard.edu/ois/xml/ns/jhove"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/jhove
> http://hul.harvard.edu/ois/xml/xsd/jhove/1.3/jhove.xsd">
> <date>2005-05-24T14:16:23+02:00</date>
> <repInfo uri="foo.tif">
> <properties>
> <property>
> <name>TIFFMetadata</name>
> <values arity="Array" type="Property">
> <property>
> <name>IFDs</name>
> <values arity="List" type="Property">
> <property>
> <name>IFD</name>
> <values arity="Array" type="Property">
> <property>
> <name>Entries</name>
> <values arity="List" type="Property">
> <property>
> <name>NisoImageMetadata</name>
> <values arity="Scalar" type="NISOImageMetadata">
> <value>
> <mix:mix xmlns:mix="http://www.loc.gov/mix/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.loc.gov/mix/
> http://www.loc.gov/mix/mix.xsd">
> <mix:ImageCreation>
> <mix:DateTimeCreated>2002:10:23
> 16:47:53</mix:DateTimeCreated>
> </mix:ImageCreation>
> </mix:mix>
> </value>
> </values>
> </property>
> </values>
> </property>
> </values>
> </property>
> </values>
> </property>
> </values>
> </property>
> </properties>
> </repInfo>
> </jhove>
> ----------------------------------------
>
>
> Please correct me if I am wrong.
>
> Many thanks and greetings from Goettingen.
> Stefan.
>
>
> Sorin Ristache schrieb am 24.05.2005 14:58:
>
>>Dear Stefan,
>>
>>Validation of a document in <oXygen/> implies that all the tags and
>>their content are checked against the specified schema. There is no
>>depth limit of tag nesting. If you think validation doesn't work
>>correctly please post samples of your documents and their associated
>>schemas and point out the problem so that we be reproduce it.
>>
>>
>>Best regards,
>>Sorin
>>
>>Stefan Funk wrote:
>>
>>
>>>Hello dear Oxygen users.
>>>
>>>How deep does Oxygen validate in a xml-structure? I have a file
>>>definitely not
>>>well-formed at one point somewhere down the 16th grade and it
>>>validates. If I
>>>copy out that part in another not so deep file, it doesn't.
>>>
>>>Greetings.
>>>Stefan.
More information about the oXygen-user
mailing list