|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT text output - better formatting possible?
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
|
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
|






