[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
> > 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"> <p align="left"> 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
|
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
|