Kristen Zirkler
Kristen Zirkler

Reputation: 53

how can i store rich text formatting in XML that pulls out to my page formatted

I am storing user inputs through a form with wiki style formatting (text for bold, _text for underline, etc) in my database. I was planning to use the db functions & some page code to store all of the info out to XML with the proper html formatting for each rich text field included. From there the XML gets parsed with an XSL stylesheet. The one thing I haven't been able to figure out is how to get the HTML to appear as HTML. I can get it to show the code on screen but not the formatted html.

Does any one know of a way to A) get the html in the xml file and have it appear on screen as formatted html or B) how to find/replace my wiki formatting with html with the XSL

Upvotes: 1

Views: 4444

Answers (1)

Buddy
Buddy

Reputation: 6713

So, if I understand you correctly, you have some xml with html formatting in it, something like this:

<foo><strong>blah <a href="/">bar</a></strong></foo>

The xsl to display the html inside foo is:

<xsl:template match="foo">
    <xsl:copy-of select="."/>
</xsl:template>

Upvotes: 1

Related Questions