Actually, this is a perfect question for the new xalan-j-users list,
instead of this xalan-dev list...

Thanks Bjoern for providing the answer.  Sorry about the frequent
confusion on indenting output!  Briefly: adding extra spaces to the
output slows down the serialization, so as an optimization, we set the
default indent-amount to 0, and put in the nifty xalan:indent-amount
attribute on the xsl:output.  Having this separately settable does make
sense, since (esp. for readable XML) you can specify indenting, which
will put in newlines, but leave the indent-amount off, which will be a
little faster than actually indenting more spaces.

- Shane
-----------
> Hi,
> I am trying to convert an XML document to a text document. While
> converting, I would like to preserve the indentation from the xml
> source file. I am using Xalan(1.2.2). The code snippet to convert
> the XML to TEXT is as follows.

...
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:xalan="http://xml.apache.org/xslt";
                version="1.0">
<xsl:output method="text" 
            indent="yes"
            xalan:indent-amount="2"/>



=====
<eof aka="mailto:[EMAIL PROTECTED]";
 quote="Odo:   [You'd shoot a man in the back?]
        Garak: [Well, it's the safest way, isn't it?]"/>

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Reply via email to