The rules for XML attributes are similar to the attribute rules for HTML. The difference is that attribute rules of XML are cases sensitive while HTML attribute rules are not. This is again due to case sensitivity built into XML and not into HTML.
Rewriter translates the attribute value based on the attribute name.
This section is divided into the following parts:
<Attribute name="attributeName" [tag="*" type=”URL” valuePatterns="*" source=”*”]/>
where
attributeName is the name of the attribute (mandatory)
tag is the name of the tag, where this attribute is present (optional, deafult is * , meaning any tag)
valuePatterns See Using Pattern Matching in Rules.
source is the URI of this XML page (optional, default is *, meaning in any XML page)
Assume the base URL of the page is:
http://abc.sesta.com/test/rewriter/test1/xml/page.html
Page Content
<xml> <baseroot href="/root.html"/> <img href="image.html"/> <string href="1234|substring.html"/> <check href="1234|string.html"/> </xml>
Rules
<Attribute name="href"tag="check" valuePatterns="1234|"/>
Output
<xml> <baseroot href="/root.html"/><img href="image.html"/> <string href="1234|substring.html"/><check href="1234| gateway-URL /http://abc.sesta.com/test/rewriter/test1/xml/string.html"/></xml>
Description
In the above example, only the fourth line is rewritten because it meets all the conditions specified in the rule. See Using Pattern Matching in Rules.