Restricting the indentation in xslt transformation!

Here should go questions about transforming XML with XSLT and FOP.
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Restricting the indentation in xslt transformation!

Post by mu258770 »

Hi team,

I am working on transforming xml elements using xslt. I am using " xalan:indent-amount="2" " in the xsl output declaration to indent my output xml. This indents all my output elements when converted. But, I would like to restrict this. Like, I do not want the indentation to work for one specifice template or element, but for remaining it should work.

How it is possible? I have searched for the solution, but could not get any match for my requirement.

Please help.

Regards,
Shabeer
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: Restricting the indentation in xslt transformation!

Post by mu258770 »

Hi team,

I have one more query related to xslt.

For stripping the unwanted spaces, we use <xsl:strip-space elements="*" /> . But this strips the spaces in every element. I would like to preserve space for one particular element. I tried using <xsl:preserve-space elements="..."/> option and it didn't work.

I have so many elements in the input document, and I just want to preserve space for one particular element.

If there is a way to do, please let me know. Would be a big help!

Regards,
Shabeer
Post Reply