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

Re: Selecting a certain amount of characters with XSL

Subject: Re: Selecting a certain amount of characters with XSL
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 9 Mar 2000 13:53:04 GMT
xsl left characters
> > do you want an XML tree which when linearised to a file results in
> > at most 1000 characters including markup appearing in that file.

> Yes

In that case you don't want to treat <p> as an element but as character
data. Use the text output method not the xml one,
and change your template

so instead of

<xsl:template match="Text">
    <p align="left">

you have

<xsl:template match="Text">
    &lt;p align="left"&gt;

and then proceed as before.

(This will cut off your file at 1000 characters even if it is in the
middle of an element name,  That maybe not what you want, but it is what
you asked for:-) 

Somehow I feel doing better which would mean proceeding just one node
at a time and maintaining a running total of characters as a parameter
is possible in xsl but likely to be unpleasant, unless someone else has
a good trick to share...

David


 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.