This sample can be accessed from:
portal-server-URL/rewriter/XML/attrib.html
Add the rule specified in this sample (if it does not already exist) to the default_gateway_ruleset in the section "Rules for Rewriting XML Source".
Edit the default_gateway_ruleset in the Rewriter service under the Portal Server Configuration in the Portal Server administration console.
Restart the Gateway:
./psadmin start-sra-instance –u amadmin – f <password file> –N <profile name>– t <gateway> |
<html> RW_START <body> <xml> <baseroot href="/root.html"/> </xml> <xml> <img href="image.html"/> </xml> <xml> <string href="1234|substring.html"/> </xml> <xml> <check href="1234|string.html"/> </xml> </body> RW_END </html>
<Attribute name="href" tag="check" valuePatterns="1234|"/>
<html> Rewriting starts <br> <br> <body> <xml><baseroot href="/root.html"/></xml> <xml><img href="image.html"/></xml> <xml><string href="1234|substring.html"/></xml> <xml><check href="1234|gateway-URL/portal-server-URL /rewriter/XML/string.html"/></xml>
// This statement is rewritten because it matches the conditions specified in the rule. The Attribute name is href, tag is check and the valuePatterns is 1234. The string following valuePatterns is rewritten. See Using Pattern Matching in Rules for details on valuePatterns.
</body> Rewriting ends </html>