![]() |
#1 |
Junior Member
Join Date: Mar 2014
Posts: 17
|
![]()
I have an installer that needs to modify an existing XML document. The document currently has a node structure that looks like this:
code: My installer needs to add a couple of type elements with their own Name, Namespace, and CLSID child elements. I've tried to use wizou's XML plugin, but was not seeing my new entry added to the XML file. Here's what I tested: code: Would anyone care to suggest an alternate method, or maybe fill me in on what I'm doing wrong with the plugin from wizou? A lot of the threads I've read are a bit dated, so I wasn't sure what the best practice would be like when it comes to this sort of task. |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
Perhaps it's the encoding of the source file, ie ansi, utf-8, or utf-16le?
Try creating a new file with nsisXML as a test and see what the encoding of it is. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Mar 2014
Posts: 17
|
Thanks for the suggestion, I realized I was creating a new file called sample.xml instead of sample.dat! I can create a new XML file but am finding my installer crash when I use nsisXML::load "Sample.dat". This is what I get from the Windows event log:
code: Is there an alternate method you can recommend for modifying an existing XML document? Should I just use some kind of text editing find/replace operation? |
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
Maybe the plugin only accepts files with the .xml extension?
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Mar 2014
Posts: 17
|
It still crashes after I change the *.dat file to *.xml
![]() Is there a method I can use to do a find and replace sort of operation on a text file? |
![]() |
![]() |
![]() |
#6 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
Like I said before, it might be the encoding of your file you are trying to modify (ansi, utf-8, utf-16le). So use the plugin to write a brand new test file, and check the encoding against your file to see if it matches or not.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
|
Tags |
xml |
Thread Tools | Search this Thread |
Display Modes | |
|
|