Subject: [xsl] 2 Questions on message and whitespace|
From: Raman Kannan <rk2153@xxxxxxxxx>
Date: Tue, 24 May 2005 22:57:16 -0400
Hi I am trying to get rid of
in an attribute T58=" tt " I have tried <xsl:strip-space elements="comments"/> and I am generating this attribute as <xsl:attribute name="T58"><xsl:value-of select="$dnode/comments" disable-output-escaping="yes"/></xsl:attribute> the $dnode is a variable set to the entity that contains a comments element. I am not sure why I still get these characters. No help from http://www.dpawson.co.uk/xsl/sect2/N3573.html#d4282e842 on this one. Other attempts (that do not work): <xsl:attribute name="T58"><xsl:value-of select="translate("$dnode/comments",'
','')" /></xsl:attribute> Working version: <xsl:variable name="comment"><xsl:value-of select="$dnode/comments"/></xsl:variable> <xsl:attribute name="T58"><xsl:value-of select="translate($comment,'
','')" disable-output-escaping="yes" /></xsl:attribute> I would appreciate why the working-version works. Q 2---------- q on message I have a series of message as follows when some conditions are met <xsl:message terminate="yes"> Dont know how to handle account other than 1 2. </xsl:message> <xsl:message terminate="yes"> Do not know how to process input at loc 2. </xsl:message> and so on. I have two more of these xsl:message. The first one always prints when condition is met. However, the others do not print. Then, after reading 249-251 pages in Michael's book and enclosing the text in <xsl:text> Do not know...</xsl:text> all three diagnostic messages now print. The output method is xml. Is this the culprit...If someone could explain these two behaviors...my xsl learning would be complete w.r.t whitespace and message. Thank you -- Raman