RE: [xsl] Re: RE: Re: XPath riddle

Subject: RE: [xsl] Re: RE: Re: XPath riddle
From: "Nikolaos Giannadakis" <ngiann@xxxxxxxxxx>
Date: Fri, 6 Jul 2001 02:20:31 +0300
hi all,

with this schema

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
	<xsd:element name="C">
		<xsd:complexType>
			<xsd:choice minOccurs="0" maxOccurs="unbounded">
				<xsd:element name="V" type="B"/>
				<xsd:element name="W" type="A"/>
			</xsd:choice>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="B">
		<xsd:sequence minOccurs="0" maxOccurs="unbounded">
			<xsd:element name="E" type="A"/>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="A">
		<xsd:sequence minOccurs="0" maxOccurs="unbounded">

			<!-- RRR is causing confusion -->
			<xsd:element name="RRR">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="V">
							<xsd:complexType>
								<xsd:choice>
									<xsd:element name="E"/>
								</xsd:choice>
							</xsd:complexType>
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="D" type="B"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>

how would you select all Es of type A? Stating explicitly that RRR may not
appear in the wanted Es ancestors would not do (I guess),
because that would mean that partly identical paths should be identified
beforehand etc.


A possible XML instance could be this:


<C>
	<W>
		<RRR>
			<D>
				<E> bar </E>
			</D>
		</RRR>
		<D>
			<E>
				<RRR>
					<D>
						<E> foo </E>
					</D>
				</RRR>
				<D>
					<E/>
				</D>
			</E>
		</D>
	</W>
</C>

regards,

nikolas/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread