Hi Avnish,
I was taking a look at your problem, and I'm not really sure whether
this is a bug - the definitions of the indent-amount and indent output
properties aren't entirely clear to me, and there doesn't seem to be much
in the way of documentation of their intended behaviour (particularly for
indent-amount).
The DOM tree that results from your sample document contains text
nodes interspersed amongst the element nodes that contain whitespace from
your document. The code in the serializer that tries to indent seems to
avoid indenting when text nodes have been output. Your program ends up
inserting an element node after the last text node child of the Product
element - so when it's output, the </Product> tag has no text node
preceding it in the output, and it's the only line affected by the
indent-amount you specified.
Perhaps someone who's been working on Xalan longer could comment on
whether that's the way indent-amount/indent are intended to work.
If that is how they're intended to work, you'll probably have to do
something to get the whitespace removed from the document (perhaps using
xsl:strip-space?)
Thanks,
Henry
------------------------------------------------------------------
Henry Zongaro Xalan development
IBM SWS Toronto Lab Tie Line 969-6044; Phone (905) 413-6044
mailto:[EMAIL PROTECTED]
"Avnish Pundir" <[EMAIL PROTECTED]>
02/06/19 11:17 AM
Please respond to "Avnish Pundir"
To: "Pavani Mukthipudi" <[EMAIL PROTECTED]>
cc: <[EMAIL PROTECTED]>
Subject: Re: indentation with modified docs
Done.. Bug # 10009. See at
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10009
Thanks
Avnish
----- Original Message -----
From: "Pavani Mukthipudi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 19, 2002 8:14 PM
Subject: Re: indentation with modified docs
Avnish Pundir wrote :
>
> I am having problem while printing edited XML documents. I have a XML
> document which is already indented properly with spaces. Now I am
parsing
> the document and adding a few new child nodes to it. But when I print
the
> document, indentation doesn't work out properly.
> ...
> I am getting this output
> <Inventory_Attributes>
> <Products>
> <Product name="my_product">
> <Version>A</Version>
> <Version>B</Version>
> <Version>C</Version>
> <Version>Newly_added_product</Version>
> </Product>
> </Products>
> </Inventory_Attributes>
>
Seems to be a bug in Xalan because indentation is not really applied in
this
case. Please report it in the bugzilla. I'll provide a patch for it.
-Pavani
--
Pavani Mukthipudi
Sun Microsystems, Inc.
Phone: 91-80-2298989/87390