W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2002

Re: Non-native attributes

From: Bob Schloss <rschloss@us.ibm.com>
Date: Wed, 10 Jul 2002 12:06:48 -0400
To: "Sal Mangano" <sal.mangano@morganstanley.com>, xmlschema-dev@w3.org
Message-ID: <OF5413CFFD.A5BFBCF8-ON85256BF2.005804DF@us.ibm.com>

If a non-native attribute is an attribute declare in a different
targetNamespace, then normally you would include in the using schema an
import element information item.

Something like
<xs:import namespace="http://www.morganstanley.com/fid/db"
although the schemaLocation is technically optional.

I can see that you may not be completely clear about namespace and
incorporated document handling in schema, because the xsi:schemaLocation
attribute which you have on your schema element makes no sense.  All the
attribute in the xsi: namespace are intended to be used in instance
documents, not in schemas.

Note that a good schema diagnostic tool (and one I contributed to) is the
IBM XML Schema Quality Checker. You can download it from http://www.
alphaworks.ibm.com/tech/xmlsqc .  It often finds subtle errors not found by
XMLSpy, and sometimes suggests the appropriate change to your schema.

Another good tool is XSV.  A complete list of tools is at http://www.w3.
org/XML/Schema .

Bob Schloss
IBM T. J. Watson Research Center
Hawthorne, NY, USA

"Sal Mangano" <sal.mangano@morganstanley.com>@w3.org on 07/10/2002 11:53:12

Sent by:    xmlschema-dev-request@w3.org

To:    <xmlschema-dev@w3.org>
Subject:    Non-native attributes

I am designing a XSD schema in XML Spy v4.4 that uses a non-native
attribute. XML Spy is complaining that the schema that defines my non-
has "no content model". Am I doing something wrong or is this the tools
problem. See below.

This is my main scheama:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

 <xs:element name="SwapMain">
   <xs:documentation>The main Swap Table in the database</xs:documentation>
    <xs:element name="SName" type="xs:string" db:joindef="true"/>
    <xs:element name="SStatus"/>

    <!-- Lots more irrelevant stuff here ...-->


    <!-- Lots more irrelevant stuff here ...-->


This is the schema defining the non-native attribute:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.morganstanley.com/fid/db"
 <xs:attribute name="joindef" type="xs:boolean">
   <xs:documentation>Attach this attribute to fields that define the
collection of all data that are decendants of the root.</xs:documentation>
Received on Wednesday, 10 July 2002 12:08:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:04 UTC