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

White spaces in xsl:text

Subject: White spaces in xsl:text
From: Yolanda Garcia Ulla <ygarcia@xxxxxxxxxxxxx>
Date: Mon, 03 Apr 2000 13:29:40 +0200
yolanda garcia ulla
Hi I'm Yolanda and I'm new in XSL then my knowledge is poor.

I want insert several white-spaces in a xsl:text and I can't because xsl stripped the white-spaces. I put the pag preserve-space but I can't get it works.

Can anyone help me?

I send you my xsl example, it's a style-sheet of one WAP Phone.

Thanks in advance.

Yolanda.
 

XSL Style-sheet
 

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:preserve-space elements="SimpleRow SimpleTableHeader SimpleCol"/>

   <!--
| The Result
+ -->
   <xsl:template match="ServiceRequest">
      <xsl:apply-templates select="//Result"></xsl:apply-templates>
   </xsl:template>

   <!--
| The SimpleResult
+-->
   <xsl:template match="SimpleResult">
      <wml>
         <head>
            <meta http-equiv="Cache-Control" content="max-age=16"></meta>
         </head>
         <template>
         <do type="prev" label="Atras">
              <prev></prev>
         </do>
         <do type="" label="WapMovistar">
             <go href=""></go>
         </do>
         </template>

         <xsl:choose>
            <xsl:when test="boolean(@title) and string-length(@title) > 0 and boolean(@onenterbackward)">
               <card title="{@title}" >
                  <xsl:apply-templates></xsl:apply-templates>
               </card>
            </xsl:when>
            <xsl:otherwise>
               <xsl:choose>
                  <xsl:when test="boolean(@title) and string-length(@title) > 0">
                     <card title="{@title}">
                        <xsl:apply-templates></xsl:apply-templates>
                     </card>
                  </xsl:when>
                  <xsl:otherwise>
                     <card title="">
                        <xsl:apply-templates></xsl:apply-templates>
                     </card>
                  </xsl:otherwise>
               </xsl:choose>
            </xsl:otherwise>
         </xsl:choose>
      </wml>
   </xsl:template>

   <!--
| The Container, only one expected per result
+-->
   <xsl:template match="SimpleContainer">
      <xsl:apply-templates></xsl:apply-templates>
   </xsl:template>

   <!--
| The SimpleText Mapping
| Note: The WML spec recommends the usage of the "strong" tag.
+-->
   <xsl:template match="SimpleText">
      <do type="" label="Volver">
         <xsl:variable name="volver">
            <xsl:value-of select="SimpleMenuItem/@target"></xsl:value-of>
         </xsl:variable>
         <go href=""></go>
      </do>
      <p>
         <xsl:apply-templates></xsl:apply-templates>
      </p>
   </xsl:template>

   <!--
|    The Text Item Mapping
+-->
   <xsl:template match="SimpleTextItem">
      <xsl:if test="(string-length(@name) != 0)">
         <xsl:value-of select="@name"></xsl:value-of>
         <xsl:text>: </xsl:text>
      </xsl:if>
      <xsl:value-of select="."></xsl:value-of>
      <br></br>
   </xsl:template>

   <!--
