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

HTML in XML

Status
Not open for further replies.

flanakin

Programmer
Mar 21, 2000
158
US
Is it possible to use HTML tags within XML? For instance:

<desc>
This is my description.<br/>
This is my second line.<br/>
<b>And the third is bolded.</b>
</desc>

I would like to be able to do this for formatting, but do not know of a way to do it without checking for the tags in every place that I want it to be possible. Any help is appreciated. Thanks. ________________________________________
Michael C Flanakin
Indigo Web Systems
michael.flanakin@indigows.com
 
Yes. All you have to do is copy the HTML tags in your XSL file.
This can be accomplished by adding the following template to your stylesheet:

<xsl:template match=&quot;@*|*&quot;>
<xsl:copy>
<xsl:apply-templates select=&quot;@*|node()&quot; />
</xsl:copy>
</xsl:template>

The exception is the line break tag <br> which will add two line breaks (<br></br>). To fix this problem add the following template also to your stylesheet:

<xsl:template match=&quot;br&quot;>
<br />
</xsl:template>

It's that simple!

WhichMan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top