You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Martin Schimak <co...@schimak.at> on 2002/09/11 10:46:48 UTC

[Fwd: Re: XSP Indentation and Whitespace]

Hi Antonio,
thanks for your answer,
but unfortunately the replacement of <xsl:element name="option"> with "option" changed nothing. When
you avoid the whitespace within the original xml (like you did with the <xsp:attribute/> part) then
you do not get the whitespace in the output, but this leads me to illegible xml after a while.

Thx,
Martin.

Antonio Gallardo Rivera wrote:
 > Try this:
 >
 > <esql:execute-query>
 >       <esql:query>
 > 	SELECT template_id, name
 > 	FROM template
 > 	ORDER BY name
 >       </esql:query>
 > 	<esql:results>
 >          <esql:row-results>
 > 	 <option>
 >                <xsp:attribute name="value"><esql:get-string
 > column="template_id"/></xsp:attribute>
 >                <esql:get-string column="name"/>
 >             </option>
 >          </esql:row-results>
 >       </esql:results>
 >  </esql:execute-query>
 >
 > Antonio Gallardo
 >
 >
 > El Miércoles, 11 de Septiembre de 2002 02:08, Martin Schimak escribió:
 >
 >>Hi folks!
 >>
 >>I am relatively new to cocoon, but so far I am VERY IMPRESSED and I have a
 >>strong feeling that I will spend a considerable amount of forthcoming
 >>lifetime using/exploring/developing :-)
 >>
 >>However, on my exploring way, I encountered a small, but annoying issue, I
 >>could not solve myself so far... it's concerning whitespace:
 >>
 >><esql:execute-query>
 >>     <esql:query>SELECT template_id, name FROM template ORDER BY
 >>name</esql:query> <esql:results>
 >>        <esql:row-results>
 >>           <xsp:element name="option">
 >>              <xsp:attribute name="value">
 >>                 <esql:get-string column="template_id"/>
 >>              </xsp:attribute>
 >>              <esql:get-string column="name"/>
 >>           </xsp:element>
 >>        </esql:row-results>
 >>     </esql:results>
 >></esql:execute-query>
 >>
 >>After processing this fragment, I would like to end up with something like
 >>
 >><option value="1">Template1</option>
 >><option value="2">Template2</option>
 >>
 >>but instead I end up with something like
 >>
 >><option value="
 >>1			">		Template1		</option>
 >><option value="
 >>2			">		Template2		</option>
 >>
 >>
 >>Of course, if I avoid indentation within the original xsp fragment like
 >>
 >><xsp:element name="option"><xsp:attribute name="value"><esql:get-string
 >>column="template_id"/></xsp:attribute><esql:get-string
 >>column="name"/></xsp:element>
 >>
 >>then I get what I want. But I get illegible xml quite soon...
 >>
 >>Of course, the preservation of the original indentation in some cases could
 >>be what the user actually wanted, therefore my question: Is there a way to
 >>tell cocoon/xsp-processing to change behaviour in this respect?
 >>
 >>Not a big problem,
 >>but I found no bigger problem so far :-)
 >>
 >>Martin.
 >>
 >>
 >>
 >>---------------------------------------------------------------------
 >>Please check that your question  has not already been answered in the
 >>FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
 >>
 >>To unsubscribe, e-mail:     <co...@xml.apache.org>
 >>For additional commands, e-mail:   <co...@xml.apache.org>
 >
 >
 > ---------------------------------------------------------------------
 > Please check that your question  has not already been answered in the
 > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
 >
 > To unsubscribe, e-mail:     <co...@xml.apache.org>
 > For additional commands, e-mail:   <co...@xml.apache.org>
 >
 >
 >




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: [Fwd: Re: XSP Indentation and Whitespace]

Posted by Antonio Gallardo Rivera <ag...@agsoftware.dnsalias.com>.
Sorry I just changed intentionally. Just to show that you can write it 
shorter: ;)

<xsp:element name="option"> by <option>

I know very well what you are feeling with:

"but this leads me to illegible xml after a while"

This is just a beginner affair. When I started to write Cocoon applications, I 
tried to write "clean" XML like you suggest:

<xsp:element name="option">
	<xsp:attribute name="value">
		<esql:get-string column="template_id"/>
	</xsp:attribute>
	<esql:get-string column="name"/>
</xsp:element>

