关于如何对待xht…
Author
Zhou Renjian
Create@
2004-01-26 22:43

关于如何对待xhtml中的空格问题,以及空格问题带来的乱码问题,现在已经解决了,解决方法如下:
XSL 示范:
-------------
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/content">
<xsl:value-of disable-output-escaping="yes" select="node()"/>
</xsl:template>
</xsl:stylesheet>
XML例子
-----------
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="xhtml.xsl"?>
<content><![CDATA[
<OL>
<LI>Cancel the default behavior of the browser by setting the event object <B>returnValue</B> to false in the <B>onpaste</B> event handler. This applies only to objects, such as the <A href="mk:@MSITStore:M:\MSDN\inet.chm::/workshop/author/dhtml/reference/objects/INPUT_text.htm">text box</A>, that have a default behavior defined for them. </LI>
<LI>Specify a data format in which to paste the selection through the <A href="mk:@MSITStore:M:\MSDN\inet.chm::/workshop/author/dhtml/reference/methods/getData.htm">getData</A> method of the <A href="mk:@MSITStore:M:\MSDN\inet.chm::/workshop/author/dhtml/reference/objects/clipboardData.htm">clipboardData</A> object. </LI>
<LI>Invoke the method in the <B>onpaste</B> event to execute custom paste code. </LI></OL>
]]></content>
所有的anote.getXHTML改为
"<![CDATA[" + anote.innerHTML + "]]" + ">"
并且,对原有的数据库进行操作:
update simpletext set content=concat("<![CDATA[",content,"]]>");