OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Schema validation of recursive structures

[ Lists Home | Date Index | Thread Index ]

Recursive structures are certainly possible in schemas.  A common example would be recursive <section> elements, say with a title and one or more paras and zero or more sections.
 
Here's a DTD sample:
 
<!ELEMENT section  (title , para+ , section*) >
 
Here's a Schema sample:
 
      <xsd:element name="section">
         <xsd:complexType>
            <xsd:sequence>
               <xsd:element ref="title"/>
               <xsd:element ref="para" maxOccurs="unbounded"/>
               <xsd:element ref="section" minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
         </xsd:complexType>
      </xsd:element>
 
The minOccurs and maxOccurs of course can be further defined.


From: Alessandro Barbosa [mailto:abarbosa@fpf.br]
Sent: Thursday, January 20, 2005 1:40 PM
To: xml-dev@lists.xml.org
Subject: [xml-dev] Schema validation of recursive structures

Hello to everyone,

I have a problem and I don't know how solved it.

 

I need validates a node seem at this:

<root>

<A>

            <element1/>

            <element2/>

            <A>

                        <element1/>

                        <element2/>

                        <element3/>

                        <A>

                                   <element1/>

                        <A>

            <A>

</A>

            </root>

 

            The node A shall have sub items of itself, is it possible?

 

Thank's

 

 


Alessandro de A. Barbosa

System Developer

Fundação Des. Paulo Feitoza - Manaus - AM

Mobile : 8125 - 7719

Business Phone: 55 92 614-9797

 

Msn: alessandrovila@hotmail.com

ICQ: 241240451; Status:  


 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.837 / Virus Database: 570 - Release Date: 17/1/2005





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS