VSoft Technologies BlogsVSoft Technologies Blogs - posts about our products and software development.https://www.finalbuilder.com/resources/blogsModifying XML Manifest files with FinalBuilderhttps://www.finalbuilder.com/resources/blogs/postid/739/modifying-xml-manifest-files-with-finalbuilder.NET,DelphiFinalBuilder,General,XMLMon, 07 Dec 2015 11:37:47 GMTThis 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.&nbsp;<br /> <br /> So lets define our XML Document by adding an <a href="http://wiki.finalbuilder.com/display/FB8/XML+Document+Define+Action" target="_blank" title="XML Document Define Action Documentation">XML Document Define Action</a>, and point it at our manifest file.<br /> <br /> <p style="text-align: center;"> <img src="/blogimages/vincent/manifest/manifest-xml-doc.png" alt="Define XML Document" /> </p> <br /> If you open your manifest file in notpad, you will notice assembly element looks something like this :<br /> <br /> <pre class="brush:xml; toolbar:true;">&lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" &gt; </pre> <br /> 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.&nbsp;On the XML Document action, switch to the MSXML Parser tab and in the Extra Namespaces grid, add the following.&nbsp;<br /> <br /> <p style="text-align: center;"> <img src="/blogimages/vincent/manifest/manifest-xml-doc2.png" alt="Namespace Prefix" /> </p> <br /> 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.<br /> <br /> Add an<a href="http://wiki.finalbuilder.com/display/FB8/Edit+XML+File+Action" target="_blank" title="Edit XML File Action documentation"> Edit XML File action</a> - 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.<br /> <br /> <p style="text-align: center;"> <img src="/blogimages/vincent/manifest/manifest-xml-edit-version.png" alt="Edit XML" /> </p> <br /> 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.<br /> <br /> 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.&nbsp;<br />739