[wix-users] Find and Change XML Specific Element
Edwin Castro
egcastr at gmail.com
Fri Nov 5 12:55:15 PDT 2021
I'm assuming the difference between MyConfig in the file content example
and DelphiaConfig in the xpath is just a typo.
Try this xpath?
ElementPath="//DelphiaConfig/ScheduledServices/RemoteApplica
nt[\[]@Name='ApplicantStackJob'[\]]/URL/text()"
--
Edwin G. Castro
On Fri, Nov 5, 2021 at 12:06 PM Brian E via wix-users <
wix-users at lists.wixtoolset.org> wrote:
> 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
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
More information about the wix-users
mailing list