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

Re: XSLT text output - better formatting possible?

Subject: Re: XSLT text output - better formatting possible?
From: Juergen Baier <x_baier@xxxxxxxxxxxxxxxx>
Date: Thu, 26 Oct 2000 10:14:36 +0200
xslt text new line
Hi Lyn,

"Lyn K. Finman" wrote:
> 
> I'm working on a project that is attempting to incorporate XML into a
> large C++ application.  

I use XSLT to make Java code from XML. Not sure if this is what you
want, but you could declare some entities to produce intended output:

<!DOCTYPE xsl:stylesheet [
<!ENTITY tab "<xsl:text>    </xsl:text>"> <!-- Tab -->
<!ENTITY tab2 "<xsl:text>        </xsl:text>"> <!-- Two Tabs -->
<!ENTITY tab3 "<xsl:text>            </xsl:text>"> <!-- Three Tabs -->
<!ENTITY tab4 "<xsl:text>                </xsl:text>"> <!-- Four Tabs
-->
<!ENTITY n "<xsl:text>
</xsl:text>"> <!-- New Line -->
<!ENTITY n2 "<xsl:text>

</xsl:text>"> <!-- Two new Lines -->
<!ENTITY n3 "<xsl:text>


</xsl:text>"> <!-- Three new Lines -->
<!ENTITY space "<xsl:text> </xsl:text>"> <!-- Space -->
<!ENTITY e "<xsl:text/>"> 
]>

So you can write something like

    &n;&tab;public static void main (String args[])&n;
    &tab;{&n;
    &tab2;// test&n;
    &tab;}&n2;

in your stylesheet. Of course piping the output throug a formatter would
also do the job, but I prefer to get a formatted output directly.

Have fun,

Juergen

-- 


Jürgen Baier

Propack Data GmbH
Vincenz-Prießnitz-Str. 1
D-76131 Karlsruhe / Germany

Fon. +49 (721) 9650 6
Fax. +49 (721) 9650 888

info: http://www.propack-data.de


 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.