Ed Knoll:

I can't say that I've done this myself, but this is how I think it ought to
work.

This is not a standard JAXP property like others that map to the attributes
of  <xsl:output ....>.  In a stylesheet you would do something like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:xalan="http://xml.apache.org/xslt";>

  <xsl:output method="xml"
              encoding="UTF-8"
              indent="yes"
              xalan:indent-amount="2"/>

But how do you set the Xalan specific property with the given URI through
JAXP?

You will get a JAXP reference to a javax.xml.transform.Transformer at some
point in your code.  Lets call the reference x.  You should need code like
this:

String key = "{http://xml.apache.org/xalan}indent-amount";;
String value = "2";
x.setOutputProperty(key,value);

Note the { and } around the URI in the key.  The key should be what appears
in Xalan's xml_output.properties file (or other similar files).

There may be a bug in there yet, but give this a try.


----------
Brian Minchau
XSLT Development, IBM Toronto
e-mail:        [EMAIL PROTECTED]



                                                                           
             "Edward L. Knoll"                                             
             <[EMAIL PROTECTED]                                             
             dex.com>                                                   To 
                                       [EMAIL PROTECTED]            
             08/25/2004 05:09                                           cc 
             PM                                                            
                                                                   Subject 
                                       Question regarding use of           
             Please respond to         indent-amount with Serializers.     
                 xalan-dev                                                 
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




I was successfully using the indent-amount attribute in a stylesheet
when I was using org.apache.xalan.xslt.Process to process the
stylesheet.  I'm now processing the stylesheet (from Java) using a
Transformer class with output to a DOMResult class and then using a
(xml) Serializer class to write the DOMResult to a file.  I have not
been able to figure out how to control the indent-amount in this context.

Does the indent-amount work in this context, and if so, how do set it up?

Thanks,
Ed Knoll

--
Edward L. Knoll   Phone (FedEx)     : (719)484-2717
                  e-mail (FedEx)    : [EMAIL PROTECTED]
                  e-mail (personal) : [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to