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

Re: filter

Subject: Re: filter
From: Paul <reganmian@xxxxxxxxx>
Date: Tue, 3 Dec 2002 15:29:38 -0800 (PST)
yahoo mail filters boolean
Hi 

sorry for long code

I recap the code as a very "shortest" one that I can.
my problem is that I have to use the fact of 
/xs:element/xs:complexType/xs:sequence/xs:element[@maxOccurs='unbounded']
instead of sth like starts-with(@ref, 'GRP')

I tried the amendment in the comment lines, but seems
there's still sth wrong, but I can see it.

is there any suggestion ?

thanks

===== schema =====
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
	<xs:element name="GRP-Harry-GROUP">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Harry-GROUP-ROW"
maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="SCSMSG">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="GRP-Harry-GROUP"/>			
				<xs:element ref="snoopy-a"/>
				<xs:element ref="snoopy-b"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

===== xsl =====
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" indent="no"/>

<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="byGRP"
  match="xs:element[@ref !=
//xs:element/@name[boolean(descendant::xs:complexType/xs:sequence/xs:element/@maxOccurs)]]"
 
use="generate-id(preceding::xs:element/@name[boolean(descendant::xs:complexType/xs:sequence/xs:element/@maxOccurs)][1])"/-->

<xsl:template match="xs:sequence">
	<xsl:variable name="first">
		<xsl:value-of select="*[1]/@ref |
*[1]//xs:element[1]/@ref"/>
	</xsl:variable>
	<xsl:choose>

	<xsl:when test="starts-with($first,'GRP')">
	<!--xsl:when
test="boolean(//xs:element/xs:complexType[../@name=$first])"-->
		<xsl:for-each select="//xs:element[starts-with(@ref,
'GRP')]">
		<!--xsl:for-each
select="//xs:element[boolean(//xs:element/xs:complexType[..@name=@ref])]"-->
			<xsl:variable name="me" select="generate-id()"/>
			<xsl:text>&#10;Group is </xsl:text><xsl:value-of
select="@ref"/> :
			<xsl:for-each select="key('byGRP',$me)">
				<xsl:value-of select="@ref"/> Starts
			</xsl:for-each>
		</xsl:for-each>
	</xsl:when>

	</xsl:choose>
</xsl:template>

</xsl:stylesheet>

__________________________________________________
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


Current Thread
  • RE: filter, (continued)
    • 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) <=
    • TSchutzerWeissmann - Wed, 4 Dec 2002 06:15:23 -0500 (EST)
      • Paul - Wed, 4 Dec 2002 08:47:22 -0500 (EST)
    • TSchutzerWeissmann - Wed, 4 Dec 2002 10:28:01 -0500 (EST)
      • Paul - Wed, 4 Dec 2002 13:13:48 -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.