[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Spaces after element


displaying spaces in xsl
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">&#x201C;<xsl:value-of select="current()"/>&#x201D;<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">&#x00AB;&#xA0;<xsl:value-of select="current()"/>&#xA0;&#x00BB;<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/


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.