Re: tough XSLT problem
- From: Peter Flynn <peter.nosp@xxxxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 23:50:29 +0100
Bloody Viking wrote:
> Pardon me. My example wasn't clear. A contains any number of elements,
> which may be named with any letter, and it may contain multiple
> instances of an element named X (X may contain any text). So, one
> element A may have:
> <A><B/><C>C-text</C><X>X-text</X><D/><E/><X>X-text</X></A>
>
> another instance of A may be:
>
> <A><B/><C>C-text</C><D/><E/><X>X-text</X></A>
OK, gottit, thanks.
> The variable created must have the text of element C. If the element
> immediately following C is named X (as in the first example), the
> variable should then have a space followed by the text in X:
>
> C-text X-text
OK, then my first example will do (adding the space):
<xsl:template match="A">
<xsl:variable name="someText">
<xsl:value-of select="C">
<xsl:text> </xsl:text>
<xsl:if test="name(C/following-sibling::*[1])='X'">
<xsl:value-of select="D"/>
</xsl:if>
</xsl:variable>
<!-- more XSLT here -->
</xsl:template>
///Peter
.
- Follow-Ups:
- Re: tough XSLT problem
- From: Bloody Viking
- Re: tough XSLT problem
- References:
- tough XSLT problem
- From: Bloody Viking
- Re: tough XSLT problem
- From: Peter Flynn
- Re: tough XSLT problem
- From: Bloody Viking
- tough XSLT problem
- Prev by Date: Re: tough XSLT problem
- Next by Date: Re: tough XSLT problem
- Previous by thread: Re: tough XSLT problem
- Next by thread: Re: tough XSLT problem
- Index(es):
Relevant Pages
|