【发布时间】:2011-09-29 22:36:39
【问题描述】:
我的 XML 文件包含带有格式化 HTML 的节点。 我正在尝试将 html 内容打印到页面,但速度正在剥离 HTML 标签。
如何使用速度打印存储在 XML 文件中的 html 内容?
XML 文件
<?xml version="1.0" encoding="utf-8"?>
<system-data-structure>
<heading>This is a Title</heading>
<main>
<content>
<h1>this is formatted html</h1>
<p>content I want <b>to</b> <em>show</em> on my page
</p>
</content>
</main>
</system-data-structure>
速度代码
#set ($html = $contentRoot.getChild('main').getChild('content'))
<h1>$contentRoot.getChild('heading').value</h1>
<div>$html.value</div>
注意:这是我第一次使用速度引擎
【问题讨论】:
标签: html xml apache templates velocity