[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.