Hi everyone
I'm relatively new to xsl event though I worked with xhtml/php for some years now.
I have a concept for a forum, I want to build a forum that uses xml as it's out put so any program will be able to display it's post.
It has to have a XSL stylesheet to behave like a classic forum as well.
I'm using client side XSL
"<?xml-stylesheet type="text/xsl" href="xsl stylesheet/forum.xsl"?>"
because I belive this way my forum can achieve it's maximum speed(If the client is caching the xsl files).
But I came across a issue when I tried to display and store post text as html format.
I searched the web for many minutes and came up with a couple of solutions, none of them suited me too well. The best so far was to use copy-of instead of value-of but the problem with that is that when invalid xhtml is inside a xml node I get errors from the browser.
The information inside the node must be able to invalid since it's submitted by the users and checking if it's valid, forcing the user to make it valid is not something I want to do for obvious reasons.
I tried a couple of other syntaxes like using CDATA but it just returned the value inside replacing < with < etc.
I also tried a method using comments (surround the inner text with html comments and then cut them out in some way).
But I couldn't get it to render as html as well.
Is it possible?
What am I doing wrong?
Here's some code example:
XML output generated by php
Code:
<root>
<users>
<user id="12">
<name>ilyail3</name>
<avatar>open/Other/gif10.gif</avatar>
<signature>
sign
<br/>
<div align="right">
linkin park - 2Worlds
<br/>
ilyail3 - Site's developer
<br/>
</div>
</signature>
</user>
<user id="13">
<name>4everevil</name>
</user>
</users>
<parents>
<parent>
<id>0</id>
<title>VB2005</title>
<mod>12</mod>
</parent>
<parent>
<id>1</id>
<title>Games</title>
<icon>vb2005.png</icon>
<mod>12</mod>
</parent>
</parents>
<thr>
<page>
<this>1</this>
<max>1</max>
</page>
<id>3</id>
<sticky>0</sticky>
<locked>0</locked>
</thr>
<posts>
<post title="title" skip="0">
<id>4</id>
<title>TestAgain</title>
<content>
<!--
You <strong>should write my name</strong><img src="include/tinymce/plugins/emotions/images/smiley-cool.gif" border="0" alt="Cool" title="Cool" />
-->
</content>
<date>290807 92907</date>
<user>12</user>
</post>
<post skip="0">
<id>6</id>
<title>SecondPost</title>
<content>
</content>
<date>290807 92909</date>
<user>12</user>
</post>
</posts>
<prem>
<write>1</write>
<delete>1</delete>
<stiky>1</stiky>
<lock>0</lock>
</prem>
</root>
And here's the latest xsl instruction(which is not really working but the closest I ever got)
Code:
<xsl:copy-of select="content/comment()" disable-output-escaping="yes"/>