本规则用于重写标记元素的 PCDATA 或 CDATA。
本节分为下列各小部分:
<TagText tag="tagName" [attributePatterns="attribute_patterns_for_ this_tag" source="*"]/>
其中
tagName 是标记的名称
attributePatterns 是与该标记相应的属性及其值模式(可选项,指该标记根本无任何属性)
source 是该 xml 文件的 URI(可选项,默认值是 *,指任何 xml 页)
假定页的基 URL 为:
http://abc.sesta.com/test/rewriter/test1/xml/page.html
页内容
<xml> <Attribute name="src">test.html</attribute> <attribute>abc.html</attribute> </xml>
规则
<TagText tag="attribute" attributePatterns="name=src"/>
输出
<xml> <Attribute name="src">gateway-URL/ http://abc.sesta.com/test/rewriter/test1/ xml/test.html</attribute><attribute>abc.html</attribute> </xml>
描述
页内容的第一行包含属性示例。页内容中的第二行不包含具有属性呼叫名称且属性名称值为 src 的属性,因此不会进行任何重写。要重写该属性,也需要有 <TagText tag="attribute"/>