I have an infopath form which is published in a sharepoint document library. I have a custom feature which automatically transfer infopath field values to a word document template. This feature needs an XML mapping (hardcoded) with Word Content Control and the Xpath with namespace prefix of the infopath field and this is uploaded in the same document library as well.
Example of mapping (bold is the namespace prefix):
<XMLIntoWordMapping pagesXPath="/my:myFields[1]">
<mapping wordContentControlAlias="EmployeeFirstName" xPath="/ns1:myFields[1]/ns1:EmployeeFirstName[1]" />
<mapping wordContentControlAlias="EmployeeLastName" xPath="/ns1:myFields[1]/ns1:EmployeeLastName[1]" />
So with the above mapping, my infopath forms with the xpath below will work:
/ns1:myFields[1]/ns1:EmployeeFirstName[1]
/ns1:myFields[1]/ns1:EmployeeLastName[1]
However whenever I have updates on the infopath template itself, it somehow changes the namespace prefix. So for instance, the existing infopath forms will have a ns1 as prefix, the new forms (updated template) will have either have ns2 or ns0 thus it doesn't match my XML mapping and doesn't export to word!
Example: /ns2:myFields[1]/ns2:EmployeeFirstName[1]
How do I make the namespace prefix standard so I can only use 1??
Thanks.