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

extending schema

From: Dhanji R. Prasanna <dhanji@gmail.com>
Date: Mon, 9 Apr 2007 15:38:14 +1000
Message-ID: <aa067ea10704082238u502391ffl254ab8c9d9316172@mail.gmail.com>
To: xmlschema-dev@w3.org
Hello

I am not sure if this is the right list for this question. I apologize if it
is not (please point me in the right direction!).

My question is about adding attributes to an xml document via an additional
schema. For example I would like to add to this:

<html   xmlns="http://www.w3.org/1999/xhtml"
        xml:lang="en" lang="en">

  <body>...etc.

....a custom schema that allows certain attributes to be defined on body,
span and so forth. I imagined something like this:

<html   xmlns:my="http://mynamespaceextentions"
        xmlns="http://www.w3.org/1999/xhtml"
        xml:lang="en" lang="en">

  <body my:customAttr="..." my:another="...">


I was unable to do this successfully via type substitution (I want all
elements to be extended):

    <xsd:complexType name="my-component">
        <xsd:complexContent>
            <xsd:extension base="xsd:all">
                <xsd:attribute name="customAttr" type="xsd:string"/>
                <xsd:attribute name="another" type="xsd:string"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

But obviously I am doing something wrong. Im sure it is the highlighted
portion. Then again I am not sure if this can be achieved at all with type
substitution. Is there any way that I can do this by extending (i.e.
importing) the xhtml schema directly into my schema perhaps?

Thanks in advance.

Dhanji.
Received on Monday, 9 April 2007 16:15:44 GMT

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