VSoft Technologies Blogs


VSoft Technologies Blogs - posts about our products and software development.

This topic is something that I pulled from our support system, it's something we get asked about more that once a year, that is, how do I modify the xml manifest file using FinalBuilder. Typically its the assembly version attribute that users want to modify, so that's what I'll show here, but you can use the same technique to edit other parts of the manifest file. 

So lets define our XML Document by adding an XML Document Define Action, and point it at our manifest file.

Define XML Document

If you open your manifest file in notpad, you will notice assembly element looks something like this :

<assembly xmlns="urn:schemas-microsoft-com:asm.v1"  manifestVersion="1.0" >

Note the xmlns attribute, this is what causes users problems with the xml actions in FinalBuilder, XML Namespaces. The MXSML Parser is very strict when it comes to namespaces, and it requires that we make use of them when using XPath to select nodes. On the XML Document action, switch to the MSXML Parser tab and in the Extra Namespaces grid, add the following. 

Namespace Prefix

What we are doing here is assigning a prefix (x in this case) to the namespace. This prefix will be used in our XPath statements.

Add an Edit XML File action - set the XML File to use an XML Document and select the document we defined with the previous action. Now we need to define the XPath statement to the version attribute that we are going to modify.

Edit XML

And finally, add a Save XML Document Action to save our changes to the file. Note that if you are editing other parts of the manifest file, make sure you add the namespaces and different prefixes, and use this prefixes appropriately in your XPath statements.

Note, all of this could be done in a single Edit XML File action, however, if you want to make more than one modification to the manifest file then it's more efficient to use the xml document define action to avoid loading/parsing/saving the document for each edit. 

Showing 0 Comment

Comments are closed.