Edwin,

I believe you're missing the Action and Node attributes of the XmlConfig tag.

<util:XmlConfig Id="id"
                        File="file"
        
ElementPath="//SqlCommandVariables/Properties/Property[\[]PropertyName='name1'[\]]/PropertyValue"
                        Action="create"
                        Node="value"
                        On="install"
                        Value="[PUBLICPROPERTY]" />

That XPath should pull the PropertyValue element of just the Property that has 
a PropertyName element that's text is 'name1'.  By not defining the Name 
attribute of XmlConfig, this should set the text of the PropertyValue to 
whatever the value of PUBLICPROPERTY is.

Hope this helps,

Matthew Yost
Software Engineer
GLD Solutions, Inc.
http://dotnetdeveloperwoes.blogspot.com/

-----Original Message-----
From: Castro, Edwin G. (Hillsboro) [mailto:edwin.cas...@fiserv.com]
Sent: Tuesday, July 21, 2009 4:24 PM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] XPath for XmlConfig and Xml Namespaces

I'm trying to use XmlConfig to update a file that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<SqlCommandVariables 
xmlns="urn:Microsoft.VisualStudio.Data.Schema.Project.SqlCmdVars">
  <Version>1</Version>
  <Properties>
    <Property>
      <PropertyName>name1</PropertyName>
      <PropertyValue>value1</PropertyValue>
    </Property>
    <Property>
      <PropertyName>name2</PropertyName>
      <PropertyValue>value2</PropertyValue>
    </Property>
    <Property>
      <PropertyName>name3</PropertyName>
      <PropertyValue>value3</PropertyValue>
    </Property>
  </Properties>
</SqlCommandVariables>

My goal is to change the text of PropertyValue where the sibling PropertyName 
equals a particular string. I’ve been trying to come up with XPaths to do this 
and I am having trouble.

<util:XmlConfig
  Id="id"
  File="fileId"
  ElementPath="/SqlCommandVariables/Properties/Property[\[]PropertyName = 
'name1'[\]]"
  Name="PropertyValue"
  Value="[PUBLICPROPERTY]"
  On="install"/>

Of course, this isn't working and I'm sure my problem is operator error. Am I 
using XmlConfig incorrectly?


Edwin G. Castro
Software Developer - Staff
Electronic Banking Services
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail

------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to