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

XSLT string formatting functions

Subject: XSLT string formatting functions
From: "Albert Tsun" <albert.tsun@xxxxxxxxxxxx>
Date: Wed, 18 Oct 2000 10:16:08 +0800
xslt string

Hi all,

I am now trying to develop a Report Engine using XML file as datasource and
 XSL file as report template to output a formatted report in text-file
format.

I use Xalan to do the transform to a get rid of the tags in XML files. But
I got problems when I try to place XML data in desired positions
using XSL construct.

(1) How to have indentation, linefeed and space precisely placed in
transformed output?  In my XSL, I use <xsl:text> to represent spaces and
linefeed.
how can I make a string value (e.g. <xsl:value-of select="x1"/> to have a
specific length? Because the text node may contain variable length, in
order to
place them nicely in report, I want to pad space before, after the text
value.

(2) Besides, is there any  decimal format functions to nicely format text
(which should be numeric figures) in specified format-string ?

for example, in my XML source
<Price>   1000</Price>

How can I transform the 1000 (text) into a nicely formatted decimal string
using XSL element?

For example, if I want in my textual report:
     Price = [1,000.00]
          ( if I want to have formatted string of length 8 and have
grouping separator "," and decimal-separator=".")
  or Price = [  1,000.00] (with 2 spaces padded before 1,000.00)
             ( if I want to have formatted string of length 10 and have
grouping separator "," and decimal-separator=".")

Do I need to use <xsl:deimal-format> , format-number(.....) and if they are
used, how can I apply in XSL and define them?

Many Thanks in advance




 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.