[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Getting

Subject: Getting
From: "Peter Janker" <xdevpj@xxxxxx>
Date: Thu, 24 Jun 2004 00:08:33 +0200
peter janker
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


Current Thread
  • Getting
    • Peter Janker - Thu, 24 Jun 2004 00:08:33 +0200 <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.