gulp-xmlpoke

0.2.1 • Public • Published

gulp-xmlpoke

Gulp port of grunt-xmlpoke

Simple replacement

gulp.src('/path/to/file.xml')
    .pipe(xmlpoke({
      replacements : [{
          xpath : "//foo"        
        , value: "bar"
       }]
     }))
    .pipe(gulp.dest('/path/to/dest/file.xml'));

Replacing with a function

gulp.src('/path/to/file.xml')
    .pipe(xmlpoke({
      replacements : [{
          xpath : "//foo"        
        , value : function(node) { 
          var nodeValue = node.firstChild.data;          
          return nodeValue + "Bar";
       }]
     }))
    .pipe(gulp.dest('/path/to/dest/file.xml'));

Using Namespaces

gulp.src('/path/to/file.xml')
    .pipe(xmlpoke({
      replacements : [{
          xpath : "//foo:bar"
        , namespaces : {"foo" : "http://schemas.example.com/foo.xsd"}
        , value: "bar"
       }]
     }))
    .pipe(gulp.dest('/path/to/dest/file.xml'));

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.1
    373
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.1
    373
  • 0.2.0
    1
  • 0.1.0
    0

Package Sidebar

Install

npm i gulp-xmlpoke

Weekly Downloads

257

Version

0.2.1

License

none

Last publish

Collaborators

  • hulahomer
  • chrismissal
  • pedroreys