crossley 02/02/16 21:45:25 Modified: src/documentation/xdocs faq.xml Log: Add entry about whitespace-handling in XSLT and direct them again to XSL resources intead of cluttering the cocoon-* lists. Revision Changes Path 1.5 +49 -0 xml-cocoon2/src/documentation/xdocs/faq.xml Index: faq.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/faq.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- faq.xml 14 Feb 2002 14:48:39 -0000 1.4 +++ faq.xml 17 Feb 2002 05:45:25 -0000 1.5 @@ -671,4 +671,53 @@ <note>See inline comments in these files for further information!</note> </answer> </faq> +<faq> + <question> + How do i tell Cocoon to stop adding carriage-returns during xsl + transformation ? + </question> + <answer> + <p>The short answer is that this is not a Cocoon issue - you need to + read up on XSLT usage. Please see + <link href="mail-lists.html">other resources for XSLT</link> + (specifically the XSL FAQ and discussion lists). + </p> + <p>The full answer is that you need to use the XSLT function + <code>normalize-space()</code> whenever you want to rely on the content + of an xml element. + </p> + <p>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 ... + </p> +<source> + <![CDATA[ +alert('<xsl:value-of select="message"/>'); +]]> +</source> + <p>which will produce ...</p> +<source> + <![CDATA[ +alert(' +messageValue +'); +]]> +</source> + + <p>That will cause js errors. The reason is that there are line-endings + in the content of your "<code>message</code>" element. So you + need to do this ... + </p> +<source> + <![CDATA[ +alert('<xsl:value-of select="normalize-space(message)"/>'); +]]> +</source> + + <p>Note that there are many more issues about whitepace handling. Please + refer to the relevant XSLT resources, rather than cluttering the Cocoon + discussion lists. + </p> + </answer> +</faq> </faqs>
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]