You'll need to go through the MSXML documentation. I've only successfully done this once myself and it took me a few hours of pouring over the MSXML documentation to get the magical incantation just right. Unfortunately, I don't have access to that code anymore and I don't have a few free hours to read the MSXML documentation...
-----Original Message----- From: Dmitry Berkovich [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2008 08:38 To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] adding element with XmlFile to node with namespace Hi, Does anyone has any example of XPath expression that added new node to Xml with schema? I tried all the variants, but it was not working. Also I tried to execute expression with "XSLPattern" (/SolutionProfile//[EMAIL PROTECTED]'Apps']//Modules) instead of "XPath". But it adds new node wich contains empty namespace: <ModuleInfo xmlns="" AssemblyFile="My.dll" /> which ignored by my application since it contains empty namespace. Thanks in advance, Dima On Fri, Nov 7, 2008 at 8:37 AM, Rob Mensching <[EMAIL PROTECTED]> wrote: > You need to use the same namespaces in your XPath. It's a pain. I usually > write a little JScript and test my XPath using cscript until I get it right. > > -----Original Message----- > From: Dmitry Berkovich [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 06, 2008 22:30 > To: General discussion for Windows Installer XML toolset. > Subject: [WiX-users] adding element with XmlFile to node with namespace > > Hi, > I want add <ModuleInfo AssemblyFile="My.dll" /> node to this xml > file under <Modules> node. > <SolutionProfile xmlns="http://schemas.microsoft.com/pag/cab-profile/2.0"> > <Section Name="Apps"> > <Modules> > </Modules> > </Section> > </SolutionProfile> > > > I added those 2 lines under <Component>: > <WixUtil:XmlFile Id="A1" Action="createElement" > ElementPath="SolutionProfile/[EMAIL PROTECTED] = > "Apps"[\]]/Modules" Name="ModuleInfo" > File="[#ProfileCatalog.xml]" SelectionLanguage="XPath" Sequence="1"/> > <WixUtil:XmlFile Id="A2" Action="setValue" > ElementPath="SolutionProfile/[EMAIL PROTECTED] = > "Apps"[\]]/Modules/ModuleInfo[\[]last()[\]]" > Name="AssemblyFile" Value="My.dll" File="[#ProfileCatalog.xml]" > SelectionLanguage="XPath" Sequence="2"/> > > > Its works only if I remove namespace from XML files. Once I add > namespace back to XML file - I have exception during install that node > not found. > Any idea? > > Thanks in advance, > Dima > > P.S. - I am using Wix 3.0.4325.0 > > ------------------------------------------------------------------------- > 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 ------------------------------------------------------------------------- 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