[ome-devel] OME-XML validation

Josiah Johnston siah at nih.gov
Mon Apr 18 19:59:00 BST 2005


Your first problem is the schema validator. The one you use doesn't  
work so well. Try this one instead:
	http://www.w3.org/2001/03/webdata/xsv

Two errors remain with the working validator:
1) CustomAttributes isn't using a namespace (i.e. <CustomAttributes>  
should be <CA:CustomAttributes>). I logged this as bug 493  
<http://bugs.openmicroscopy.org.uk/show_bug.cgi?id=493>

file:/usr/local/XSV/xsvlog/tmpH4XNxmuploaded:54:3: Invalid per  
cvc-complex-type.1.2.4: element
{http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd}: 
CustomAttributes not allowed here (5) in element
{http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd}:Dataset,  
expecting
[{http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd}: 
ProjectRef,{http://www.openmicroscopy.org/XMLschemas/CA/RC1/CA.xsd}: 
CustomAttributes,$]:

2) OTF's <Bin:External> needs to be wrapped in a <Bin:BinaryFile>

file:/usr/local/XSV/xsvlog/tmpH4XNxmuploaded:101:4: Invalid per  
cvc-complex-type.1.2.4: element
{http://www.openmicroscopy.org/XMLschemas/BinaryFile/RC1/ 
BinaryFile.xsd}:External not allowed here (3) in element
{http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd}:OTF, expecting
[{http://www.openmicroscopy.org/XMLschemas/BinaryFile/RC1/ 
BinaryFile.xsd}:

Once those problems were addressed, two more problems came up:
1) There are some issues with the #wildcard datatype that  
CustomAttributes uses. I don't fully understand this.
file:/usr/local/XSV/xsvlog/tmpcFUTUZuploaded:55:3: Invalid per  
cvc-complex-type.1.2.4:
     content of CA:CustomAttributes is not allowed to end here (1),  
expecting [u'{Wildcard: ##any}']:
2) The BinaryFile schema (OME/src/xml/schemas/BinaryFile.xsd) had an  
error. It was expecting an External element AND a BinData element. I  
changed it from 'sequence' to 'choice', and committed to the main  
branch. I think this should be committed to 2.4 as well, but want to  
get the group's OK first. Is that OK with everyone?
file:/usr/local/XSV/xsvlog/tmpyUXp9Luploaded:109:4: Invalid per  
cvc-complex-type.1.2.4:
     content of Bin:BinaryFile is not allowed to end here (2), expecting  
[u'{http://www.openmicroscopy.org/XMLschemas/BinaryFile/RC1/ 
BinaryFile.xsd}:BinData']:

Ilya is in Japan at a conference this week, and I'm busy integrating  
the classifier. I'll work on this as time allows, but it may be a week  
or two before a full fix is posted. If anyone wants to use this as an  
opportunity to dig into the schema and stylesheets, by all means go for  
it!

-Josiah

On Apr 18, 2005, at 1:42 PM, Curtis Rueden wrote:

> Hi,
>
> I'm trying to learn about XML validation. I've tried validating the  
> ome.xsd schema, as well as the Sample.ome file, using the online XSD  
> schema validator at http://apps.gotdotnet.com/xmltools/xsdvalidator/  
> but I'm running into trouble.
>
> Attempting to validate Sample.ome by itself produces a long string of  
> errors claiming that none of the elements are declared:
>
> --------
> Error at (40,2): The  
> 'http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd:OME' element  
> is not declared. An error occurred at , (40, 2).&amp;lt;OME<br> xmlns  
> = "http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd"<br>  
> xmlns:STD =  
> "http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd"<br>  
> xmlns:Bin =<br>  
> "http://www.openmicroscopy.org/XMLschemas/BinaryFile/RC1/ 
> BinaryFile.xsd"<br> xmlns:xsi =  
> "http://www.w3.org/2001/XMLSchema-instance"<br> xsi:schemaLocation  
> =<br> "http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd<br>  
> http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd<br>  
> http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd<br>  
> http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd"&amp;gt;  
> Error at (45,3): The  
> 'http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd:Project'  
> element is not declared. An error occurred at , (45,  
> 3).&amp;lt;Project Name = "Stress Response Pathway" ID =  
> "urn:lsid:foo.bar.com:Project:123456"&amp;gt;<br> --------
>
> Attempting to validate just the ome.xsd schema document produces a  
> long string of errors claiming that all the elements have already been  
> declared:
>
> --------
> The global element  
> 'http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd:OME' has  
> already been declared. An error occurred at , (39, 3). The global  
> element  
> 'http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd:Image' has  
> already been declared. An error occurred at , (65, 3). The global  
> element  
> 'http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd:CreationDate'  
> has already been declared. An error occurred at , (132, 3).
> --------
>
> Attempting to validate the Sample.ome file against the ome.xsd schema  
> with the proper NamespaceURI  
> (http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd), I get the  
> same long string of errors regarding elements having already been  
> declared.
>
> Am I missing something obvious? Is there a recommended technique for  
> validating the OME schema files and for OME-XML documents?
>
> Thanks,
> Curtis
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>



More information about the ome-devel mailing list