cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bas Passon <BPas...@parite.nl>
Subject formating problems
Date Mon, 23 Oct 2000 08:44:27 GMT
I'm having problems when generating source code with the help of cocoon.

Consider the following sample:

		<column name="id">
			<type value="INTEGER"/>
			<null value="false"/>
			<autoincr value="true"/>
			<size value="10"/>
			<reference table="table" column="c1"/>
			<default value="0"/>
			<check mode="greater" value="10"/>
		</column>

A piece from the xsl-stylesheet

	.....
		<xsl:for-each select="column">
		public <xsl:apply-templates select="type"/> get<xsl:value-of
select="@name"/>
		{
			return null;
		}
		</xsl:for-each>
	.....

together with this style template for the type:

	<xsl:template match="type">
      	<xsl:variable name="type" select="@value"/>
		<xsl:choose>
			<xsl:when test='$type="INTEGER"'>
				Integer
			</xsl:when>
			<xsl:otherwise>
				String
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>	

It generates this:

                public
                        Integer
                 getid
                {
                        return null;
                }

What i would like it to do is generate this:

		public Integer getid
		{
			return null;
		}

Is there some way to make cocoon do this the way i would like it?

thnx

Bas


Mime
View raw message