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!

XML XSL and HTML content 1

Status
Not open for further replies.

bbwrede

Programmer
May 22, 2003
52
US
Hi,
I have a lot of html content in a database. I need to export the content to xml. I am trying to figure out if the data is usable in its current form. I can't figure out how to retain the html tags.

For example: if my xml file looks like:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;tempdoc.xsl&quot;?>
<!-- XML Document -->
<foo>
<bar>
<html>
<body>
<table>
<tr>
<td>xx</td>
<td>yy</td>
</tr>
<tr>
<td>bb</td>
<td>gg</td>
</tr>
</table>
</body>
</html>
</bar>
</foo>

And my xsl like:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; xmlns:fo=&quot;<xsl:template match=&quot;/&quot;>
<xsl:value-of select=&quot;foo/bar&quot;/>
</xsl:template>
</xsl:stylesheet>

I get the following output:

xx yy bb gg

How do I retain my HTML formatting?

Thanks for any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top