Re: Non-native attributes

Thanks. I derived this from an example in "Definitive XML Schema" by P. Welmsey p.103. Either I read it wrong or the example is in error.

  ----- Original Message ----- 
  From: Bob Schloss 
  To: Sal Mangano ; xmlschema-dev@w3.org 
  Sent: Wednesday, July 10, 2002 12:06 PM
  Subject: Re: Non-native attributes


  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" schemaLocation="..."/>
  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



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

  To: <xmlschema-dev@w3.org>
  cc: 
  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-native
  attribute
  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" 

    xmlns:db="http://www.morganstanley.com/fid/db"
    xmlns:xsi="http://www.w3.org/2001/XMLScheam-instance"
    xsi:schemaLocation="http://www.morganstanley.com/fid/db
  u:/dev/mapml/db.xsd">

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

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

    </xs:sequence>
    </xs:complexType>
  </xs:element>

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

  </xs:schema>



  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"
  xmlns="http://www.morganstanley.com/fid/db"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:attribute name="joindef" type="xs:boolean">
  <xs:annotation>
  <xs:documentation>Attach this attribute to fields that define the
  collection of all data that are decendants of the root.</xs:documentation>
  </xs:annotation>
  </xs:attribute>
  </xs:schema>

Received on Wednesday, 10 July 2002 13:14:58 UTC