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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rephrase - HTML inside XML

Status
Not open for further replies.

Muddmuse

Programmer
Jul 31, 2001
85
US
I have a call to a database that returns XML that I transform with XSL to output HTML. The contents of the XML may contain HTML tags like this:

<Node>
<Text>Hello <b>World</b> <a href=&quot;#&quot;>Click here</a></Text>
</Node>

In my XSL I'm trying to do a <xsl:value-of select=&quot;/Node/Text&quot;/> that will apply the HTML tags. If I use <xsl:copy-of select=&quot;/Node/Text&quot;/> I get the desired results except the actual node &quot;<Text>&quot; gets outputted. Is there a way to produce the following output?

<html>
<body>
Hello <b>World</b> <a href=&quot;#&quot;>Click here</a>
</body>
</html>

and not this output?

<html>
<body>
<Text>Hello <b>World</b> <a href=&quot;#&quot;>Click here</a></Text>
</body>
</html>

 
Could theis be of any help?

Code:
<xsl:template match=&quot;Text&quot;>
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match=&quot;Text/*&quot;>
 <xsl:copy-of select=&quot;.&quot;/>
</xsl:template>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top