sdx-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sdx-developers] Taglib (sauts de ligne intempestifs)


From: Frédéric Glorieux
Subject: Re: [sdx-developers] Taglib (sauts de ligne intempestifs)
Date: Fri, 31 May 2002 12:43:41 +0200

String sdx_fquery_Field = sdxRequest.getParameter("
                 <xsl:value-of select="@fieldParam"/>");
                 String sdx_fquery_Value = sdxRequest.getParameter("
                 <xsl:value-of select="@valueParam"/>");

Tous les tags ne sont pas encore implantés (ils progressent avec l'appli
démo sdxworld). Toutefois, ce code de l'ancienne taglib était laisser pour
mémoire, je ferais mieux de le commenter.

_________________

N'y a-t-il pas moyen de stripper les espaces/sauts de ligne à
l'interprétation de la taglib ?

Gestion des espaces en xsl. Pour une sortie xml ou html, on s'en fout un
peu, mais c'est vrai que pour du java... Les utilisateurs cocoon semblent
l'avoir remarqué.


http://xml.apache.org/cocoon/faq.html#faq-27

How do i tell Cocoon to stop adding carriage-returns during xsl
transformation ?
The short answer is that this is not a Cocoon issue - you need to read up on
XSLT usage. Please see other resources for XSLT (specifically the XSL FAQ
and discussion lists).

The full answer is that you need to use the XSLT function normalize-space()
whenever you want to rely on the content of an xml element.

For example, if your application is producing some Javascript code in your
HTML output, then you might mistakenly try to use the following construct in
your XSL stylesheet ...


     alert('<xsl:value-of select="message"/>');




which will produce ...


     alert('
messageValue
');




That will cause js errors. The reason is that there are line-endings in the
content of your "message" element. So you need to do this ...


     alert('<xsl:value-of select="normalize-space(message)"/>');




Note that there are many more issues about whitepace handling. Please refer
to the relevant XSLT resources, rather than cluttering the Cocoon discussion
lists.

GIF image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]