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>


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:element ref="x:P"/>
    <xs:group ref="x:lists"/>
    <xs:group ref="x:blocktext"/>
    <xs:element ref="x:TABLE"/>

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"/>


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

  <xs:group name="block">
      <xs:group ref="c:lsb_core_blocks"/>
      <xs:group ref="x:block"/>

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

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

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"/>


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:title>[ Enter Article Title ]</c:title>
  <P>[ Enter Article Paragraph ]</P>
    <c:title>[ Enter Section Title ]</c:title>
    <P>[ Enter Section Paragraph ]</P>

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,
Received on Wednesday, 9 April 2003 15:28:50 UTC

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