RE: [xsl] xml to html paragraphing

Subject: RE: [xsl] xml to html paragraphing
From: "Pinch, David" <David.Pinch@xxxxxxxxxx>
Date: Thu, 29 Mar 2001 11:31:52 -0600
Hello Java XML,

I experienced a similar problem in the past and perhaps this hack will get
you started.  I allow clients to submit entries using a rich editor such as
the Microsoft DHTML Edit Control or IE55 DIV.ContentEditable.  My
application receives the data and stores it in a SQL Server 2000 database.
Getting the user HTML is easy.  Re-displaying the HTML is a bit tricker...

My XML SQL Server query returns the user-entered HTML in a CDATA wrapper.
This ensures proper compliance with XSLT but makes the HTML tags appear as
plain-text to the web browser.  I resolved the problem by writing a small,
client-side JavaScript function that takes the "escaped" HTML and converted
it to valid HTML using the client-side DHTML DOM.

Specifically, I assign the escaped data to the innerHTML property of some
HTML element, such as a DIV or SPAN.  It renders properly on IE55.  I have
not tested Netscape.  I'm not an expert at XSL, XSLT, etc., and I'm sure
there's probably a better way of doing this.  Maybe this will give you some
ideas.

Email if you want specific examples.


-----Original Message-----
From: Java XML [mailto:jaxlive@xxxxxxxxxxx]
Sent: March 29, 2001 08:46
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] xml to html paragraphing


Hi Peter,
             But i have the para tags in within the text of the element so 
there is not need to worry about inserting the tags but now my problem is 
when i generate an html the tags are show as &lt;p&gt;
thats the problem now is there a way so that i can output the tags as it is 
and these tags are in the cdata section of the element is ther a way to 
disable the escaping...

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread