Subject: Re: selecting elements by attributes when working with namespaces
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Tue, 22 Jul 2008 16:57:06 +0200 (CEST)
|
Joelle Tegwen wrote:
> Never do which? I'm not quite sure what you're saying here.
Never use DOE (unless you know exactly what you do, but here you
don't need it).
> I receive
[...]
> I want:
[...]
Ok, you want positional grouping then. The following stylesheet
should do what you are after (the interesting part is of course the
for-each-group):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tt="http://www.w3.org/2006/04/ttaf1"
version="2.0">
<xsl:output indent="yes"/>
<xsl:template match="/">
<div class="transcript">
<xsl:apply-templates select="tt:tt/tt:body/tt:div"/>
</div>
</xsl:template>
<xsl:template match="tt:div">
<dl>
<xsl:for-each-group
select="tt:p"
group-starting-with="tt:p[tt:span]">
<dt>
<xsl:value-of select="tt:span"/>
</dt>
<dd>
<xsl:text>[ldquo;]</xsl:text>
<xsl:value-of separator=" " select="
current-group()/text()[last()]"/>
<xsl:text>[rdquo;]</xsl:text>
</dd>
</xsl:for-each-group>
</dl>
</xsl:template>
</xsl:stylesheet>
Regards,
--drkm
_____________________________________________________________________________
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
|