Re: [xsl] xml:space preserve on element converted to html textarea encoding issue

Subject: Re: [xsl] xml:space preserve on element converted to html textarea encoding issue
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Tue, 7 Jun 2011 09:33:53 -0700
Correction:

This is legal:
    <xsl:output method="xml" version="1.0" encoding="{$encoding}"
indent="yes"/>

I just had to change XSL version to 1.1, otherwise oxygen was giving
me an error on this line.

Karl..

On Tue, Jun 7, 2011 at 9:29 AM, Karl Stubsjoen <kstubs@xxxxxxxxx> wrote:
> So I converted writing the textarea out using CDATA sections and still
> the tag is collapsed!  I was certain that this would not be the case,
> so that is a little confusing.  So then I thought maybe I can sneak
> the &nbsp; into the output in my closing textarea like this:
>
> <xsl:text
disable-output-escaping="yes"><![CDATA[&nbsp;</textarea>]]></xsl:text>
>
> And this does work.  Although, the non-breaking space character isn't
> really what I want either, I really need <textarea></textarea> with no
> white space and the tag not collapsed.
>
> So the dilemna with the encoding is this:  the master stylsheet is
> generating either an FO or HTML.  I've been writing everything out to
> FO as UTF-8, so now I would need to switch between the two, but can
> not, not without calling two different templates, one to produce HTML
> and the other to produce FO.  As is, the system calling the stylesheet
> is passing a param specifiying either of the two output types.
>
> I did test US-ACII encoding and that works great two.  So given the
> nature of my system (1 stylesheet) am I stuck writing out the textarea
> the long way as I have?
>
> Karl..
>
> On Tue, Jun 7, 2011 at 8:59 AM, David Carlisle <davidc@xxxxxxxxx> wrote:
>> On 07/06/2011 16:54, Karl Stubsjoen wrote:
>>> Perhaps the better thing
>>> to do is to shove the tags into the result from a CDATA section
>>
>> you can't have "better thing" and "CDATA section" in the same sentence on
>> this list or the word "tag" for that matter.
>>
>> There is nothing wrong with your result file, just with the way you are
>> viewing it. If setting up whatever you are using to view to understand
utf-8
>> is tricky, just tell XSLT to generate the file in some other encoding such
>> as
>> <xsl:output encoding="US-ASCII"/>
>>
>> David
>>
>>
>> ________________________________________________________________________
>> The Numerical Algorithms Group Ltd is a company registered in England
>> and Wales with company number 1249803. The registered office is:
>> Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
>>
>> This e-mail has been scanned for all viruses by Star. The service is
>> powered by MessageLabs.
>> ________________________________________________________________________
>>
>
>
>
> --
> Karl Stubsjoen
> MeetScoresOnline.com
> (602) 845-0006
>



--
Karl Stubsjoen
MeetScoresOnline.com
(602) 845-0006

Current Thread