You're right, I did. It's a typo on my part. In my actual code, the name 
attributes match. Here is the corrected set of code samples:
 
Target XML file:
 
<configuration>
 <myComponent>
   <section name="DatabaseSettings">
     <Default server="foo" database="bar"/>
   </section>
   <section name="MoreSettings">
     ...
   </section>
 </myComponent>
</configuration>

WiX code:
 
<util:XmlConfig Id="WriteServerConfigValue"
      Action="create"
      On="install"
      Node="value"
      ElementPath="/configuration/myComponent/[EMAIL 
PROTECTED]'DatabaseSettings'[\]]/Default"
      VerifyPath="/configuration/myComponent/[EMAIL 
PROTECTED]'DatabaseSettings'[\]]/Default"
      Name="server"
      Value="[CORRECTDATABASESERVER]"
      File="[#MyXmlConfigFile]"
      Sequence="1" />


________________________________

From: [EMAIL PROTECTED] on behalf of Simon Dahlbacka
Sent: Tue 8/12/2008 11:20 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] XmlConfig XPath problem



In the sample xml provided, @name has the value DatabaseSettings while in
your xpath you check for DatabaseConnections.
Not sure about the missing separator though..

/Simon

On Tue, Aug 12, 2008 at 5:35 PM, Evans, Jim <[EMAIL PROTECTED]>wrote:

> I'm having a problem writing a value to an XML file using XmlConfig (WiX
> 3.0.4401). Here is a model XML file with the structure I have:
>
> <configuration>
>  <myComponent>
>    <section name="DatabaseSettings">
>      <Default server="foo" database="bar"/>
>    </section>
>    <section name="MoreSettings">
>      ...
>    </section>
>  </myComponent>
> </configuration>
>
> I need to set the server attribute of the Default element. Here is my WiX
> code for XmlConfig:
>
> <util:XmlConfig Id="WriteServerConfigValue"
>        Action="create"
>        On="install"
>        Node="value"
>
>  ElementPath="/configuration/myComponent/[EMAIL 
> PROTECTED]'DatabaseConnections'[\]]/Default"
>
>  VerifyPath="/configuration/myComponent/[EMAIL 
> PROTECTED]'DatabaseConnections'[\]]/Default"
>        Name="server"
>        Value="[CORRECTDATABASESERVER]"
>        File="[#MyXmlConfigFile]"
>        Sequence="1" />
>
> When I try to run the resulting .msi, I receive an error that says "Failed
> to find node:
> /configuration/myComponent/[EMAIL PROTECTED]'DatabaseConnections]Default in
> XML file
> <My file name>, system error: -2147467259"
>
> What concerns me is that my path delimiter ('/') is getting lost between my
> section "name" attribute and my child "Default" element. Am I escaping
> something wrong? Is my xpath wrong (I don't think it is, but I'm not the
> greatest at xpath)? Most of the samples I've seen for XmlConfig stop after
> finding a node with an attribute, not continuing to a child node thereof.
>
> --Jim Evans
> Numara Software
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to