Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Sanity check please

From: David Nedrow <dnedrow@---.--->
To: xml-dev@-----.---.---
Date: 3/1/2006 10:25:00 PM
I'm working on a new schema and have managed to get much of what I  
need done, but I'm afraid that I'm doing some things incorrectly in  
an effort to get it working. Sort of like adding closing parens to  
LISP code until it works. ;)

Here's what I'm trying to accomplish....

A schema that references several other schemas in which are defined  
an number of types. Everything to be pulled together by a catalog file.

I've included a heavily truncated and simplified version of what I'm  
working with. My questions are as follows...

1). Have I created an operable catalog file
2). Have I correctly built the <schema/> headers for the subsequent  
files?
3). If 1 & 2 are correct, why must I import the schemas in order to  
use their defined elements? Shouldn't that be handled via my catalog  
file and the <schema/> declarations?

I'd appreciate any input (good or bad) as to what I've provided  
below. I have other questions, but their are predicated on the  
answers to my questions above. ;)

-David

catalog.xml
=========

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog
   PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN"
          "http://www.oasis-open.org/committees/entity/release/1.0/ 
catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"  
prefer="public">
     <public publicId="-//NEDRON//FOO Base Types V1.0//EN"  
uri="basetypes.xsd"/>
     <public publicId="-//NEDRON//FOO Data Types V1.0//EN"  
uri="datatypes.xsd"/>
     <public publicId="-//NEDRON//FOO Test V1.0//EN" uri="test.xsd"/>
</catalog>

basetypes.xsd
===========

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns:ipbt="-//NEDRON//FOO Base Types V1.0//EN"
     elementFormDefault="qualified">
     <!--Declare a number of generic type equivalents-->
     <!-- string type -->
     <xs:complexType name="stringType" abstract="true">
         <xs:annotation>
             <xs:documentation>Character strings.</xs:documentation>
         </xs:annotation>
         <xs:simpleContent>
             <xs:extension base="xs:string"/>
         </xs:simpleContent>
     </xs:complexType>
</xs:schema>

datatypes.xsd
===========

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     targetNamespace="-//NEDRON//FOO Data Types V1.0//EN"
     xmlns:ipbt="-//NEDRON//FOO Base Types V1.0//EN"
     xmlns:ipdt="-//NEDRON//FOO Data Types V1.0//EN"
     elementFormDefault="qualified">
     <!--Generic descriptive text type -->
     <xs:import schemaLocation="ipbt.xsd"/>
     <xs:complexType name="descriptionType" abstract="true">
         <xs:annotation>
             <xs:documentation>This is a generic descriptive text
             entry.</xs:documentation>
         </xs:annotation>
         <xs:simpleContent>
             <xs:extension base="stringType"/>
         </xs:simpleContent>
     </xs:complexType>
</xs:schema>

test.xsd
======
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     targetNamespace="-//NEDRON//FOO Test V1.0//EN"
     xmlns:ipft="-//NEDRON//FOO Filter Types V1.0//EN"
     xmlns:ipdt="-//NEDRON//FOO Data Types V1.0//EN"
     elementFormDefault="qualified">
     <xs:import schemaLocation="basetypes.xsd"/>
     <xs:import schemaLocation="datatypes.xsd"/>
     <xs:element name="ruleset">
         <xs:complexType>
             <xs:sequence>
                 <xs:element name="rule" minOccurs="1"  
maxOccurs="unbounded">
                     <xs:complexType>
                         <xs:sequence>
                             <xs:element name="name"  
type="descriptionType"
                                 minOccurs="1" maxOccurs="1"/>
                             <xs:element name="desc"  
type="descriptionType"
                                 minOccurs="1" maxOccurs="1"/>
                             <xs:element name="vdesc"  
type="descriptionType"
                                 minOccurs="1" maxOccurs="1"/>
                         </xs:sequence>
                     </xs:complexType>
                 </xs:element>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
</xs:schema>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent