← Prev in month
← Prev in thread
Next in thread →
Next in month →
Spaces after element
I'm using XSL to transform xml and then I use a style sheet. I'm
displaying the result in Internet explorer.
here's my one-line code
<xsl:otherwise>
<p class="mn">
<xsl:for-each select="DEFe">“<xsl:value-of select="current()"/>”<xsl:variable name="pos1" select="position()"/><xsl:if test="position()!=last()"><xsl:variable name="separ"><xsl:value-of select="../DefSep[position()=$pos1]"/></xsl:variable><xsl:if test="not(starts-with($separ, ','))"><xsl:text> </xsl:text></xsl:if><xsl:value-of select="../DefSep[position()=$pos1]"/><xsl:text> </xsl:text></xsl:if></xsl:for-each><br/>
<xsl:if test="DEFf">
<xsl:variable name="posDefFr" select="position()"/>
<xsl:for-each select="DEFf">« <xsl:value-of select="current()"/> »<xsl:variable name="pos2" select="position()"/><xsl:if test="position()!=last()"><xsl:variable name="separ"><xsl:value-of select="../DefSep[position()= ($contDefEn -1) + $pos2]"/></xsl:variable><xsl:if test="not(starts-with($separ, ','))"><xsl:text> </xsl:text></xsl:if><xsl:value-of select="../DefSep[position()= ($contDefEn -1) + $pos2]"/><xsl:text> </xsl:text></xsl:if></xsl:for-each><br/>
</xsl:if>
<p class="Def">
<xsl:apply-templates select="./child::*[name() != 'DEFf' and name() != 'DEFe']"/>
</p>
</xsl:otherwise>
</xsl:choose>
Wich should look like :
word1, word2 and word3 or word4
« mot1 », « mot2 » et « mot3 » ou « mot4 »
Word1 has a specific meaning;
But if it is on multiple line (a space apear before the comma)
it looks like this
word1 , word2 and word3 or word4
« mot1 » , « mot2 » et « mot3 » ou « mot4 »
Word1 has a specific meaning;
Here's the XML
<Definition>
<DEFe>word1</DEFe>
<DefSep>,</DefSep>
<DEFe>word2</DEFe>
<DefSep>and</DefSep>
<DEFe>word3</DEFe>
<DefSep>or</DefSep>
<DEFe>word4</DEFe>
<DEFf>mot1</DEFf>
<DefSep>,</DefSep>
<DEFf>mot2</DEFf>
<DefSep>et</DefSep>
<DEFf>mot3</DEFf>
<DefSep>ou</DefSep>
<DEFf>mot4</DEFf>
<Content><DEFe>word1</DEFe> has a specific meaning;</Content>
</Definition>
Thanks
here's my one-line code
<xsl:otherwise>
<p class="mn">
<xsl:for-each select="DEFe">“<xsl:value-of select="current()"/>”<xsl:variable name="pos1" select="position()"/><xsl:if test="position()!=last()"><xsl:variable name="separ"><xsl:value-of select="../DefSep[position()=$pos1]"/></xsl:variable><xsl:if test="not(starts-with($separ, ','))"><xsl:text> </xsl:text></xsl:if><xsl:value-of select="../DefSep[position()=$pos1]"/><xsl:text> </xsl:text></xsl:if></xsl:for-each><br/>
<xsl:if test="DEFf">
<xsl:variable name="posDefFr" select="position()"/>
<xsl:for-each select="DEFf">« <xsl:value-of select="current()"/> »<xsl:variable name="pos2" select="position()"/><xsl:if test="position()!=last()"><xsl:variable name="separ"><xsl:value-of select="../DefSep[position()= ($contDefEn -1) + $pos2]"/></xsl:variable><xsl:if test="not(starts-with($separ, ','))"><xsl:text> </xsl:text></xsl:if><xsl:value-of select="../DefSep[position()= ($contDefEn -1) + $pos2]"/><xsl:text> </xsl:text></xsl:if></xsl:for-each><br/>
</xsl:if>
<p class="Def">
<xsl:apply-templates select="./child::*[name() != 'DEFf' and name() != 'DEFe']"/>
</p>
</xsl:otherwise>
</xsl:choose>
Wich should look like :
word1, word2 and word3 or word4
« mot1 », « mot2 » et « mot3 » ou « mot4 »
Word1 has a specific meaning;
But if it is on multiple line (a space apear before the comma)
it looks like this
word1 , word2 and word3 or word4
« mot1 » , « mot2 » et « mot3 » ou « mot4 »
Word1 has a specific meaning;
Here's the XML
<Definition>
<DEFe>word1</DEFe>
<DefSep>,</DefSep>
<DEFe>word2</DEFe>
<DefSep>and</DefSep>
<DEFe>word3</DEFe>
<DefSep>or</DefSep>
<DEFe>word4</DEFe>
<DEFf>mot1</DEFf>
<DefSep>,</DefSep>
<DEFf>mot2</DEFf>
<DefSep>et</DefSep>
<DEFf>mot3</DEFf>
<DefSep>ou</DefSep>
<DEFf>mot4</DEFf>
<Content><DEFe>word1</DEFe> has a specific meaning;</Content>
</Definition>
Thanks
Mathieu
Lafleur
IROSOFT inc.
3900 Côte-Vertu, bureau 208
St-Laurent (Québec)
H4R 1V4
Tel : (514) 920-0020 ext. 35
Fax : (514) 920-0028
Site WEB :
http://www.irosoft.com
← Prev in month
← Prev in thread
Next in thread →
Next in month →