#!/usr/bin/perl use warnings; use strict; use XML::XSH2; $XML::XSH2::Map::file = '1.xml'; $XML::XSH2::Map::project = 'Release DLL|Win32'; $XML::XSH2::Map::old = 'ReleaseDLL'; $XML::XSH2::Map::new = 'ReleaseDLL32'; xsh << 'end ;' open $file ; register-namespace msb http://schemas.microsoft.com/developer/msbuild/2003 ; for //msb:PropertyGroup[contains(@Condition, $project)] { for ( ./msb:IntDir | ./msb:OutDir ) { set . xsh:subst(text(), $old, $new) ; } } save :b ; end ;