> 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.
> [...]
> myxsl.xsl:
> ---------------
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>                 version="1.0">
> <xsl:output method="text" indent="yes"/>

Change this to:

<?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"/>

This is because 'indent-amount' defaults to '0'. If you change it to 
something larger, you get the proper indentation. You should be able 
to change that default value within the file
[xalan.jar]/org/apache/xalan/templates/output_xml.properties for xml 
and appropiate similar files in the same location for text and html 
output.

Regards.

-- 
Bjoern Martin                                [EMAIL PROTECTED]


Reply via email to