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

RE: filter

Subject: RE: filter
From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
Date: Tue, 3 Dec 2002 13:41:19 -0000
xs pattern value
Paul,

Why not substitute
/xs:element/xs:complexType/xs:sequence/xs:element[@maxOccurs=5] for
xs:element[starts-with(@ref,'GRP')] ? 
It doesn't have to be '5', but it can't be a variable.

regards,
Tom

> -----Original Message-----
> From: Paul [mailto:reganmian@xxxxxxxxx]
> Sent: 03 December 2002 13:31
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  filter
> 
> 
> Can somebody give any hints on the key definition
> from string filter to other fact, as I don't think 
> a variable can be defined over the key.
> 
> many thanks
> Paul
> ===========================
> I had a filter question need help, many thanks in
> advance !!
> 
> Instead of being filtered by
> [starts-with(@ref,'GRP')]
> Is there a way  use the fact that it is a
> /xs:element/xs:complexType/xs:sequence/xs:element[@maxOccurs=
> 
> some value] (to identify/filter the 'GRP' element)
> 
> There are several places in the XSL(the XSL is 
> for the schema in the back) using this filter :
> <xsl:key name="byGRP"
> match="xs:element[not(starts-with(@ref, 'GRP'))]"
> use="generate-id(preceding::xs:element
> 	[starts-with(@ref,'GRP')][1])"/>
> 
> <xsl:key name="elements" match="xs:element" 
> 	use="generate-id((preceding-sibling::xs:element |
> self::xs:element)
> [starts-with(@ref,'GRP')][last()])"/>
> 
> <xsl:template match="xs:sequence">
> ...
> 	<xsl:for-each select="//xs:element[starts-with
> (@ref,'GRP')]">
> 	...
> 	<xsl:for-each select ="(xs:element |
> xs:choice/xs:element | xs:sequence/xs:element |
> xs:choice/xs:sequence/xs:element)[starts-with(@ref,
> 'GRP')][1]">
> 	...
> </xsl>
> 
> 
> 
> ======== schema =======
> <xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="snoopy-a">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:sString">
> 			<xs:length value="9"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="snoopy-b">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:length value="2"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="snoopy-c">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:length value="2"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="snoopy-d">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:maxLength value="4"/>
> 			<xs:pattern value="[a-z,A-Z,\s]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="snoopy-e">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:length value="2"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="snoopy-f">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:length value="2"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="rabbit-tele">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:length value="10"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="rabbit-name">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:length value="2"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="WOLF-tele">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:length value="10"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:element name="WOLF-name">
> 	<xs:simpleType>
> 		<xs:restriction base="xs:string">
> 			<xs:length value="2"/>
> 			<xs:pattern value="[0-9]*"/>
> 		</xs:restriction>
> 	</xs:simpleType>
> </xs:element>
> <xs:complexType name="rabbit">
> 	<xs:sequence>
> 		<xs:element ref="rabbit-tele" minOccurs="0"/>
> 		<xs:element ref="rabbit-name" minOccurs="0"/>
> 	</xs:sequence>
> </xs:complexType>
> <xs:element name="Harry-GROUP-ROW" type="rabbit"/>
> <xs:element name="Harry-GROUP">
> 	<xs:complexType>
> 		<xs:sequence>
> 			<xs:element ref="Harry-GROUP-ROW"
> maxOccurs="unbounded"/>
> 		</xs:sequence>
> 	</xs:complexType>
> </xs:element>
> <xs:complexType name="WOLF">
> 	<xs:sequence>
> 		<xs:element ref="WOLF-tele" minOccurs="0"/>
> 		<xs:element ref="WOLF-name" minOccurs="0"/>
> 	</xs:sequence>
> </xs:complexType>
> <xs:element name="MickeyMouse-GROUP-ROW"
> type="WOLF"/>
> <xs:element name="MickeyMouse-GROUP">
> 	<xs:complexType>
> 		<xs:sequence>
> 			<xs:element ref="MickeyMouse-GROUP"
> maxOccurs="unbounded"/>
> 		</xs:sequence>
> 	</xs:complexType>
> </xs:element-->
> 
> <!--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
> <xs:element name="MSG">
> 	<xs:complexType>
> 			<xs:sequence>
> 				<xs:element ref="snoopy-a"/>
> 				<xs:element ref="snoopy-b"/>
> 				<xs:element ref="snoopy-c"/>
> 				<xs:element ref="Harry-GROUP"/>
> 				<xs:element ref="snoopy-d"/>
> 				<xs:element ref="snoopy-e"/>
> 				<xs:element ref="MickeyMouse-GROUP"/>
> 				<xs:element ref="snoopy-f"/>
> 				<xs:choice>
> 					<xs:element ref="snoopy-g"/>
> 					<xs:element ref="snoopy-h"/>
> 				</xs:choice>
> 				<xs:element ref="snoopy-i"/>
> 				<xs:element ref="snoopy-j"/>
> 				<xs:element ref="WoodStock-GROUP"/>
> 			</xs:sequence>
> 	</xs:complexType>
> </xs:element>
>  
> </xs:schema>
> 
>  
> many thanks 
> 
> Paul
>  
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

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


Current Thread
  • filter
    • Paul - Mon, 2 Dec 2002 11:16:20 -0500 (EST)
      • Paul - Tue, 3 Dec 2002 08:26:02 -0500 (EST)
      • <Possible follow-ups>
      • TSchutzerWeissmann - Tue, 3 Dec 2002 08:36:46 -0500 (EST) <=
        • Paul - Tue, 3 Dec 2002 13:15:45 -0500 (EST)
          • Joerg Heinicke - Tue, 3 Dec 2002 13:31:54 -0500 (EST)
          • Paul - Tue, 3 Dec 2002 13:44:15 -0500 (EST)
          • Paul - Tue, 3 Dec 2002 18:24:26 -0500 (EST)

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.