You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bas Passon <BP...@parite.nl> on 2000/10/23 10:44:27 UTC
formating problems
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
Re: Re: formating problems
Posted by Konstantin Piroumian <KP...@flagship.ru>.
Sorry.
I only replied in the format that the original letter was sent.
I said, that everything seems to be correct with XSL.
And maybe the context where it used is not correct (column element can be
not accessible in the place where the <xsl:for-each...> is used).
Regards,
Kot.
----- Original Message -----
From: "Aurélien DEHAY" <au...@sncf.fr>
To: <co...@xml.apache.org>
Sent: 23 ??????? 2000 ?., ??????????? 13:06
Subject: Re: Re: formating problems
"Konstantin Piroumian" <KP...@flagship.ru> writes:
I think you should do something for this. Maybe post in text.
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD><TITLE>formating problems</TITLE>
>
> <META content="MSHTML 5.50.4134.600" name=GENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=#d8d0c8>
> <DIV><FONT size=2>It seems that everything is correct with your XSL and it
must
> work.</FONT></DIV>
> <DIV><FONT size=2>Check the context where you use <xsl:for-each
> ...></FONT></DIV>
> <DIV><FONT size=2>Maybe the column is not accesible from
there.</FONT></DIV>
> <DIV><FONT size=2></FONT> </DIV>
> <DIV><FONT size=2>Just a suggestion.</FONT></DIV>
> <DIV><FONT size=2></FONT> </DIV>
> <DIV><FONT size=2>Regards, </FONT></DIV>
> <DIV><FONT size=2> Kot.</FONT></DIV>
> <BLOCKQUOTE dir=ltr
> style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px;
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
> <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
> <DIV
> style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color:
black"><B>From:</B>
> <A title=BPasson@parite.nl href="mailto:BPasson@parite.nl">Bas
Passon</A>
> </DIV>
> <DIV style="FONT: 10pt arial"><B>To:</B> <A
title=cocoon-users@xml.apache.org
> href="mailto:cocoon-users@xml.apache.org">Cocoon Mailinglist
(E-mail)</A>
> </DIV>
> <DIV style="FONT: 10pt arial"><B>Sent:</B> 23
октября 2000 г.,
понедельник
;
> 12:44</DIV>
> <DIV style="FONT: 10pt arial"><B>Subject:</B> formating problems</DIV>
> <DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
> size=2></FONT><BR></DIV>
> <P><FONT size=2>I'm having problems when generating source code with the
help
> of cocoon.</FONT> </P>
> <P><FONT size=2>Consider the following sample:</FONT> </P>
> <P>
> <FONT size=2><column
> name="id"></FONT> <BR>
>
> <FONT size=2><type
> value="INTEGER"/></FONT>
<BR>
>
> <FONT size=2><null
> value="false"/></FONT> <BR>
>
> <FONT size=2><autoincr
> value="true"/></FONT> <BR>
>
> <FONT size=2><size
> value="10"/></FONT> <BR>
>
> <FONT size=2><reference
> table="table" column="c1"/></FONT>
> <BR>
>
> <FONT size=2><default
> value="0"/></FONT> <BR>
>
> <FONT size=2><check
> mode="greater" value="10"/></FONT>
> <BR>
> <FONT
size=2></column></FONT>
> </P>
> <P><FONT size=2>A piece from the xsl-stylesheet</FONT> </P>
> <P> <FONT size=2>.....</FONT>
> <BR>
> <FONT size=2><xsl:for-each
> select="column"></FONT>
<BR>
> <FONT size=2>public
> <xsl:apply-templates select="type"/> get<xsl:value-of
> select="@name"/></FONT>
<BR>
> <FONT size=2>{</FONT>
> <BR>
>
> <FONT size=2>return
null;</FONT>
> <BR>
> <FONT size=2>}</FONT>
> <BR>
> <FONT
> size=2></xsl:for-each></FONT>
> <BR> <FONT size=2>.....</FONT>
</P>
> <P><FONT size=2>together with this style template for the type:</FONT>
</P>
> <P> <FONT
size=2><xsl:template
> match="type"></FONT> <BR><FONT size=2>
> <xsl:variable name="type" select="@value"/></FONT>
> <BR>
> <FONT
> size=2><xsl:choose></FONT>
> <BR>
>
> <FONT size=2><xsl:when
> test='$type="INTEGER"'></FONT>
> <BR>
>
>
> <FONT size=2>Integer</FONT>
> <BR>
>
> <FONT
> size=2></xsl:when></FONT>
<BR>
>
> <FONT
> size=2><xsl:otherwise></FONT>
> <BR>
>
>
> <FONT size=2>String</FONT>
> <BR>
>
> <FONT
> size=2></xsl:otherwise></FONT>
> <BR>
> <FONT
> size=2></xsl:choose></FONT>
> <BR> <FONT
> size=2></xsl:template> </FONT></P>
> <P><FONT size=2>It generates this:</FONT> </P>
> <P><FONT
>
size=2> &nb
sp;
> public</FONT> <BR><FONT
>
size=2> &nb
sp;
> Integer</FONT> <BR><FONT
>
size=2> &nb
sp;
> getid</FONT> <BR><FONT
>
size=2> &nb
sp;
> {</FONT> <BR><FONT
>
size=2> &nb
sp;
> return null;</FONT> <BR><FONT
>
size=2> &nb
sp;
> }</FONT> </P>
> <P><FONT size=2>What i would like it to do is generate this:</FONT> </P>
> <P>
> <FONT size=2>public Integer
> getid</FONT> <BR>
> <FONT size=2>{</FONT>
> <BR>
>
> <FONT size=2>return
null;</FONT>
> <BR>
> <FONT size=2>}</FONT> </P>
> <P><FONT size=2>Is there some way to make cocoon do this the way i would
like
> it?</FONT> </P>
> <P><FONT size=2>thnx</FONT> </P>
> <P><FONT size=2>Bas</FONT> </P></BLOCKQUOTE></BODY></HTML>
--
Aurélien
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Re: formating problems
Posted by Aurélien DEHAY <au...@sncf.fr>.
"Konstantin Piroumian" <KP...@flagship.ru> writes:
I think you should do something for this. Maybe post in text.
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD><TITLE>formating problems</TITLE>
>
> <META content="MSHTML 5.50.4134.600" name=GENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=#d8d0c8>
> <DIV><FONT size=2>It seems that everything is correct with your XSL and it must
> work.</FONT></DIV>
> <DIV><FONT size=2>Check the context where you use <xsl:for-each
> ...></FONT></DIV>
> <DIV><FONT size=2>Maybe the column is not accesible from there.</FONT></DIV>
> <DIV><FONT size=2></FONT> </DIV>
> <DIV><FONT size=2>Just a suggestion.</FONT></DIV>
> <DIV><FONT size=2></FONT> </DIV>
> <DIV><FONT size=2>Regards, </FONT></DIV>
> <DIV><FONT size=2> Kot.</FONT></DIV>
> <BLOCKQUOTE dir=ltr
> style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
> <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
> <DIV
> style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
> <A title=BPasson@parite.nl href="mailto:BPasson@parite.nl">Bas Passon</A>
> </DIV>
> <DIV style="FONT: 10pt arial"><B>To:</B> <A title=cocoon-users@xml.apache.org
> href="mailto:cocoon-users@xml.apache.org">Cocoon Mailinglist (E-mail)</A>
> </DIV>
> <DIV style="FONT: 10pt arial"><B>Sent:</B> 23 октября 2000 г., понедельник
> 12:44</DIV>
> <DIV style="FONT: 10pt arial"><B>Subject:</B> formating problems</DIV>
> <DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
> size=2></FONT><BR></DIV>
> <P><FONT size=2>I'm having problems when generating source code with the help
> of cocoon.</FONT> </P>
> <P><FONT size=2>Consider the following sample:</FONT> </P>
> <P>
> <FONT size=2><column
> name="id"></FONT> <BR>
>
> <FONT size=2><type
> value="INTEGER"/></FONT> <BR>
>
> <FONT size=2><null
> value="false"/></FONT> <BR>
>
> <FONT size=2><autoincr
> value="true"/></FONT> <BR>
>
> <FONT size=2><size
> value="10"/></FONT> <BR>
>
> <FONT size=2><reference
> table="table" column="c1"/></FONT>
> <BR>
>
> <FONT size=2><default
> value="0"/></FONT> <BR>
>
> <FONT size=2><check
> mode="greater" value="10"/></FONT>
> <BR>
> <FONT size=2></column></FONT>
> </P>
> <P><FONT size=2>A piece from the xsl-stylesheet</FONT> </P>
> <P> <FONT size=2>.....</FONT>
> <BR>
> <FONT size=2><xsl:for-each
> select="column"></FONT> <BR>
> <FONT size=2>public
> <xsl:apply-templates select="type"/> get<xsl:value-of
> select="@name"/></FONT> <BR>
> <FONT size=2>{</FONT>
> <BR>
>
> <FONT size=2>return null;</FONT>
> <BR>
> <FONT size=2>}</FONT>
> <BR>
> <FONT
> size=2></xsl:for-each></FONT>
> <BR> <FONT size=2>.....</FONT> </P>
> <P><FONT size=2>together with this style template for the type:</FONT> </P>
> <P> <FONT size=2><xsl:template
> match="type"></FONT> <BR><FONT size=2>
> <xsl:variable name="type" select="@value"/></FONT>
> <BR>
> <FONT
> size=2><xsl:choose></FONT>
> <BR>
>
> <FONT size=2><xsl:when
> test='$type="INTEGER"'></FONT>
> <BR>
>
>
> <FONT size=2>Integer</FONT>
> <BR>
>
> <FONT
> size=2></xsl:when></FONT> <BR>
>
> <FONT
> size=2><xsl:otherwise></FONT>
> <BR>
>
>
> <FONT size=2>String</FONT>
> <BR>
>
> <FONT
> size=2></xsl:otherwise></FONT>
> <BR>
> <FONT
> size=2></xsl:choose></FONT>
> <BR> <FONT
> size=2></xsl:template> </FONT></P>
> <P><FONT size=2>It generates this:</FONT> </P>
> <P><FONT
> size=2>
> public</FONT> <BR><FONT
> size=2>
> Integer</FONT> <BR><FONT
> size=2>
> getid</FONT> <BR><FONT
> size=2>
> {</FONT> <BR><FONT
> size=2>
> return null;</FONT> <BR><FONT
> size=2>
> }</FONT> </P>
> <P><FONT size=2>What i would like it to do is generate this:</FONT> </P>
> <P>
> <FONT size=2>public Integer
> getid</FONT> <BR>
> <FONT size=2>{</FONT>
> <BR>
>
> <FONT size=2>return null;</FONT>
> <BR>
> <FONT size=2>}</FONT> </P>
> <P><FONT size=2>Is there some way to make cocoon do this the way i would like
> it?</FONT> </P>
> <P><FONT size=2>thnx</FONT> </P>
> <P><FONT size=2>Bas</FONT> </P></BLOCKQUOTE></BODY></HTML>
--
Aurélien
Re: formating problems
Posted by Konstantin Piroumian <KP...@flagship.ru>.
formating problemsIt seems that everything is correct with your XSL and it must work.
Check the context where you use <xsl:for-each ...>
Maybe the column is not accesible from there.
Just a suggestion.
Regards,
Kot.
----- Original Message -----
From: Bas Passon
To: Cocoon Mailinglist (E-mail)
Sent: 23 ??????? 2000 ?., ??????????? 12:44
Subject: formating problems
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