|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: grouping by child element
> I have a simple list of data coming from a stored proc. I > have a sort set up based on user selection. > the xml looks like this (using soap request/response method) > <GetMerchantListResponse> > <Merchant merchID="some_number"> > <merchName>Some_name</merchName> > <merchActive>boolean value</merchActive> > <merchIsoID>ISO ID number</merchIsoID> > </Merchant> > </GetMerchantListResponse> > I have them sorted (initially) by merchIsoID. What I need to > do is group them into tables based on this element. Have you read the FAQ (follow the link at the bottom of this mail) on sorting and grouping? > > Below is the xsl i am working with: > <xsl:template match="/"> > <xsl:apply-templates select="//SOAP-ENV:Fault"/> > <xsl:apply-templates select="//GetMerchantListResponse"> > <xsl:sort select="//Merchant"/> > </xsl:apply-templates> > </xsl:template> > The "//" at the beginning of the first two expressions is inefficient but not incorrect. In the <xsl:sort> it is disastrous: it means that instead of selecting the Merchant part of each GetMerchantListResponse, you are using the first Merchant in the data as the sort key for each record. In any case, Merchant seems an odd choice of sort key as it is a composite value. Your narrative suggests that you want <xsl:sort select="Merchant/merchIsoId"/> Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








