openalm / Extension-UtilitiesPack

Release Management utility tasks
Other
34 stars 38 forks source link

Tokenizer: Use SelectNodes instead of SelectSingleNode #71

Open Gaikotsu2 opened 7 years ago

Gaikotsu2 commented 7 years ago

It would be nice to be able to use the XPath capabilities to update several nodes using a single XPath statement. I have a situation where the same value that needs to be placed into multiple similar xml hierarchies.

The limitation appears to be due to the use of SelectSingleNode(...) to return a single node based on the XPath supplied instead of using SelectNodes(...) and iterating over all returned nodes.

Current:

{ "KeyName": "/configuration/FileSystemTriggers/file/trigger[@name='Export']/conditions/condition[@name='FileExists']", "Attribute": "path", "Value": "path.export_service.triggers\ExtractFilename" }, { "KeyName": "/configuration/FileSystemTriggers/file/trigger[@name='Export']/conditions/condition[@name='FileStable']", "Attribute": "path", "Value": "path.export_service.triggers\ExtractFilename" },

Desired:

{ "KeyName": "/configuration/FileSystemTriggers/file/trigger[@name='Export']/conditions/condition", "Attribute": "path", "Value": "__path.export_service.triggers\ExtractFilename__" }