But I got the same problems like you! Then I started to write better this:

<xsp:element name="option">
	<xsp:attribute name="value"><esql:get-string 
column="template_id"/></xsp:attribute>
	<esql:get-string column="name"/>
</xsp:element>

By the way, In cocoon bugzilla there is a requested feature about not needed 
space chars. But I dont know when will be resolved or if it will be done at 
all.

At the end I want to said: "I am a Cocoon Beginner too! Trying to write his 
first app." ;)

Regards,

Antonio Gallardo.

El Miércoles, 11 de Septiembre de 2002 02:46, Martin Schimak escribió:
> Hi Antonio,
> thanks for your answer,
> but unfortunately the replacement of <xsl:element name="option"> with
> "option" changed nothing. When you avoid the whitespace within the original
> xml (like you did with the <xsp:attribute/> part) then you do not get the
> whitespace in the output, but this leads me to illegible xml after a while.
>
> Thx,
> Martin.
>
> Antonio Gallardo Rivera wrote:
>  > Try this:
>  >
>  > <esql:execute-query>
>  >       <esql:query>
>  > 	SELECT template_id, name
>  > 	FROM template
>  > 	ORDER BY name
>  >       </esql:query>
>  > 	<esql:results>
>  >          <esql:row-results>
>  > 	 <option>
>  >                <xsp:attribute name="value"><esql:get-string
>  > column="template_id"/></xsp:attribute>
>  >                <esql:get-string column="name"/>
>  >             </option>
>  >          </esql:row-results>
>  >       </esql:results>
>  >  </esql:execute-query>
>  >
>  > Antonio Gallardo
>  >
>  > El Miércoles, 11 de Septiembre de 2002 02:08, Martin Schimak escribió:
>  >>Hi folks!
>  >>
>  >>I am relatively new to cocoon, but so far I am VERY IMPRESSED and I have
>  >> a strong feeling that I will spend a considerable amount of forthcoming
>  >> lifetime using/exploring/developing :-)
>  >>
>  >>However, on my exploring way, I encountered a small, but annoying issue,
>  >> I could not solve myself so far... it's concerning whitespace:
>  >>
>  >><esql:execute-query>
>  >>     <esql:query>SELECT template_id, name FROM template ORDER BY
>  >>name</esql:query> <esql:results>
>  >>        <esql:row-results>
>  >>           <xsp:element name="option">
>  >>              <xsp:attribute name="value">
>  >>                 <esql:get-string column="template_id"/>
>  >>              </xsp:attribute>
>  >>              <esql:get-string column="name"/>
>  >>           </xsp:element>
>  >>        </esql:row-results>
>  >>     </esql:results>
>  >></esql:execute-query>
>  >>
>  >>After processing this fragment, I would like to end up with something
>  >> like
>  >>
>  >><option value="1">Template1</option>
>  >><option value="2">Template2</option>
>  >>
>  >>but instead I end up with something like
>  >>
>  >><option value="
>  >>1			">		Template1		</option>
>  >><option value="
>  >>2			">		Template2		</option>
>  >>
>  >>
>  >>Of course, if I avoid indentation within the original xsp fragment like
>  >>
>  >><xsp:element name="option"><xsp:attribute name="value"><esql:get-string
>  >>column="template_id"/></xsp:attribute><esql:get-string
>  >>column="name"/></xsp:element>
>  >>
>  >>then I get what I want. But I get illegible xml quite soon...
>  >>
>  >>Of course, the preservation of the original indentation in some cases
>  >> could be what the user actually wanted, therefore my question: Is there
>  >> a way to tell cocoon/xsp-processing to change behaviour in this
>  >> respect?
>  >>
>  >>Not a big problem,
>  >>but I found no bigger problem so far :-)
>  >>
>  >>Martin.
>  >>
>  >>
>  >>
>  >>---------------------------------------------------------------------
>  >>Please check that your question  has not already been answered in the
>  >>FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>  >>
>  >>To unsubscribe, e-mail:     <co...@xml.apache.org>
>  >>For additional commands, e-mail:   <co...@xml.apache.org>
>  >
>  > ---------------------------------------------------------------------
>  > Please check that your question  has not already been answered in the
>  > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>  >
>  > To unsubscribe, e-mail:     <co...@xml.apache.org>
>  > For additional commands, e-mail:   <co...@xml.apache.org>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>