Subject: RE: Problems with sort. From: Kay Michael <Michael.Kay@xxxxxxx> Date: Sat, 10 Jun 2000 17:47:17 +0100 |
> I want it to sort by whatever the element > is in /PAGE/@sort. Ah, I see now. <xsl:sort select="*[name()=/PAGE/@sort]"/> Mike Kay > I have tried so many combinations to try and tell it where to find the > attribute @sort. I'm assuming that not finding it is what's > causing it not to > sort. > > <?xml version="1.0"?> > <PAGE title="Display Projects" sort="title"> > <projects> > <project> > <number> > 1114 > </number> > <title> > Test Title > </title> > <site_code> > INCTM > </site_code> > <department> > 0 > </department> > </project> > </PAGE> > > <xsl:template match="projects"> > <xsl:apply-templates> > <xsl:sort select="Here is where I need help!"/> > </xsl:apply-templates> > </xsl:template> > > Brian > > Kay Michael wrote: > > > > I have this code: > > > > > > <xsl:apply-templates> > > > <xsl:sort select="/PAGE/@sort"/> > > > </xsl:apply-templates> > > > > > > It doesn't give an error, but isn't sorting by the value of > > > "/PAGE/@sort". > > > > Since the sort key is an absolute path, its value doesn't > depend on the > > context node, so it will have the same value for every node > in the node-set > > you are trying to sort. Sort keys should normally be relative paths. > > > > Mike Kay > > > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > > -- > > Brian N. > Burridge > Internet Architect > (727) 399-3000 Ext 3515 > The Internet Group - ITSS > Cox Target Media > > "Until a person can say deeply and honestly, "I am what I am > today because of > the choices I made yesterday," that person cannot say, "I > choose otherwise." > > > > 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Xpointer and Axes question., Joe Poptiya | Thread | Re: Problems with sort., Brian Burridge |
Re: Xpointer and Axes question., Elliotte Rusty Harol | Date | [no subject], alex chang |
Month |