Bugs item #1512850, was opened at 2006-06-26 17:02
Message generated for change (Comment added) made by copsey
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1512850&group_id=105970
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: v2.0
Status: Open
Resolution: None
Priority: 5
Submitted By: Lionel LASKE (llaske)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error using XPath expression in XmlFile node
Initial Comment:
I need to update some XML values in a settings file
using XmlFile node. Because all keys in my settings
are "add" nodes, I use a XPath expression. CANDLE and
LIGHT work but the MSI failed with: "Failed to find
node: ..., system error: -2147467259".
To reproduce this bug, take the SampleWml and change
settings.xml like this:
<settings>
<add key="first" value="oldfirst"/>
<add key="second" value="oldsecond"/>
<add key="third" value="oldthird"/>
</settings>
Then change the SampleXml.wxs like this:
<Component Id='Settings' Guid='MYGUID-574D-4A9A-A266-
5B5EC2C022A4'>
<File Id='XmlSettings' Name='settings.xml'
DiskId='1' Source='settings.xml' Vital='yes' />
<XmlFile Id='XmlSettings1' File='[INSTALLDIR]
settings.xml' Action='setValue' Name='value'
Value='1' ElementPath='[EMAIL PROTECTED]"first"\]'
Sequence='1'/>
<XmlFile Id='XmlSettings2' File='[INSTALLDIR]
settings.xml' Action='setValue' Name='value'
Value='2' ElementPath='[EMAIL PROTECTED]"second"\]'
Sequence='2'/>
<XmlFile Id='XmlSettings3' File='[INSTALLDIR]
settings.xml' Action='setValue' Name='value'
Value='3' ElementPath='[EMAIL PROTECTED]"third"\]'
Sequence='3'/>
</Component>
Find included my upgraded version of SampleXml files.
----------------------------------------------------------------------
Comment By: Copsey (copsey)
Date: 2006-07-05 09:49
Message:
Logged In: YES
user_id=1263750
you need to escape square brackets in your xpath with a \
and then surround with []
so [ -> [\[]
and ] -> [\]]
----------------------------------------------------------------------
Comment By: Lionel LASKE (llaske)
Date: 2006-07-04 09:25
Message:
Logged In: YES
user_id=1189318
A work around to avoid this bug is to use a property for
the XPath value. So if your WXS file is:
<XmlFile ... ElementPath='//[EMAIL PROTECTED]"third"\]'/>
You can use alternatively:
<Property Id="THIRDNODE">[EMAIL PROTECTED]"third"]</Property>
<XmlFile ... ElementPath='//add[THIRDNODE]'/>
Using this work around, the Xml node is correctly
processed by WiX.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1512850&group_id=105970
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs