Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL with text and html

Status
Not open for further replies.

Sniipe

Programmer
Oct 9, 2006
115
IE
I have my XSL transformation working grand with my xml up till now.
Now I have added in some CDATA with HTML code in it. It works grand if the <xsl:eek:utput method='text' but the problem is that the rest of the document is in 'html'

<xsl:value-of select="warning"/> will spit out the CDATA html code and all if the method is text, but I want it to work with method='text'

I thought the following would work (copied from some searched site)
<xsl:text disable-output-escaping="yes">&lt;%</xsl:text>
<xsl:value-of select="warning"/>
<xsl:text disable-output-escaping="yes">%&gt;</xsl:text>

But it displays nothing
 
this is the source code of the HTML page


<h1>hi</h1>&lt;h1&gt;CDATA HERE - WARNING HTML&lt;/h1&gt;<table border="5" width="85%"><tr><td></td></tr><tr><td></td></tr></table><table border="5" width="85%"><tr><td></td></tr><tr><td></td></tr></table></div>
 
[1] ><xsl:value-of select="warning"/> will spit out the CDATA html code and all if the method is text, but I want it to work with method='text'
Failed to make sense out of it. Is method="text" desirable or not?
[2] And then where is the warning tag?
 
I want HTML then TEXT then HTML in my XSL document
The warning tag is in the warning xml file:

XmlCDataSection CData;
CData = myXML.CreateCDataSection("<h1>CDATA HERE - WARNING HTML</h1>");
 
Can you show what output you desire? (I presume that what you have show above is the output you are generating, but not the desired output.)

Tom Morrison
 
Sorry lads, I'm making a dogs dinner of this :D

The output that I'm getting (html source code) is:
<h1>hi</h1>
&lt;h1&gt;CDATA HERE - WARNING HTML&lt;/h1&gt;

But what I want is:
<h1>hi</h1>
<h1>CDATA HERE - WARNING HTML</h1>
 
Still confusing to me at least. You have:
Code:
CDATA HERE - WARNING HTML
Should I assume that this is a proxy for a string of characters that contains <, >, ", etc? Are you trying to get a browser to show, in the second <h1>...</h1>, some HTML source code?

Tom Morrison
 
yes, CDATA HERE - WARNING HTML is a holder for html text.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top