# Add an attribute to an xml file

**URL:** https://www.finalbuilder.com/forums/t/add-an-attribute-to-an-xml-file/535
**Category:** Discussion
**Created:** [July 24, 2007, 2:08am UTC](https://www.finalbuilder.com/forums/t/add-an-attribute-to-an-xml-file/535 "2007-07-24T02:08:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 24, 2007, 2:08am UTC](https://www.finalbuilder.com/forums/t/add-an-attribute-to-an-xml-file/535/1 "2007-07-24T02:08:04Z")

</div>

Hello,

It's possible to add an attribute to an xml-file with Finalbuilder? My xml-file looks like this:

&nbsp;

.c9Y6TC { color:#0000ff; }.c194KG { color:#602020; }.cLUY2 { color:#ea8f0f; }.c18YC0 { color:#d00020; }.c5M9S0 { color:#000090; } \<?xml version="1.0" encoding="utf-8"?\>  
\<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\>  
&nbsp;&nbsp;\<assemblyIdentity name="test" version="1.0.0.2" publicKeyToken="304b26cdaf23d288" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" /\>  
&nbsp;&nbsp;\<description asmv2:publisher="test" asmv2:product="test" asmv2:supportUrl="http://www.test.ch/" xmlns="urn:schemas-microsoft-com:asm.v1" /\>  
&nbsp;&nbsp;\<deployment install="true"\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<subscription\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<update\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<beforeApplicationStartup /\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</update\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</subscription\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<deploymentProvider codebase="http://zeittw222/system7/Ch.ZeitAg.System7.Client.Smart.application" /\>  
....

I want to add the mapFileExtensions="true" attribute to the deployment node, that it looks like this:

&nbsp;\<deployment install="true" mapFileExtensions="true"\>

How can I do that with a Finalbuilder Action?

Thanks for a fast answer...

Greets,

Peter

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [July 25, 2007, 2:09am UTC](https://www.finalbuilder.com/forums/t/add-an-attribute-to-an-xml-file/535/2 "2007-07-25T02:09:45Z")

</div>

Hi Peter,   
  
 You can do this with FinalBuilder’s Edit XML File action, but you’ll first need to set up the action to use the namespaces in the XML File. This is due to a limitation in MSXML.   
  
 When you add the Edit XML action, go to the “MSXML Parser” tab, check the box marked “Automatically use namespace prefixes declared in the document root node”. In the field underneath the checkbox, type in a prefix to use for the default namespace (something like ‘df’)   
  
 Then, go back to the Edit XML tab and choose the relevant source file.   
  
 The XPath will be : /asmv1:assembly/df:deployment   
  
 The Attribute will be : mapFileExtensions   
  
 The value : true   
  
 … that should get the result you need.   
  
 If you’re having trouble getting it up and running, please zip up the XML file and attach it to the forum thread, and I will put together an example FinalBuilder project for it.   
  
 Regards,   
  
 angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 25, 2007, 8:02am UTC](https://www.finalbuilder.com/forums/t/add-an-attribute-to-an-xml-file/535/3 "2007-07-25T08:02:21Z")

</div>

Wow thanks! It works...

peter
