Undefined type . . .

~
 I have the simple schema pasted below that is not validating.
~
 The errors I get from
~

~
 are:
~
Undefined type xs{http://www.w3.org/2001/XMLSchema}:dtmf referenced as
type definition of srvgmt
Undefined type xs{http://www.w3.org/2001/XMLSchema}:dtmf referenced as
type definition of srvxpgmt
Undefined type xs{http://www.w3.org/2001/XMLSchema}:dtmf referenced as
type definition of lupgmt
~
 The only thing I am going just a bit fancy is the restriction of the
dateTime format
~
 If I try using the jaxb compiler I get:
~
sh-3.1# xjc LWSC00.localents.xsd
parsing a schema...
[ERROR] src-resolve.4.2: Error resolving component 'xs:dtmf'. It was
detected that 'xs:dtmf' is in namespace
'http://www.w3.org/2001/XMLSchema', but components from this namespace
are not referenceable from schema document
'file:/media/hda2/prjx/java/JAXB/LocalWebSynchedCache/xsd/LWSC00.localents.xsd'.

 If this is the incorrect namespace, perhaps the prefix of 'xs:dtmf'
needs to be changed. If this is the correct namespace, then an
appropriate 'import' tag should be added to
'file:/media/hda2/prjx/java/JAXB/LocalWebSynchedCache/xsd/LWSC00.localents.xsd'.

  line 13 of file:/media/hda2/prjx/java/JAXB/LocalWebSynchedCache/xsd/LWSC00.localents.xsd

Failed to parse a schema.
~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ SCHEMA FILE ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~
<?xml version="1.0" encoding="UTF-8" ?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">

<!-- Simple Data Type for Date formatting -->
 <xs:simpleType name="dtmf">
  <xs:restriction base="xs:dateTime">
   <xs:pattern value="YYYY-MM-DDThh:mm:ssTZD" />
  </xs:restriction>
 </xs:simpleType>

<!-- Web Section -->
 <xs:element name="srvgmt" type="xs:dtmf" /><!-- server's:
"Last-Modified:" (GMT format) -->
 <xs:element name="srvxpgmt"  type="xs:dtmf" /><!-- server's "Expires"
(GMT format) -->
 <xs:element name="srvmaxage"  type="xs:int" /><!-- server's:
"Cache-Control: max-age=" -->
 <xs:element name="srvetag" type="xs:string" /><!-- server's "ETag:" -->
 <xs:element name="srvcntlngth" type="xs:int" /><!-- server's
"Content-Length:" -->
 <xs:element name="srvcnttp" type="xs:string" /><!-- server's
"Content-Type:" -->

 <xs:element name="web">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="srvgmt" /><!-- server's: "Last-Modified:" (GMT format) -->
    <xs:element ref="srvxpgmt" /><!-- server's "Expires" (GMT format) -->
    <xs:element ref="srvmaxage" /><!-- server's: "Cache-Control: max-age=" -->
    <xs:element ref="srvetag" /><!-- server's "ETag:" -->
    <xs:element ref="srvcntlngth" /><!-- server's "Content-Length:" -->
    <xs:element ref="srvcnttp" /><!-- server's "Content-Type:" -->
   </xs:sequence>
  </xs:complexType>
 </xs:element>

<!-- Local Caches -->
 <xs:element name="root" type="xs:string" /><!-- Local root mount
point/Partition -->
 <xs:element name="dir" type="xs:string" /><!-- Local Directory
branching off partition -->
 <xs:element name="lupgmt" type="xs:dtmf" /><!-- Last Update in GMT format -->

 <xs:element name="ksh">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="root" /><!-- Local root mount point/Partition -->
    <xs:element ref="dir" /><!-- Local Directory branching off partition -->
    <xs:element ref="lupgmt" /><!-- Last Update in GMT format -->
   </xs:sequence>
   <xs:attribute name="ix" type="xs:NMTOKEN" use="required" />
  </xs:complexType>
 </xs:element>

 <xs:element name="entpath" type="xs:string" /><!-- Entity Path
branching off root mount point/dir (partition/directory) -->
 <xs:element name="cntlngth" type="xs:int"/><!-- Local TEXTUAL content
length -->
 <xs:element name="md5sum" type="xs:string"/><!-- ^ md5sum -->

 <xs:element name="loc">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="entpath" /><!-- Entity Path branching off root
mount point/dir (partition/directory) -->
    <xs:element ref="cntlngth" /><!-- Local TEXTUAL content length -->
    <xs:element ref="md5sum" /><!-- ^ md5sum -->
    <xs:element ref="ksh" minOccurs="1" maxOccurs="8" />
   </xs:sequence>
  </xs:complexType>
 </xs:element>

 <xs:element name="ent">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="web" />
    <xs:element ref="loc" />
   </xs:sequence>
   <xs:attribute name="ix" type="xs:NMTOKEN" use="required" />
   <xs:attribute name="uri" type="xs:string" use="required" />
  </xs:complexType>
 </xs:element>

<!-- Local Entities -->
 <xs:element name="LocEnts">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="ent" minOccurs="0" maxOccurs="unbounded" />
   </xs:sequence>
  </xs:complexType>
 </xs:element>

</xs:schema>

Received on Thursday, 31 July 2008 12:34:37 UTC