Query reg Recursion

hi team,

I was wondering if you could help me in understanding and designing the
recursion in the XSD. My question is regarding defining the max depth of
the recursion at the time of definition of the schema. For ex, if I refer
to a recursive element, I want to define the number of times the element
can be called recursively.

This way I can avoid infinite recursion or creating duplicate objects for
calling an object within itself. Please find below the sample schema that I
prepared to explain this issue:

*<?xml version="1.0" encoding="UTF-8"?>*
*<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"*
*    attributeFormDefault="unqualified">*
*
*
*    <xsd:element name="Ety" type="Entity"/>*
*    <xsd:complexType name="Entity">*
*        <xsd:sequence>*
*            <xsd:element name="A" type="xsd:string" minOccurs="0"/>*
*            <xsd:element name="B" type="xsd:string" minOccurs="0"/>*
*            <xsd:element name="C" type="xsd:string" minOccurs="0"/>*
*            <xsd:element name="EntityAssoc" type="EntityAssoc"
minOccurs="0"/>*
*        </xsd:sequence>*
*    </xsd:complexType>*
*    <xsd:complexType name="EntityAssoc">*
*        <xsd:sequence>*
*            <xsd:element name="C" type="xsd:string" minOccurs="0"/>*
*            <xsd:element name="D" type="xsd:string" minOccurs="0"/>*
*            <xsd:element type="Entity" name="Entity" minOccurs="0"/>*
*        </xsd:sequence>*
*    </xsd:complexType>*
*</xsd:schema>*

I want only one iteration of the EntityAssoc within Entity. Could you
please let me know if this is possible?

Thanks a lot for your help,

Regards,
Krishna Kamal

Received on Friday, 10 February 2012 08:05:32 UTC