xsl-list
[Top] [All Lists]

Getting

2004-06-23 15:08:33
Hi,

I want to know whether or not an ancester of a node has an attribute maxOccurs 
and the value of this attribute.

For nodes like the countries in the example below t his can be done with:

<xsl:when test="ancestor::*/@maxOccurs">
        <xsl:value-of select="ancestor::*/@maxOccurs"/>
</xsl:when>

I get the '3' of the node <xs:element name="ACountry" minOccurs="0" 
maxOccurs="3">.

The question now is:

How do I find the attribute and get the 'unbounded' value of the node:
        <xs:element name="AnEntry" type="AnEntryType" maxOccurs="unbounded"/>

when the current node is i.e: 
<xs:element name="ANumber"> of the extended base of the complex type 
"AnEntryType"?

Any Ideas? Your help is greatly appreciated!

Thanks,

Peter


<xs:element name="AList">
        <xs:complexType>
            <xs:sequence>
            <xs:element name="AnEntry" type="AnEntryType" 
maxOccurs="unbounded"/>
                <xs:element name="OtherEntry" type="xs:string" minOccurs="0" 
maxOccurs="unbounded"/>
             </xs:sequence>
        </xs:complexType>
</xs:element>

<xs:complexType name="AnEntry">
        <xs:sequence>
                <xs:element name="AName" type="xs:string"/>             
                <xs:element name="ACountry" minOccurs="0" maxOccurs="3">
                        <xs:complexType>
                                <xs:sequence>
                                        <xs:element name="Europa" 
type="xs:string" minOccurs="0"/>
                                        <xs:element name="America" 
type="xs:string" minOccurs="0"/>
                                        <xs:element name="Asia" 
type="xs:string" minOccurs="0"/>
                                        <xs:element name="Africa" 
type="xs:string" minOccurs="0"/>
                                        <xs:element name="Australia" 
type="xs:string" minOccurs="0"/>
                                </xs:sequence>
                        </xs:complexType>
                </xs:element>
        </xs:sequence>
</xs:complexType>

<xs:complexType name="AnEntryType">
        <xs:complexContent>
                <xs:extension base="AnEntry">
                        <xs:sequence>
                                <xs:element name="ANumber">
                                        <xs:simpleType>
                                                <xs:restriction 
base="xs:positiveInteger">
                                                        <xs:minInclusive 
value="1"/>
                                                </xs:restriction>
                                        </xs:simpleType>
                                </xs:element>
                                <xs:element name="AMod" minOccurs="0">
                                        <xs:simpleType>
                                                <xs:restriction 
base="xs:decimal">
                                                        <xs:minInclusive 
value="0.5"/>
                                                        <xs:maxInclusive 
value="1.5"/>
                                                </xs:restriction>
                                        </xs:simpleType>
                                </xs:element>
                        </xs:sequence>
                </xs:extension>
        </xs:complexContent>
</xs:complexType>
_______________________________________________________
WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern
Informationen unter: http://freemail.web.de/?mc=021199



<Prev in Thread] Current Thread [Next in Thread>
  • Getting, Peter Janker <=