Subject: RE: [xsl] Testing the following element From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Thu, 18 Jul 2002 08:47:25 +0100 |
<xsl:template match="d[following-sibling::*[1][self::c]]"> Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Philippe Figon > Sent: 18 July 2002 02:37 > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Testing the following element > > > Hello, > > In a book I transform from xml to LaTeX using xslt, I have a > hierachical structure of this kind : > > <Chapter> > <a><a1>hello</a1> > <b> > <c>blah blah</c> > <d> > <c>blah blah</c> > </d> > <c>blah blah</c> > <d> > <c>blah blah</c> > </d> > <e> > <c>blah blah</c> > </e> > </b> > </a> > </Chapter> > > And I want to test if the <d>..</d> element is followed > immediately (that's the point) by an <c>..</c> element. The > case of a <c>..</c> element included in something else (an > <e>..</e> here) mustn't validate the test. To put it simple, > with the example above, I want the first <d>...</d> element > to match a certain template, while the second <d>...</d> must > match another template. Using test="following-sibling::c" > doesn't work for it's always valid when a <c>..</c> element > is included in one of the following brother of <d>..</d>. > I've tried to add some position test but I can't make it work > properly. > > Can anyone help ? > > Thanks > > Philippe > > philippe.figon@xxxxxxxxxxxx > > Philippe > > > 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 -> |
---|---|---|
[xsl] Testing the following element, Philippe Figon | Thread | RE: [xsl] Testing the following ele, Jarno . Elovirta |
Re: [xsl] Including an external xml, Mike Brown | Date | RE: [xsl] Including an external xml, Michael Kay |
Month |