public class ChangeNamespacePrefixProcessor extends Object implements NodeProcessor
NodeProcessor
which alters the namespace prefix for all relevant Nodes within an XML
document Node. It alters namespace prefixes in the following logical places:
<xs:element ref="oldPrefix:aRequiredElementInTheOldPrefixNamespace"/>
is altered to
<xs:element ref="newPrefix:aRequiredElementInTheOldPrefixNamespace"/>
<xs:element type="oldPrefix:something"/>
is altered to
<xs:element type="newPrefix:something"/>
<xs:extension base="oldPrefix:something"/>
is altered to
<xs:extension base="newPrefix:something"/>
Constructor and Description |
---|
ChangeNamespacePrefixProcessor(String oldPrefix,
String newPrefix)
Creates a new ChangeNamespacePrefixProcessor providing the oldPrefix which should be replaced by the newPrefix.
|
public ChangeNamespacePrefixProcessor(String oldPrefix, String newPrefix)
oldPrefix
- The old/current namespace prefixnewPrefix
- The new/substituted namespace prefixpublic boolean accept(Node aNode)
accept
in interface NodeProcessor
aNode
- The DOM node to process.true
if the provided Node should be processed by this NodeProcessor.public void process(Node aNode)
process
in interface NodeProcessor
aNode
- The DOM Node to process.Copyright © 2005–2015 Codehaus. All rights reserved.