NsisXML plug-in (by Joel)

From NSIS Wiki

Author: Joel (talk, contrib)

NOTE: The name of this plug-in conflicts with Wizou's nsisXML.


Forum topic


Version: 1.6.

nsisXML plugin to create and parse XML files using MSXML 2.6 (hope Win98 and better have it)

- Copy nsisXML.dll to Plugins and nsisXML.nsh to include directories
- Read this readme and example files.



Displays the build version of the plugin.

Example: ${nsisXML->Build} ${VAR_RET}


Uses xPath syntax to parse and get strings from elements or attributes values.



Creates, in memory, the template of the xml file.

Example: ${nsisXML->Create}


Let's you create a xml element, from the parent document or from another node. Note: use "XPATH_INSTRUCTION" to locate a node where to put the new element; empty param means the element will be the first child; also "DO_TAB" will make a "tidy" element, use "1" as param to make it, other wise empty means the element will not have tidy (see example #2).

Example: ${nsisXML->CreateElement} "XPATH_INSTRUCTION" "STRING_ELEMENT" "DO_TAB"


Creates a comment after an element.

Example: ${nsisXML->CreateComment} "XPATH_INSTRUCTION" "STRING_COMMENT"


Adds an attribute and its value to an element.

Example: ${nsisXML->SetElementAttr} "XPATH_INSTRUCTION" "Attribute" "Value"


Sets the text for an element.

Example: ${nsisXML->SetElementText} "XPATH_INSTRUCTION" "STRING_TEXT"


Shows in a MessageBox How's your xml tree going.

Example: ${nsisXML->Display}


Frees the memory from the xml template and save the xml into a file.

Example: ${nsisXML->Release} "PATH_OF_XML_FILE"


Opens a xml file.

Example: ${nsisXML->OpenXML} "PATH_OF_XML_FILE"


Loads a xml string tree.



Closes 'OpenXML' or 'LoadXML' functions and saves the updates made to the file.

Example: ${nsisXML->CloseXML}


Dump in a output var, the xml tree.

Example: ${nsisXML->xml} ${VAR_RET}


Remove an element, upon of the selected index of the node that have it.

Example: ${nsisXML->removeChild} "XPATH_INSTRUCTION" "index_of_the_child_to_remove"


Remove an attribute, upon of the selected name.

Example: ${nsisXML->removeAttr} "XPATH_INSTRUCTION" "name_of_the_attribute_to_remove"


Makes the XML string from a <file> cuter :), see example #9.

Example: ${nsisXML->TidyFile}


Creates a template of XML in the memory, no need params and they are just for testing tasks (see example #8).

Example: ${nsisXML->TestBegin}


Loads a xml string to test your xpath syntaxes.

Example: ${nsisXML->TestXML}


Loads a xml file to test your xpath syntaxes.

Example: ${nsisXML->TestFile}


Shows in a MessageBox the current XML tree.

Example: ${nsisXML->TestShow}


Cleans the xml template from the memory.

Example: ${nsisXML->TestEnd}


  • Just add support to tidy the inputed XML string.


16/07/2005 Added to my server.
19/10/2005 All the updates will be publish in the forum topic.

Personal tools