lite
Version:
A cross platform template engine base on xml/html and javascript expression.
125 lines • 3.12 kB
text/xml
<test format="true">
<unit title="继承语法(页面继承和元素继承)">
<model>
{
array:[1,2,3,'4',5.5,'',true,null,false,[1,2],{a:1,b:2},[]],
string:"JSON 功能测试'\"",
object:{aa:1,bB:2,CC:[1]}
}
</model>
<source path="/test/parent1.xhtml"><![CDATA[
<html c:extends="parent2.xhtml">
<title><c:block name="title">默认标题1</c:block></title>
<body>
<div id="content"><c:block name="content">默认内容1</c:block></div>
</body>
</html>]]></source>
<source path="/test/parent2.xhtml"><![CDATA[
<html>
<title><c:block name="title">默认标题2</c:block></title>
<body>
<div id="content"><c:block name="content">默认内容2</c:block></div>
</body>
</html>]]></source>
<source path="/parent3.xhtml"><![CDATA[
xml version="1.0" encoding="GBK"
<html>
<title><c:block name="title">默认标题3</c:block></title>
<body>
<div id="content"><c:block name="content">默认内容3</c:block></div>
</body>
</html>]]></source>
<case title="页面继承1">
<source><![CDATA[
xml version="1.0" encoding="utf-8"
<c:extends path="test/parent2.xhtml">
<c:block name="content">内容222222</c:block>
</c:extends>]]></source>
<expect><![CDATA[
<html>
<title>默认标题2</title>
<body>
<div id="content">内容222222</div>
</body>
</html>]]></expect>
</case>
<case title="页面继承">
<source><![CDATA[
xml version="1.0" encoding="utf-8"
<c:extends path="parent3.xhtml">
<c:block name="title">标题</c:block>
</c:extends>]]></source>
<expect><![CDATA[
xml version="1.0" encoding="GBK"
<html>
<title>标题</title>
<body>
<div id="content">默认内容3</div>
</body>
</html>]]></expect>
</case>
<case title="页面多级继承">
<source><![CDATA[
xml version="1.0" encoding="utf-8"
<c:extends path="test/parent1.xhtml">
<c:block name="content">内容</c:block>
</c:extends>]]></source>
<expect><![CDATA[
<html>
<title>默认标题1</title>
<body>
<div id="content">内容</div>
</body>
</html>]]></expect>
</case>
<case title="元素继承">
<source><![CDATA[
<div>
<c:extends path="test/parent2.xhtml">
<c:block name="content">内容</c:block>
</c:extends></div>]]></source>
<expect><![CDATA[
<div>
<html>
<title>默认标题2</title>
<body>
<div id="content">内容</div>
</body>
</html></div>]]></expect>
</case>
<case title="元素继承">
<source><![CDATA[
xml version="1.0" encoding="utf-8"
<div>
<c:extends path="test/parent2.xhtml">
<c:block name="content">内容</c:block>
</c:extends></div>]]></source>
<expect><![CDATA[
xml version="1.0" encoding="utf-8"
<div>
<html>
<title>默认标题2</title>
<body>
<div id="content">内容</div>
</body>
</html></div>]]></expect>
</case>
<case title="元素多级继承">
<source><![CDATA[
xml version="1.0" encoding="utf-8"
<div>
<c:extends path="test/parent1.xhtml">
<c:block name="content">内容</c:block>
</c:extends></div>]]></source>
<expect><![CDATA[
xml version="1.0" encoding="utf-8"
<div>
<html>
<title>默认标题1</title>
<body>
<div id="content">内容</div>
</body>
</html></div>]]></expect>
</case>
</unit>
</test>