>From the documentation:

 

"ElementPath : String : The XPath of the element to be modified. Note that
this is a formatted field and therefore, square brackets in the XPath must
be escaped."

 

To escape square brackets, use [\[] and [\]], so your XPath needs to be

 

/redirections/redirection[\[]last()[\]]

 

Otherwise Windows Installer thinks [last()] is a property and tries to
evaluate it, and an error occurs as () aren't valid in a property name.

 

This feature is present to allow properties to be used to control the XPath.

 

-- 

Mike Dimmick

 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 22 January 2008 17:40
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] WIX XML manipulation

 

 

Hi 

I need to modify an XML file and create several nodes with the same name 

<redirections xmlns="msmq-queue-redirections.xml"> 
        <redirection> 
                <from>https://external_host/*</from> 
                <to>http://internal_host/msmq/internal_queue</to> 
        </redirection> 
        <redirection> 
                <from>https://external_host/*</from> 
                <to>http://internal_host/msmq/internal_queue</to> 
        </redirection> 
        <redirection> 
        ... 
        </redirection> 
</redirections> 

Does anyone know how to add new <redirection> node and then 'from' and 'to'
nodes and set their values? I know that the script below can create a new
node but I can not get to it then. When I try to modify the 'to' and'from'
values it changes them in the first <redirection> node. If I use
/redirections/redirection[last()] I get an error. Seems like WIX doesn't
fully support XPATH 

 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to