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

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


....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"
        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:extension base="xsd:all">
                <xsd:attribute name="customAttr" type="xsd:string"/>
                <xsd:attribute name="another" type="xsd:string"/>

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.

Received on Monday, 9 April 2007 16:15:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:12 UTC