[wix-users] Find and Change XML Specific Element
Brian E
brianke at gmail.com
Fri Nov 5 12:06:05 PDT 2021
I have this XML:
<MyConfig>
<ScheduledServices>
<RemoteApplicant>
<Name>ApplicantStackJob</Name>
<URL></URL>
</RemoteApplicant>
</ScheduledServices>
</MyConfig>
There are additional <RemoteApplicant> elements, each with a unique
<Name>. How can I use XmlFile to find this specific element
(<RemoteApplicant> with <Name> = 'ApplicantStackJob') and set the <URL>. I
have have tried the following, which works if I omit the "[\[]@Name...[\]]"
portion but sets all the URLs to the same value
<util:XmlFile Id="UpdateApplicantStackURL"
Action="setValue"
File="[CONFIGFOLDER]config.xml"
SelectionLanguage="XPath"
ElementPath="//DelphiaConfig/ScheduledServices/RemoteApplicant[\[]@Name='ApplicantStackJob'[\]]/URL"
Value="[APPLICANTSTACK_API_URL]"
Sequence="5" />
However, it does not work when I add the "[\[]@Name...[\]]" portion to the
path.
Brian
If you can't explain it simply, you don't understand it well enough. -
Albert Einstein
More information about the wix-users
mailing list