Hi!
I have a question about manipulating XML-files. I want to create a new
element inside an existing node, after the element is created I want to set
some attributes on it.
My problem is that there already exists elements of the kind I want to add,
how can I make the setValue action work on the new element instead of on of
the existing? (the first one)
My XML-file have the following structure
<ParentNode>
<ChildNodes>
<ChildNode Name="A"/>
<ChildNode Name="B"/>
</ChildNodes>
</ParentNode>
And I want to create a new ChildNode element and set the Name value to "C".
<util:XmlFile Id="XmlSettings1" File="[INSTALLDIR]settings.xml"
Action="createElement" Name="ChildNode"
ElementPath="//ParentNode/ChildNodes" Permanent="no" Sequence="1"/>
<util:XmlFile Id="XmlSettings2" File="[INSTALLDIR]settings.xml"
Action="setValue" Name="Name" Value="C"
ElementPath="//ParentNode/ChildNodes/ChildNode" Permanent="no"
Sequence="2"/>
when I try this it adds a new empty ChildNode element and modifies the name
of the "A" childnode. I suppose that it's not so suprisning since I do not
specify which ChildNode element that should be modified...
Should I set the value attribute in createElement and then use that value
(by using a XPath) when identifying the new child node where I want to set
the name attribute? If so, how do I set the Text value when defining a
XPath?
/Hans
--
View this message in context:
http://www.nabble.com/XmlFile-CreateElement-tp17864933p17864933.html
Sent from the wix-users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users