extending schema

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 UTC