Skip to content

Latest commit

 

History

History
50 lines (42 loc) · 1.44 KB

README.md

File metadata and controls

50 lines (42 loc) · 1.44 KB

XML Transform Task

Task to replace tokens with variable values in XML configuration files.

Syntax

- task: XmlTransformV1@0
  inputs:
    folderPath: '**/*.nupkg'
    targetFiles: '*.nuspec'
    overrides: 'package.metadata.version = 1.1.1' 

Inputs

Package or folder

File path to the package or a folder, wildcards are supported. For example, **/*.zip. More details about syntax you can find here.

Target files

Provide new line separated list of files to substitute values. Files names are to be provided relative to the root folder. More details about syntax you can find here.

Overrides

Provide new line separated list of transformation rules.

Single node syntax:

node1.childNode1 = value
node1.childNode1:attribute1 = value
[selector].childNode1 = value
[selector].childNode1:attribute1 = value

Multiple nodes syntax:

node1.childNode1:[0] = value
node1.childNode1:[0]:attribute1 = value
[selector].childNode1:[0] = value
[selector].childNode1:[0]:attribute1 = value

For extended selecting rules you can use [selector] syntax:

Example:

[div > p] = value
[p:contains("hello")] = value
[p.selected] = value

More syntax details you can find here Cheerio - Selecting Elements.