Edit XML File Action Question

I am trying to use the Edit XML File action to edit a Visual Studio 2005 Web Deployment Project. I cut and pasted the file below. I want to edit the four AssemblyAttributes so that the AssemblyVersion and AssemblyFileVersion are the same using a Script Variable. I can get to the first node using the following XPath

/a:Project/a:ItemGroup/a:AssemblyAttributes/a:Value

and change the value to the Script Variable. What I cannot figure out is how to get to the other three. My ultimate aim is to have the AssemblyVersion and AssemblyFileVersion for the DLLs that are created to all have the same number that reflects my custom Major.Minor.BuildDate.BuildNumber. Any suggestions?


http://schemas.microsoft.com/developer/msbuild/2003">

Debug
AnyCPU
8.0.51103
2.0
{681F6585-8932-467C-B710-A35AC2270C7F}
..\Project1_UI
{7AB5D0FA-A8BE-4822-AEF9-EF55E47520D4}|C:\Projects\FinalBuilder\Project1_Solution\Project1_UI
/Project1_UI


true
.\Debug
true
true
Project1_UI


false
.\Release
true
true
Project1_UI





4.0.0.0


4.0.0.0




3.0.0.0


3.0.0.0

Hi Bob,

Unfortunately, our forum software doesn’t play nice with embedded tags. If you click the Add Reply button, then go down to the “Attach Files” section, then you can attach the actual XML file to the post.

Regards,


Angus

Hi Bob,

Here are the XPath’s that will update the four version values.

/a:Project/a:ItemGroup[@Condition][ 1 ]/a:AssemblyAttributes[@Include=‘AssemblyFileVersion’]/a:Value
/a:Project/a:ItemGroup[@Condition][ 1 ]/a:AssemblyAttributes[@Include=‘AssemblyVersion’]/a:Value

/a:Project/a:ItemGroup[@Condition][ 2 ]/a:AssemblyAttributes[@Include=‘AssemblyFileVersion’]/a:Value
/a:Project/a:ItemGroup[@Condition][ 2 ]/a:AssemblyAttributes[@Include=‘AssemblyVersion’]/a:Value

Regards,
Paul.

Thanks for supplying a quick solution to my question and in the future I will attach any xml or other files with special formats. I should have known better and send many apologies.

Hi Bob,

That’s OK. I think all of us here have found ourselves in “angle bracket hell” once or twice. With a bit of luck, the forum authors will update the editor page so it escapes them automatically.

Regards,


Angus