W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2003

xs:redefine of a imported namespace group

From: Robert Koberg <rob@koberg.com>
Date: Wed, 9 Apr 2003 12:28:44 -0700
Message-Id: <200304091928.MAA26942@s5.servlets.net>
To: <xmlschema-dev@w3.org>

Hi,

I am trying to xs:redefine an xs:group from an imported schema, but that
group is referenced in an xs:complexType in the imported schema. Basically,
what I am trying to do is use the XHTML elements/attributes that I feel
would be semantically useful for our content management system clients and
then extend those with more things we think are useful for
content-piece-instance-documents, but not defined in XHTML. 

For example, the *imported* schema has the following group of 'block' types
of elements/groups defined:

<xs:group name="block">
  <xs:choice>
    <xs:element ref="x:P"/>
    <xs:group ref="x:lists"/>
    <xs:group ref="x:blocktext"/>
    <xs:element ref="x:TABLE"/>
  </xs:choice>
</xs:group>


This group is further refined by the following complexType in the *imported*
schema, like so:

<xs:complexType name="Flow" mixed="true">
  <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:group ref="x:block"/>
    <xs:element ref="x:FORM"/>
    <xs:group ref="x:inline"/>
    <xs:group ref="x:edit.inline"/>
  </xs:choice>
</xs:complexType>

-------------------

Then in the **importing** schema I redefine the 'block' group by:

<xs:redefine
schemaLocation="http://localhost:8080/lsb/Schemas/xhtml_modfd.xsd">
  <xs:group name="block">
    <xs:choice>
      <xs:group ref="c:lsb_core_blocks"/>
      <xs:group ref="x:block"/>
    </xs:choice>
  </xs:group>
</xs:redefine>

[[
'c:lsb_core_blocks' looks something like in the **importing** schema:

  <xs:group name="lsb_core_blocks">
    <xs:choice>
      ... etc ...
      <xs:element ref="c:callout"/>
      <xs:element ref="c:fineprint"/>
      <xs:element ref="c:tip"/>
      <xs:element ref="c:title"/>
      ... etc ...
    </xs:choice>
  </xs:group>
]]


Also in the **importing** schema I create a 'content-piece-type' for use in
our CMS app. This should have an 'article' root element and be able to use
the Flow complexType defined in the imported schema, which in turn includes
a choice for the redefined 'block' group from the importing schema....

For example:

<xs:element name="article">
  <xs:complexType mixed="true">
    <xs:complexContent mixed="true">
    <!-- NOTE: Flow is defined in the imported schema -->
      <xs:extension base="x:Flow">
        <xs:attributeGroup ref="x:coreattrs"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:element>

-------------------------

First, does the above even make sense? If it is, is what I am trying to do
appropriate/valid (the schema does validate). The problem is that I can't
get the schema to validate an instance document like:

<c:article 
  xmlns:c="http://livestoryboard.com/lsb/Schemas/2003/03/content" 
  xmlns="http://livestoryboard.com/lsb/Schemas/2003/03/xhtml1">
  <c:title>[ Enter Article Title ]</c:title>
  <P>[ Enter Article Paragraph ]</P>
  <c:section>
    <c:title>[ Enter Section Title ]</c:title>
    <P>[ Enter Section Paragraph ]</P>
  </c:section>
</c:article>

Any hints as to what I am doing wrong, or requests for any helpful
information I might be leaving out would be greatly appreciated (my head is
swimming in circles, currently...)

Thanks in advance,
-Rob
Received on Wednesday, 9 April 2003 15:28:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT