Subject: RE: does position () work with old MS namespace From: Andrew Kimball <akimball@xxxxxxxxxxxxx> Date: Fri, 1 Sep 2000 18:39:43 -0700 |
Try this: <xsl:if test=".[context()!index() $eq$ 1]"> If you want to "reach" further up the context stack, call context() with a parameter, e.g. context(-1), context(-2), etc. -1 is the default and selects the current context query. Also, all expressions must return a node-set in XQL, which is why I used the dummy '.' with a predicate. ~Andy Kimball MSXSL Dev -----Original Message----- From: Mike Brown [mailto:mike@xxxxxxxx] Sent: Friday, September 01, 2000 11:01 AM To: xsl-list@xxxxxxxxxxxxxxxx Subject: Re: does position () work with old MS namespace > > Try using [1] instead of [position()=1] (just guessing) > > Tried <xsl:if test="[1]"> Yeah that's not going to work. I should have clarified that you can only use [1] when you're selecting nodes to process (as in apply-templates or for-each), like /path/to/some/nodes[1] will be the node at position 1 from among the set selected by /path/to/some/nodes. If the position you want is relative to nodes that have already been selected (the current node list, in the context)... then position() is required. Perhaps MSXML has an alternative you can use. I'd check the docs at msdn.microsoft.com. 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: does position () work with old , Mike Brown | Thread | Linking, Pointer, XLL, Brand_Niemann |
Re: Position() question, Mike Brown | Date | Re: Embedding html in xml problem, Jeni Tennison |
Month |