Issues with the What section of the VOEvent-1.1 schema [repost]
Bob Denny
rdenny at dc3.com
Sat Feb 14 05:52:15 PST 2009
/This is a repost of the original message I sent to Rob, Roy, and
Andrew, and which Rob kindly forwarded to this list. The forwarded
message lost some things in the translation, hence my repost:
/
Rob (et al.) --
I've been living with some validation warnings on the VOEvent-1.1 schema
versus the actual messages that are running around out there. After
touching on this with Roy and Andrew, they encouraged me to report this
to you for consideration in future VOEvent schemata.
Here's the issue... at present (VOEvent-1.1), <What> is written like this:
<!-- What: Event Characterization -->
<xs:complexType name="What">
<xs:choice maxOccurs="unbounded">
<xs:element name="Param" />
<xs:element name="Group" />
<xs:element name="Description" type="Description" />
<xs:element name="Reference" />
</xs:choice>
</xs:complexType>
<xs:complexType name="Param">
<xs:attribute name="name" type="xs:token" />
<xs:attribute name="ucd" type="xs:token" />
<xs:attribute name="value" type="xs:string" />
<xs:attribute name="unit" type="xs:string" />
</xs:complexType>
<xs:complexType name="Group">
<xs:choice maxOccurs="unbounded">
<xs:element name="Param" />
<xs:element name="Description" type="Description" />
<xs:element name="Reference" />
</xs:choice>
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="type" type="xs:string" />
</xs:complexType>
Graphically, it looks like this:
There's supposed to be an image here!
While Param is defined as to its attributes (name, ucd, value, and
unit), neither What/Param nor Group/Param are typed as Param, so the
validator cannot find any schema information for either one (Despite
Param being a defined /type /in the Schema). The same sort of problem
exists for What/Group, which is not typed as Group, as well as
What/Reference, and What/Group/Reference (there is already a Reference
/type /also). In contrast, What/Description and What/Group/Description
/are already/ typed as Description, and thus they can be validated.
The problem has a simple solution, shown in bold below:
<!-- What: Event Characterization -->
<xs:complexType name="What">
<xs:choice maxOccurs="unbounded">
<xs:element name="Param"* type="Param"* />
<xs:element name="Group"* type="Group"* />
<xs:element name="Description" type="Description" />
<xs:element name="Reference"* type="Reference"* />
</xs:choice>
</xs:complexType>
<xs:complexType name="Param">
<xs:attribute name="name" type="xs:token" />
<xs:attribute name="ucd" type="xs:token" />
<xs:attribute name="value" type="xs:string" />
<xs:attribute name="unit" type="xs:string" />
</xs:complexType>
<xs:complexType name="Group">
<xs:choice maxOccurs="unbounded">
<xs:element name="Param"* type="Param"* />
<xs:element name="Description" type="Description" />
<xs:element name="Reference"* type="Reference"* />
</xs:choice>
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="type" type="xs:string" />
</xs:complexType>
Here's the result graphically, showing that the links for Param and
Group/param are made and the validator can work all the way through the
XML. The same goes for the Reference nodes, which I typed in bold above
(but didn't expand in the diagram):
There's supposed to be an image here!
I've circled the 5 changes in this diagram so you can see that the
effect is to complete the path from What all the way down to Param,
using the already defined Param /type /in the schema.
I hopes this proves to be useful for future schemata.
-- Bob
More information about the voevent
mailing list