?Sorry Pierson...that XML Snippet was slightly wrong (I'm not at home and haven't got access to the original file so had to use a different file and forgot to edit it). Here's the proper snippet (note significant difference to what I posted before):
<?xml version="1.0" encoding="utf-8"?> <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <DeploymentModelSpecificContent> <Manifest> <SSIS:Project SSIS:ProtectionLevel="DontSaveSensitive" xmlns:SSIS="www.microsoft.com/SqlServer/SSIS"> <SSIS:DeploymentInfo> <SSIS:PackageInfo> <SSIS:PackageMetaData SSIS:Name="..\SSIS\GlobalExecutor.dtsx"> </SSIS:PackageMetaData> </SSIS:PackageInfo> </SSIS:DeploymentInfo> </SSIS:Project> </Manifest> </DeploymentModelSpecificContent> </Project> -----Original Message----- From: Pierson Lee (PIE) Sent: Tuesday, February 08, 2011 8:44 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Are there any known problems with XPathexpressions in custom action? I see the issue now. So your node is looking for SSIS:Name = '..\SSIS\GlobalExecutor.dtsx' where your xml file has SSIS:Name = 'Package.dtsx' . it uses the ElementPath to find the exact node you want to change. Try this: <util:XmlFile Id="StageToWarehouseSSISPackageElementChange" ElementPath="/Project/DeploymentModelSpecificContent/Manifest/SSIS:Project/SSIS:Packages/SSIS:Package[\[]@SSIS:Name='Package.dtsx'[\]]" File="[#StageToWarehouseProjectFile]" Action="setValue" Name="SSIS:Name" Value="GlobalExecutor.dtsx" Sequence="1" /> -----Original Message----- From: Jamie Thomson [mailto:ja...@jamie-thomson.net] Sent: Tuesday, February 08, 2011 12:04 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Are there any known problems with XPath expressions in <XmlFile> custom action? ?Hi Pierson, I thought about that but then, consider the error message: >Failed to find node >"/Project/DeploymentModelSpecificContent/Manifest/SSIS:Project/SSIS:Packages/SSIS:Package[@SSIS:Name='..\SSIS\GlobalExecutor.dtsx']" That's the XPath expression *after* it has escaped the square brackets from: >"/Project/DeploymentModelSpecificContent/Manifest/SSIS:Project/SSIS:Packages/SSIS:Package[\[]@SSIS:Name='..\SSIS\GlobalExecutor.dtsx'[\]]" In other words, the parsed ElementPath has produced the correct XPath expression. Hence I doubt whether the problem is the '\' In answer to your earlier question, here is the XML file that I am trying to change (edited to only show the part that I am attempting to change): <?xml version="1.0" encoding="utf-8"?> <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <DeploymentModelSpecificContent> <Manifest> <SSIS:Project SSIS:ProtectionLevel="DontSaveSensitive" xmlns:SSIS="www.microsoft.com/SqlServer/SSIS"> <SSIS:DeploymentInfo> <SSIS:PackageInfo> <SSIS:PackageMetaData SSIS:Name="Package.dtsx"> </SSIS:PackageMetaData> </SSIS:PackageInfo> </SSIS:DeploymentInfo> </SSIS:Project> </Manifest> </DeploymentModelSpecificContent> </Project> I need to change "Package.dtsx" into "..\SSIS\GlobalExecutor.dtsx" Regards Jamie -----Original Message----- From: Pierson Lee (PIE) Sent: Tuesday, February 08, 2011 7:30 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Are there any known problems with XPath expressions in custom action? Actually I think I know what it is. You need to escape your \ with another \ in your @SSIS:Name= section so it looks like [\[]@SSIS:Name='..\\SSIS\\GlobalExecutor.dtsx'[\]] -----Original Message----- From: Pierson Lee (PIE) [mailto:pierson....@microsoft.com] Sent: Tuesday, February 08, 2011 11:18 AM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Are there any known problems with XPath expressions in <XmlFile> custom action? I personally have had better success with the XmlConfig tag to do what you are doing. I would verify that the case and property value is correct. It is loking for SSIS:Name= "..\SSIS\GlobalExecutor.dtsx" in the SSIS:Package element. Can you copy that block from your xml file you are attempting to edit so we can see a comparison? -----Original Message----- From: Jamie Thomson [mailto:ja...@jamie-thomson.net] Sent: Tuesday, February 08, 2011 7:03 AM To: General discussion for Windows Installer XML toolset. Subject: [WiX-users] Are there any known problems with XPath expressions in <XmlFile> custom action? ?Hi all, I am trying to use <XmlFile> custom action to replace an attribute value in an XML file. I have used an external tool to validate that my XPath query is correct but I get an error: Failed to find node "/Project/DeploymentModelSpecificContent/Manifest/SSIS:Project/SSIS:Packages/SSIS:Package[@SSIS:Name='..\SSIS\GlobalExecutor.dtsx']" when I attempt to call my .msi. Here is my <XmlFile> element: <util:XmlFile Id="StageToWarehouseSSISPackageElementChange" ElementPath="/Project/DeploymentModelSpecificContent/Manifest/SSIS:Project/SSIS:Packages/SSIS:Package[\[]@SSIS:Name='..\SSIS\GlobalExecutor.dtsx'[\]]" File="[#StageToWarehouseProjectFile]" Action="setValue" Name="SSIS:Name" Value="GlobalExecutor.dtsx" Sequence="1" /> Like I say, I have validated that the XPath is correct so does anyone know if there is any known problem here? For extra info, the following XPath does NOT throw the same error: /Project/DeploymentModelSpecificContent/Manifest/SSIS:Project/SSIS:Packages/SSIS:Package so it seems to be having issues with the bit on the end that tries to filter by attribute value. Any advice much appreciated. thanks Jamie ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users