Skip to content

Node-based CLI utility for replacing values in one or more XML files

License

Notifications You must be signed in to change notification settings

mike-feldmeier/replacexml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

replacexml

Node-based utility for replacing values in one or more XML files. Can be used as a command-line utility or as a Node module.

Command-line usage

npm install -g replacexml
replacexml //node1=value1 /doc/path/node2=value2 test.xml testdir

Module usage

var replacexml = require('replacexml');
replacexml([ '//node1=value1', '/doc/path/node2=value2', 'test.xml', 'testdir' ]);

General information

Both of the usage examples take in an array of arguments. Arguments are processed as follows:

  • Arguments containing an equal sign ('=') are treated as expressions. The left side should be a valid XPath expression, the right side should be a text value that the text content of any matches will be set to.
  • All other arguments will be treated as locations. They can refer to a single file, or a directory.
  • Directories will be recursively traversed.
  • Arguments can be in any number and in any order.

About

Node-based CLI utility for replacing values in one or more XML files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published