Subject: Re: [xsl] Just the first 'x' elements within a for-each From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Tue, 18 Mar 2003 11:10:16 +0000 |
Hi Si, > [Using a predicate] doesn't seem to want to work whereas using: > > <xsl:if test="position() <= 2"> > > within the for-each does? Might this be something to do with the XSL > parsing in XML Spy 5? I guess that it could be: if you haven't got MSXML3 installed, then XML Spy might be using MSXML2, which doesn't support XSLT. But that would depend on the namespace that you're using in the stylesheet. You don't describe in what way it "doesn't work", so it's hard to tell. Can you show a full stylesheet with the code that doesn't work and the code that does? > Oh and I had a good look around but couldn't find a simple > description for 'declarative programming'? I think of it in terms of programming by saying *what* you want to do rather than in terms of *how* you want to do it. So instead of phrasing your requirement in procedural terms as "I want to loop over all the nodes and stop after the second", say "I want to process the first two nodes". Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Just the first 'x' elemen, Simon . Fairey | Thread | Re: [xsl] Just the first 'x' elemen, Simon . Fairey |
RE: [xsl] xsl:variable and creating, Américo Albuquerque | Date | [xsl] local extremums, Evgenia Firsova |
Month |