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

Selecting a certain amount of characters with XSL

Subject: Selecting a certain amount of characters with XSL
From: Regine Vergon <regine_vergon@xxxxxxxxx>
Date: Wed, 8 Mar 2000 05:46:33 -0800 (PST)
regine template
Hi,

I have ax xml like this 

...
<Text>
  <TextItem num="1">
    <TextItemText>bla bla number 1</TextItemText> 
  </TextItem>
  <TextItem num="2">
    <TextItemTitle>the title</TextItemTitle> 
    <TextItemText>?bla bla number 2</TextItemText> 
  </TextItem>
  <TextItem num="3">
    <TextItemTitle>the title number 3</TextItemTitle> 
    <TextItemText>bla bla number 3</TextItemText> 
  </TextItem>
</Text>
  
And i have 2 stylesheets. One to transform from XML to HTML and another to
transform from XML to WML.

The Text tag can be very long and on a WAP telephone there is a limit regarding
the amount of characters to be displayed. 
What i want to do is to select 1000 characters from the text tag

How do i do that ?
Here is my stylesheet
....

  <xsl:template match="Text">
    <p align="left">
      <xsl:apply-templates></xsl:apply-templates>
    </p>
  </xsl:template>
   
  <xsl:template match="TextItem">
    <xsl:apply-templates></xsl:apply-templates>
    <br/>
  </xsl:template>
  
  <xsl:template match="TextItemTitle">
    <b>
      <xsl:value-of select="."></xsl:value-of>
    </b>
    <br/>
  </xsl:template>
  
  <xsl:template match="TextItemText">
    <xsl:value-of select="."></xsl:value-of>
    <br/>
  </xsl:template>   

I don't want to have 
 <xsl:template match="TextItemText">
    <xsl:value-of select="substring(.,1,1000)"></xsl:value-of>
    <br/>
  </xsl:template>   

because this will select 1000 characters for the each tag TextItemText

Thanks

Regine
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.