schema with russian doll design structure

Hello,

I have XML documents with multiple levels of element hierarchy and tags with attributes and I need to create a schema with Russian Doll design structure for it. How do I do that? Do you know any tutorials on how to create a schema with russian doll design structure?

Thanks!
bluepaintAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gertone (Geert Bormans)Information ArchitectCommented:
Here is a brief mentioning of Russian Doll design.
http://www.xml.com/lpt/a/691

I have a WROX book on XML schema, that is not good but covers Russian doll extensively.

But basically all you need to know can be sumarised in the two lines referenced above and the example

Now, do you have a compelling reason for using russian doll?
The problem with rusian doll is that all element declarations are local.
This could have namespace implications, but that is likely not an issue here
But this also means that you can't reference element declarations,
forcing you to guess before hand how deep you want to nest

    <xs:element name="sect">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="sect" minOccurs="0">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="sect" minOccurs="0">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="sect" minOccurs="0">
                                            <xs:complexType>
                                                <xs:sequence>
                                                    <xs:element name="sect" minOccurs="0">
                                                        ...
                                                    </xs:element>
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

the schema going four levels deep.
Note that technically the four levels are different element types
and you need to repeat all definitions thta you have inside them

Here is the variant for another schema style

<xs:element name="section">
    <xs:complexType>
        <xs:sequence>
            <xs:element ref="section" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
</xs:element>

If you have an unknown nesting in your XML,
you can't use Russion doll
(I strongly recommend that you don't)

And I am very curious what reason you could possibly have to decide on russian doll with these requirements
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bluepaintAuthor Commented:
I need to use Russian doll because that is what's required of us. lol! Actually, I also need to use flat catalog using the same xml document. To compare which one's better I guess.
0
Gertone (Geert Bormans)Information ArchitectCommented:
Is this homework?
Sounds like homework almost.
From the design point of view, I see no compelling reason to force a suboptimal design methodology for a task.
This is either a crazy architect involved, or a teacher that wants you to find out that RD is no good for infinite nesting :-)
0
bluepaintAuthor Commented:
Yes, it is homework/proj. Thanks for your inputs!
0
Gertone (Geert Bormans)Information ArchitectCommented:
welcome
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.