xsl-list
[Top] [All Lists]

How to achieve java format on generated code using xslt

2003-09-25 06:58:03
Hi,

I am using xsl/xslt to generate java code. The problem I have is to make the 
output more readable.
Here is part of the code that I generate:

public void actionTcp (Coordinator c) throws Exception,
 HwException,
 SwException,
 FailoverException;

I would rather see something like:

public void actionStartTpcInsertion(Coordinator c) throws Exception,
                                                                                
  HwException,
                                                                                
  SwException,
                                                                                
  FailoverException;

( If it does not show up in the mail, I mean all Execptions below each other in 
a straight line.)

How can I make sure that they begin under Exception and in a straight line?

This is the  xsl that I am using:

<xsl:when test="returnType/void">
    public void action<xsl:call-template name="CapFirstLetterOfAttr">
     <xsl:with-param name="x" select="@name"/></xsl:call-template>(Coordinator 
c) throws MoAccessException<xsl:if test="raisesException">
     <xsl:text>,</xsl:text></xsl:if><xsl:text>
     </xsl:text><xsl:for-each select="raisesException"><xsl:value-of 
select="@name"/>
     <xsl:if test="not(position()=last())">,<xsl:text>
     </xsl:text> </xsl:if></xsl:for-each>;
        </xsl:when>


All hints are greatly appreciated!! Does anyone of you ( somewhere out 
there......) have any experience with code generation? I am willing to share my 
experience.

Regards,

//Mikael 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>