用xsl显示html效果

test.xml

None.gif <? xml version="1.0" encoding="gb2312" ?>
None.gif
<? xml-stylesheet href="test.xsl" type="text/xsl" ?>
None.gif
< entry >
None.gif 
< title > entry with images </ title >
None.gif 
< date > August 09, 2003 </ date >
None.gif 
< author > Kevin </ author >
None.gif 
< idnum > 000033 </ idnum >
None.gif 
< permalink > http://alazanto.org/xml/archives/000033.xml </ permalink >
None.gif 
< body  xmlns:html ="http://www.w3.org/1999/xhtml" > <![CDATA[ <p><img
None.gif  class="archive" align="right" src="http://alazanto.org/images/sample.jpg"
None.gif  alt="photograph of a flower, just for show"/>Mauris felis elit, varius
None.gif  quis, pulvinar vel, sodales vehicula, mi. Nunc elementum pharetra elit.
None.gif  </p>
]]>
None.gif 
</ body >
None.gif 
< more  xmlns:html ="http://www.w3.org/1999/xhtml" > <![CDATA[]]> </ more >
None.gif 
< comment-link > http://alazanto.org/xml/archives/000033_comments.xml </ comment-link >
None.gif 
< comment-count > 6 </ comment-count >
None.gif
</ entry >
None.gif
None.gif

test.xsl

None.gif <? xml version="1.0" ?>  
None.gif
< xsl:stylesheet  xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"  version ="1.0" >  
None.gif
None.gif
< xsl:template  match ="/entry" >  
None.gif
< html >  
None.gif
< head >  
None.gif
</ head >  
None.gif
< body >  
None.gif
< xsl:value-of  select ="title"   />  
None.gif
< xsl:value-of  select ="body"  disable-output-escaping ="yes" />  
None.gif
None.gif
</ body >  
None.gif
</ html >  
None.gif
</ xsl:template >  
None.gif
</ xsl:stylesheet >
None.gif
None.gif
None.gif

关键一句是:
disable-output-escaping="yes"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值