About the root element
As mentioned above, VOResource defines no global elements. The proper root element is expected to be defined by the application, as necessary, via its own application schema. For example, a particular application might define the following schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://astroservices.org/ResourceApplication"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:vr="http://www.ivoa.net/xml/VOResource/v0.10"
xmlns:ra="http://astroservices.org/ResourceApplication"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="0.10">
<xs:annotation>
<xs:documenation> application schema using VOResource </xs:documenation>
</xs:annotation>
<xs:import namespace="http://www.ivoa.net/xml/VOResource/v0.10" />
<xs:element name="ResourceDescription" type="vr:Resource"/>
<xs:element name="Resources">
<xs:complexType>
<xs:sequence>
<xs:element ref="ra:ResourceDescription" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
In this example, two global elements have been defined, either which can be used as a root element. The application would use this simple schema to verify its documents.
Note that in the example instance documents listed above, an application schema is not needed. That's because the root element in each case specifies its type using an xsi:type attribute. According to the XML Schema standard, this is sufficient to verify the document.
It is expected that registry applications will use "resource" as the root element, just like in the examples listed above. |