Subject: RE: grouping by child element From: Kay Michael <Michael.Kay@xxxxxxx> Date: Mon, 16 Oct 2000 17:30:01 +0100 |
> 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Including a document containing, Vernon_Imrich | Thread | How to convert XML to PDF ???, Shukla, Amit |
RE: Exclude Attributes from select?, Fenton, Brigitte (Th | Date | RE: Including a document containing, Evan Lenz |
Month |