Hi Blair, a useful tool to check your Xpath expression is http://xpathtester.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=3600
I had the same problem but after the correct Syntax it works fine. BR Michael -----Ursprüngliche Nachricht----- Von: Blair [mailto:os...@live.com] Gesendet: Dienstag, 06. Oktober 2009 23:45 An: 'General discussion for Windows Installer XML toolset.' Betreff: Re: [WiX-users] Unable to use Xpath expressions XMLFile uses the msxml3 engine that was released before XPath 1.0 became finalized. As such, you have to set the SelectionLanguage attribute (the obsolete working-draft predecessor to XPath is too different and too limited and is the unfortunate "default"). Here is what I tested: <util:XmlFile Id="AddStuff" Action="createElement" File="[#Config.xml]" ElementPath="/stuffs" Name="stuff" SelectionLanguage="XPath" Sequence="1"/> <util:XmlFile Id="AddStuffName" Action="createElement" File="[#Config.xml]" ElementPath="/stuffs/stuff[\[]last()[\]]" Name="name" SelectionLanguage="XPath" Sequence="2" Value="new stuff"/> -----Original Message----- From: pan.pantzia...@compassmc.com [mailto:pan.pantzia...@compassmc.com] Sent: Tuesday, October 06, 2009 12:44 PM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] Unable to use Xpath expressions It successfully performs the first action and inserts the new element. But it fails the second action. -----Original Message----- From: Blair <os...@live.com> Sent: 06 October 2009 19:58 To: 'General discussion for Windows Installer XML toolset.' <wix-users@lists.sourceforge.net> Subject: Re: [WiX-users] Unable to use Xpath expressions Is it failing on the first action or just the second? -----Original Message----- From: pan.pantzia...@compassmc.com [mailto:pan.pantzia...@compassmc.com] Sent: Tuesday, October 06, 2009 9:26 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] Unable to use Xpath expressions Hi, I'm new to Wix 3.0 and am trying to use it to insert new elements into a config XML file. The format of the file is something like this: <stuffs> <stuff> <name>first stuff</name> </stuff> <stuff> <name>more stuff</name> </stuff> </stuffs> I want to add another stuff element to the end of the file and am trying to use XMLFile as follows: <DirectoryRef Id="ConfigXML"> <Component Id="XMLFile" Guid="My-GUID"> <File Id="SettingsXmlFile" Name="config.xml" Source="c:\path\to\xmlfile\config.xml" DiskId="1" Vital="yes" /> <util:XmlFile Id="AddStuff" Action="createElement" ElementPath="/stuffs" Name="stuff" File="c:\path\to\xmlfile\config.xml " Sequence="1"/> <util:XmlFile Id="AddStuffName" Action="createElement" ElementPath="/stuffs/stuff[\[]last()[\]]" Name="name" Value="new stuff" File=" c:\path\to\xmlfile\config.xml " Sequence="2"/> </Component> </DirectoryRef> I've tried escaping and not escaping the Xpath expression to get the last stuff element, which is the last one added, but all I get are errors. I've tried all sorts of kludges to reference the new stuff element but to no avail. This is with the 3.0.5419.0 build of WiX 3.0. I can't get any xpath expression to resolve at all... What am I doing wrong? Thanks ________________________________ Compass Limited Compass House, 60 Priestley Road, Guildford, Surrey GU2 7YU Compass Limited is registered as a company in England and Wales Company Registration No. 1714804 VAT Registration No. GB391315557 Tel: +44 (0)1483 514500 Fax: +44 (0)1483 302279 www.compassmc.com This message may contain confidential and/or privileged information. If you are not the addressee or authorised to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any other information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your co-operation. ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ********************************************************************* Hinweis: Dieses E-mail kann vertrauliche und geschützte Informationen enthalten. Sollten Sie nicht der beabsichtigte Empfänger sein, verständigen Sie bitte den Absender und löschen Sie dieses E-mail dann sofort. Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. ********************************************************************* ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users