xmlnsnorm - normalises namespace prefixes in XML files
xmlnsnorm -m 'URI prefix' [ -m 'URI prefix' ... ] [ <filename> ] Options: -m <mapping> specify URI to prefix mapping (space separated) -h help - display the full documentation Example: xmlnsnorm -m 'http://purl.org/dc/elements/1.1/ dc' in.xml >out.xml
This script takes an XML document either on STDIN or from a named file and writes a 'normalised' version of the file to STDOUT. Any prefixed names (elements or attributes) associated with a mapped namespace URI will have their prefix changed to the prefix you specify. Any namespace prefixes which occur in the document but for which you have not specified a mapping, will be passed through unchanged.
This script uses the following modules:
XML::SAX::ParserFactory XML::Filter::NSNormalise XML::SAX::Writer
Grant McLean <grantm@cpan.org>
Copyright (c) 2002 Grant McLean. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install XML::Filter::NSNormalise, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Filter::NSNormalise
CPAN shell
perl -MCPAN -e shell install XML::Filter::NSNormalise
For more information on module installation, please visit the detailed CPAN module installation guide.