Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: schema extension question

From: "Daniel Marcus" <dmarcus@---.-----.--->
To: <xmlschema-dev@--.--->
Date: 4/20/2007 4:54:00 AM
To clarify, below is some skeleton schema that sort of does what we
want, but it doesn't enforce the rule that StudyType1 uses only
StudyType1 parts. How do we ensure that we don't end up with this:

<StudyType1>

        <part1 xsi:type="studyType1_part1">This is good<part1>

        <part2 xsi:type="studyType2_part2">Uh Oh!<part2>

</StudyType1>

 

Thanks for you attention,

Dan Marcus

 

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">

            <xs:complexType name="abstract_part1" abstract="true"/>

            <xs:complexType name="studyType1_part1">

                        <xs:complexContent>

                                    <xs:extension
base="abstract_part1"/>

                        </xs:complexContent>

            </xs:complexType>

            <xs:complexType name="studyType2_part1">

                        <xs:complexContent>

                                    <xs:extension
base="abstract_part1"/>

                        </xs:complexContent>

            </xs:complexType>

            <xs:complexType name="abstract_part2" abstract="true"/>

            <xs:complexType name="studyType1_part2">

                        <xs:complexContent>

                                    <xs:extension
base="abstract_part2"/>

                        </xs:complexContent>

            </xs:complexType>

            <xs:complexType name="studyType2_part2">

                        <xs:complexContent>

                                    <xs:extension
base="abstract_part2"/>

                        </xs:complexContent>

            </xs:complexType>

            <xs:complexType name="abstract_study" abstract="true">

                        <xs:sequence>

                                    <xs:element name="part1"
type="abstract_part1"/>

                                    <xs:element name="part2"
type="abstract_part2"/>

                        </xs:sequence>

            </xs:complexType>

            <xs:complexType name="studyType1">

                        <xs:annotation>

                                    <xs:documentation>This should
require parts 1 and 2 to use studyType1 parts</xs:documentation>

                        </xs:annotation>

                        <xs:complexContent>

                                    <xs:extension
base="abstract_study"/>

                        </xs:complexContent>

            </xs:complexType>

            <xs:complexType name="studyType2">

                        <xs:annotation>

                                    <xs:documentation>This should
require parts 1 and 2 to use studyType1 parts</xs:documentation>

                        </xs:annotation>

                        <xs:complexContent>

                                    <xs:extension
base="abstract_study"/>

                        </xs:complexContent>

            </xs:complexType>

            <xs:element name="StudyType1" type="studyType1"/>

            <xs:element name="StudyType2" type="studyType2"/>

</xs:schema>

 

________________________________

From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...]
On Behalf Of Daniel Marcus
Sent: Thursday, April 19, 2007 5:18 PM
To: xmlschema-dev@w...
Subject: schema extension question

 

Hi-

 

Hi-

 

My group is designing a schema for neuroimaging.  We're having trouble
tackling what seems like a basic problem.  We'd like to create
containers that have similar content, along these lines:

 

<StudyType1>

            <StudyType1_part1>Some complex content<StudyType1_part1>

            <StudyType1_part2>Different complex
content<StudyType1_part2>

</StudyType1>

<StudyType2>

            <StudyType2_part1> Some complex content <StudyType2_part1>

            <StudyType2_part2> Different complex content
<StudyType2_part2>

</StudyType1>

 

*_part1 derive from the same base type (abstract_part1) and *_part2
derive from a different base type (abstract_part2).  Additionally, we
want to enforce that for each study type, part1 and part2 are matched by
study type (i.e. StudyType1 includes only StudyType1_part* elements).

 

Is there an appropriate XML Schema representation for this?  We've tried
substitution, extension, restriction... Nothing seems to capture this
sort of content.  Any advice would be appreciated.

 

Regards, 

Dan Marcus



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