Ok!
Once again, from scratch, a plugin to read(for the moment) some XML elements attributes and text.
See example.
Note: is a debug state but stable...
nsisXML: XML reader for Nsis
45 posts
👍
-daz
-daz
A couple of suggestions:
a) Include the source code, so that the rest of us can help.
b) Add support for XPath.
a) Include the source code, so that the rest of us can help.
b) Add support for XPath.
it does not work.
refuses to find the file i want him to read.
the following code gives me a "system cant find the file" error:
refuses to find the file i want him to read.
the following code gives me a "system cant find the file" error:
this code even crashes the program:
IfFileExists "$OUTDIR\Mods\$R0\mod.desc" +2
Abort
nsisXml::Tidy "$OUTDIR\Mods\$R0\mod.desc"
and i'm 1000% sure, the file exists.
IfFileExists "$OUTDIR\Mods\$R0\mod.desc" +2
Abort
nsisXml::GetElementText "$OUTDIR\Mods\$R0\mod.desc" "title"
@iceman_k: I'll make some improvements..later...now, for the XPath..don't kow yet..
@Comm@nder21: I'm using firts version of msxml... maybe try using .xml & fix the path, there's a reason for system cant find the file
@Comm@nder21: I'm using firts version of msxml... maybe try using .xml & fix the path, there's a reason for system cant find the file
the path IS fixed, i also tried with .xml ending ...
this plugin does not work.
the older xml plugin from lobo lunar (they told me that youre the same 🙂) works fine for me, though its 44k ...
this plugin does not work.
the older xml plugin from lobo lunar (they told me that youre the same 🙂) works fine for me, though its 44k ...
(out of topic) Comm@nder21, your links in your signature are pointing to wrong wiki pages.
I'm using firts version of msxml...So that means, you're using the first version launched of the parser instead of the newest? Or maybe I'm overlooking this?
Well... I'm making adjustmens... I'll check that part.
@deguix: Is the installed version 1.0, which comes with IE 4, using new stuff, requires that the end-user must have the newest msxml version.
@deguix: Is the installed version 1.0, which comes with IE 4, using new stuff, requires that the end-user must have the newest msxml version.
Originally posted by iceman_kOk 🙂
A couple of suggestions:
b) Add support for XPath.
Seems that XPath will be teh* way 😁
Working on it 📻
Let's give another chance 😉
thx, deguix, ill fix them asap.
but plz, send me a pm in such things instead of posting anywhere in the forums 😁
joel, i'll try your new version asap.
but plz, send me a pm in such things instead of posting anywhere in the forums 😁
joel, i'll try your new version asap.
plugin is shit.
why?
1. unicode seems not to be supported. i get lots of errors with characters like -äöü/ in this format:
<title>ti-tle</title>
using code from the examples (text())
2. though you say, "use xpath syntax", no xpath functions are supported.
text() is no xpath function, but e.g. normalize-space() is.
(according to the page linked to in readme)
gives me just errors ...
well, if you manage to fix this two major issues, the plugin is quite usable.
what i just hate, is the requirement of the msxml4 parser, that weights over 700k!
why?
1. unicode seems not to be supported. i get lots of errors with characters like -äöü/ in this format:
<title>ti-tle</title>
using code from the examples (text())
2. though you say, "use xpath syntax", no xpath functions are supported.
text() is no xpath function, but e.g. normalize-space() is.
(according to the page linked to in readme)
gives me just errors ...
well, if you manage to fix this two major issues, the plugin is quite usable.
what i just hate, is the requirement of the msxml4 parser, that weights over 700k!
Comm@nder21:
I can't make a plugin that is "usable" just for you. The unicode is not my fault. I got feedback from another users and they say that the plugin works great, even on Win98. There are another ways to parse an xml... I'm just making an average plugin for a common and easy xml file (including for non-programmers users). I don't see why not to update to msxml4... you update your windows, right?
I can't make a plugin that is "usable" just for you. The unicode is not my fault. I got feedback from another users and they say that the plugin works great, even on Win98. There are another ways to parse an xml... I'm just making an average plugin for a common and easy xml file (including for non-programmers users). I don't see why not to update to msxml4... you update your windows, right?
i do.
but it has to be installed manually even on my winxp sp2 (it's not provided with windows update).
and this is the problem:
anyone that wants to use the program has to install this 700k package first ...
i'm sry, i didn't want to sound that rude, but i can't get it working really 🙂
of course, the parser is great, but i can't make it using any of the w3c conform functions.
just your (non-w3c) text functio works...
but it has to be installed manually even on my winxp sp2 (it's not provided with windows update).
and this is the problem:
anyone that wants to use the program has to install this 700k package first ...
i'm sry, i didn't want to sound that rude, but i can't get it working really 🙂
of course, the parser is great, but i can't make it using any of the w3c conform functions.
just your (non-w3c) text functio works...
but i can't make it using any of the w3c conform functions.ah... that's a whole another history 😉
just your (non-w3c) text functio works...
Basically you can either choose between using a very basic non-validating XML parser (which will fit into a few kilobytes) or a full-featured W3C complient parser (like MSXML) with support for namespaces, schemas and additional technologies.
Maybe it would be a good idea to create a NSIS plug-in for both situations.
Maybe it would be a good idea to create a NSIS plug-in for both situations.
(There is currently no text in this page)🙄
sorry, the forum did not recognize the URL correctly
here it is:
here it is:
Beta version ( do not overwrite or replace with the other version!!!)
Ok...
I'm working in this re-build version of nsisXML.
Test the example and tell me if you got errors...
Note: it suppose to work with OS that have msxml2 parser... so Win98 might have it pre-installed...
Ok...
I'm working in this re-build version of nsisXML.
Test the example and tell me if you got errors...
Note: it suppose to work with OS that have msxml2 parser... so Win98 might have it pre-installed...
Another big update:
nsisXML plugin to create and parse XML files using MSXML 2.6 (hope Win98 and better have it)
Instructions:
- Copy nsisXML.dll to Plugins and nsisXML.nsh to include directories
- Read this readme and example files.
Functions:
==[Build]==
Displays the build version of the plugin.
Example:
${nsisXML->Build} ${VAR_RET}
==[xPath]==
Uses xPath syntax to parse and get strings from elements or attributes values.
Example:
${nsisXML->xPath} "PATH_OF_XML_FILE" "XPATH_INSTRUCTION" ${VAR_RET}
==[Create]==
Creates, in memory, the template of the xml file.
Example:
${nsisXML->Create}
==[CreateElement]==
Let's you create a xml element, from the parent document or from another node.
Example:
${nsisXML::CreateElement} "XPATH_INSTRUCTION" "STRING_ELEMENT"
Note:
use "XPATH_INSTRUCTION" to locate a node where to put the new element; empty param means
the element will be as the first child.
==[CreateComment]]==
Well...creates a comment after an element.
Example:
${nsisXML->CreateComment} "XPATH_INSTRUCTION" "STRING_COMMENT"
==[SetElementAttr]==
Adds an attribute and its value to an element.
Example:
${nsisXML::SetElementAttr} "XPATH_INSTRUCTION" "Attribute" "Value"
==[SetElementText]==
Sets the text for an element.
Example:
${nsisXML->SetElementText} "XPATH_INSTRUCTION" "STRING_TEXT"
==[Display]==
Shows in a MessageBox How's your xml tree going.
Example:
${nsisXML->Display}
==[Release]==
Frees the memory from the xml template and save the xml into a file.
Example:
${nsisXML->Release} "$EXEDIR\myxml.xml"
nsisXML plugin to create and parse XML files using MSXML 2.6 (hope Win98 and better have it)
Instructions:
- Copy nsisXML.dll to Plugins and nsisXML.nsh to include directories
- Read this readme and example files.
Functions:
==[Build]==
Displays the build version of the plugin.
Example:
${nsisXML->Build} ${VAR_RET}
==[xPath]==
Uses xPath syntax to parse and get strings from elements or attributes values.
Example:
${nsisXML->xPath} "PATH_OF_XML_FILE" "XPATH_INSTRUCTION" ${VAR_RET}
==[Create]==
Creates, in memory, the template of the xml file.
Example:
${nsisXML->Create}
==[CreateElement]==
Let's you create a xml element, from the parent document or from another node.
Example:
${nsisXML::CreateElement} "XPATH_INSTRUCTION" "STRING_ELEMENT"
Note:
use "XPATH_INSTRUCTION" to locate a node where to put the new element; empty param means
the element will be as the first child.
==[CreateComment]]==
Well...creates a comment after an element.
Example:
${nsisXML->CreateComment} "XPATH_INSTRUCTION" "STRING_COMMENT"
==[SetElementAttr]==
Adds an attribute and its value to an element.
Example:
${nsisXML::SetElementAttr} "XPATH_INSTRUCTION" "Attribute" "Value"
==[SetElementText]==
Sets the text for an element.
Example:
${nsisXML->SetElementText} "XPATH_INSTRUCTION" "STRING_TEXT"
==[Display]==
Shows in a MessageBox How's your xml tree going.
Example:
${nsisXML->Display}
==[Release]==
Frees the memory from the xml template and save the xml into a file.
Example:
${nsisXML->Release} "$EXEDIR\myxml.xml"
pre-release (build 1.0.3)
Another changes and bug fixes... see the readme and the examples...
Another changes and bug fixes... see the readme and the examples...
In your attached archive: nsixml.nsh should be named nsisxml.nsh
Also, trying to compile example 1 (included with the package) fails with:
Also, trying to compile example 1 (included with the package) fails with:
File: "nsisXML.dll"->"$PLUGINSDIR\nsisXML.dll" [compress] 23575/65536 bytes
Plugin Command: Build 0
DetailPrint: "Build version: $0"
Invalid command: ${nsisXML->xPath}
Error in script "C:\Documents and Settings\Administrator\Desktop\stripped\exampe-1.nsi" on line 17 -- aborting creation process Full log attached. Still, I like the idea. Thank you for writing this!In your attached archive: nsixml.nsh should be named nsisxml.nshThat type was fix and is going to publish in the next, and final prerelease 😁
Also, trying to compile example 1 (included with the package) fails with:Ok...I read you error log....and seems that you missed to include in the same folder one of the xml's.
In a few moments I'm going to post the final prerelease... 🙂
pre-release (build 1.0.4)
Final preRelease... see the help file and the examples
Almost there!
Any suggestions are welcome 😁
Final preRelease... see the help file and the examples
Almost there!
Any suggestions are welcome 😁
Well... plugin uploaded into my site 🙂
Thanks for the people who test it 👍
Thanks for the people who test it 👍
nsisXML (build 1.0.5)
Ok.. the plugin is updated, the only new thing that the CreateElement function can tidy-up... 😁
TODO:
1.- Tidy on LoadXML
2.- Remove Attribute param.
🙂
Ok.. the plugin is updated, the only new thing that the CreateElement function can tidy-up... 😁
TODO:
1.- Tidy on LoadXML
2.- Remove Attribute param.
🙂
great work man, thanx 🙂
attached a repack for easier installing to nsis.
i also added some code to the include file for a future feature:
multiple sessions.
you'll get the idea by reading the new .nsh file 🙂
attached a repack for easier installing to nsis.
i also added some code to the include file for a future feature:
multiple sessions.
you'll get the idea by reading the new .nsh file 🙂
😁 👍
Nice one 😉
Nice one 😉