Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


extending schema

From: "Dhanji R. Prasanna" <dhanji@-----.--->
To: xmlschema-dev@--.---
Date: 4/10/2007 1:38:00 AM
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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent