Subject: [xsl] How can I test the last preceding text character? From: Sascha Mantscheff <922492@xxxxxx> Date: Mon, 29 Oct 2007 22:27:37 +0100 |
How do I test if the very last character of any preceding text - be it in a parent or a sibling - has a certain value? Example: <a> This is parent text a not ending with an x. <d>This ends with an x</d> <e>This should issue a message.</e> This is parent text ending with an x </a> Now I want to know for each child element is if it is preceded by an "x". I can check the sibling with <xsl:if test="matches(preceding-sibling::*[1]/text()[last()],'x\$') "> <xsl:message> Element <xsl:value-of select="name()"/> is preceded by an x. </xsl:message> </xsl:if> But I cannot test the surrounding parent content with the same model because the parent text may surround the child text. What's the way to do it?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Testing for following tex, G. Ken Holman | Thread | RE: [xsl] How can I test the last p, Scott Trenda |
Re: [xsl] Q re Fo internal linking , G. Ken Holman | Date | RE: [xsl] How can I test the last p, Scott Trenda |
Month |