|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Selecting a certain amount of characters with XSL
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








