[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Sanity check please

  • To: xml-dev@l...
  • Subject: Sanity check please
  • From: David Nedrow <dnedrow@u...>
  • Date: Wed, 1 Mar 2006 17:30:11 -0500
  • Z-usanet-msgid: XID035kcawA30403X40

xs import schemalocation
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>


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.