XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Dustin SellersSubject: 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.

Any ideas on how to do this?

Postnext
Minollo I.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>&#10;</xsl:text>).

Hope this helps,
Minollo

Postnext
Dustin SellersSubject: 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.

Posttop
Minollo I.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...

Minollo

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.