| The SimpleForm Mapping
|
+-->
   <xsl:template match="SimpleForm">
      <xsl:variable name="theTarget">
         <xsl:value-of select="@target"></xsl:value-of>
         <xsl:for-each select="SimpleFormItem | SimpleFormSelect">
            <xsl:text>&#38;</xsl:text>
            <xsl:value-of select="@name"></xsl:value-of>
            <xsl:text>=$(</xsl:text>
            <xsl:value-of select="@name"></xsl:value-of>
            <xsl:text>)</xsl:text>
         </xsl:for-each>
      </xsl:variable>
      <p>
          <xsl:apply-templates></xsl:apply-templates>
          <a href="">Aceptar</a>
      </p>
   </xsl:template>

   <!-- The Form Item Mapping -->
   <xsl:template match="SimpleFormItem">
      <strong>
         <xsl:value-of select="."></xsl:value-of>
      </strong>
      <xsl:choose>
         <xsl:when test="boolean(@format) and string-length(@format) > 0">
            <input type="text" name="{@name}" title="{@title}" format="{@format}"></input>
         </xsl:when>
         <xsl:otherwise>
            <input type="text" name="{@name}" title="{@title}"></input>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!-- The Form Select Mapping -->
   <xsl:template match="SimpleFormSelect">
      <strong>
         <xsl:value-of select="./@title"></xsl:value-of>
      </strong>
      <select name="{@name}" title="{@title}">
         <xsl:apply-templates></xsl:apply-templates>
      </select>
   </xsl:template>

   <!-- The Form Option Mapping -->
   <xsl:template match="SimpleFormOption">
      <option value="{@value}">
         <xsl:value-of select="."></xsl:value-of>
      </option>
   </xsl:template>

   <!--  El menu mapping -->

   <xsl:template match="SimpleMenu">
      <xsl:choose>
         <xsl:when test="boolean(@name) and string-length(@name) > 0">
            <xsl:attribute name="title">
               <xsl:value-of select="@name"></xsl:value-of>
            </xsl:attribute>
         </xsl:when>
      </xsl:choose>
      <p>
         <xsl:apply-templates></xsl:apply-templates>
      </p>
   </xsl:template>

   <!-- The Menu Item Mapping -->
   <xsl:template match="SimpleMenuItem">
      <a href="">
         <xsl:value-of select="."></xsl:value-of>
         <br></br>
      </a>
   </xsl:template>

   <!--
| The Table mapping
| Note: WML requires to know how many columns the table has.
| Set the variable ncol to the number of columns.
+-->
   <xsl:template match="SimpleTable">
      <!-- Create the card -->
      <xsl:apply-templates></xsl:apply-templates>
   </xsl:template>

   <!--
| The Table Row or Header
+-->

   <!-- The Table Row or Header -->
   <xsl:template match="SimpleTableHeader">
      <p>
         <xsl:for-each select="./SimpleCol">
            <xsl:text>   </xsl:text>
            <xsl:value-of select="."> </xsl:value-of>
            <xsl:text>   </xsl:text>
         </xsl:for-each>
      </p>
   </xsl:template>

   <xsl:template match="SimpleRow">
      <xsl:variable name="MaxLongitud">0</xsl:variable>
      <xsl:for-each select="./SimpleCol">
         <xsl:variable name="Longitud">
            <xsl:value-of select="number(string-length(.))"></xsl:value-of>
         </xsl:variable>
         <xsl:if test="$Longitud > $MaxLongitud">
            <xsl:variable name="MaxLongitud">
               <xsl:value-of select="$Longitud"></xsl:value-of>
            </xsl:variable>
         </xsl:if>
      </xsl:for-each>
      <p>
         <xsl:for-each select="./SimpleCol">
            <xsl:variable name="Longitud">
               <xsl:value-of select="number(string-length(.))">
               </xsl:value-of>
            </xsl:variable>
            <xsl:text> </xsl:text>
            <xsl:value-of select="."> </xsl:value-of>
            <xsl:if test="not(position()=last())">
               <xsl:variable name="Blancos">
                  <xsl:value-of select="$MaxLongitud - $Longitud"></xsl:value-of>
               </xsl:variable>
               <xsl:for-each test="$Blancos != 0">
                  <xsl:text>   </xsl:text>
                  <xsl:variable name="Blancos">
                     <xsl:value-of select="$MaxLongitud - $Longitud - 1"></xsl:value-of>
                  </xsl:variable>
               </xsl:for-each>
            </xsl:if>
         </xsl:for-each>
      </p>
   </xsl:template>

</xsl:stylesheet>
 

begin:vcard 
n:Garcia Ulla;Yolanda
x-mozilla-html:FALSE
url:www.oracle.es
org:Oracle Iberica<IMG src="http://iberica.es.oracle.com/img_apesp/orc05.gif">;Consulting
adr:;;C/ Navaluenga 1-3;Las Rozas;Madrid;28230;Spain
version:2.1
email;internet:ygarcia@xxxxxxxxxxxxx
title:Senior Consultant
fn:Yolanda G. Ulla
end:vcard
Current Thread

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
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.