Subject:Force xslt to not end element as but instead Author:Dustin Sellers Date:24 Feb 2006 02:01 PM
Snippet from xsl file:
<textarea style="height:55;" readonly="true">
<xsl:value-of select="root/user/@note"/>
</textarea>
when @note is not present it converts the html to <textarea/> which causes issues (it then throws everything else in the page into the textarea. I can not remove the textarea tag if @note is not present because it is needed for editing.
Subject:Force xslt to not end element as but instead Author:Minollo I. Date:24 Feb 2006 02:41 PM
Dustin,
if your output method is set to HTML the XSLT processors should avoid collapsing <textarea ...></textarea> into <textarea .../>
Are you using an XML output method for some reason? What processor are you running? If for any reason you don't want to set the output method to HTML, you may try adding a newline character to the <textarea> content when the value in XML is not available (something like <xsl:text> </xsl:text>).
Subject:Force xslt to not end element as but instead Author:Dustin Sellers Date:24 Feb 2006 04:04 PM
Thanks for the help
I am using the Xalan processor and am not setting it to XML output unless that is the default.
My output method is: <xsl:output method="html" encoding="ISO-8859-1"/>
I am currently doing what you said but am getting complaints. I also tried placing <xsl:comment>Prevent from collapsing</xsl:comment> between the <textarea> tags and it works except it puts the comment in the textarea field.
Subject:Force xslt to not end element as but instead Author:Minollo I. Date:24 Feb 2006 05:43 PM
Dustin,
I can't reproduce the behavior you are describing using XalanJ when the output method is set the way you mention; also, I'm not sure what kind of "complaints" you get using the suggested <xsl:text> workaround...
I'm not sure we can help you more unless you post some more about your stylesheet...