Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Program Announcements / Yet another XML-Plugin

Author
Message
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Aug 2011 22:22 Edited at: 4th Feb 2013 11:26
Hi, now i will present you my little work. This is my first DBPro-Plugin. I know there is another plugin that do the same. It was an Experiment for me how i make a Plugin . Anyway.
Here the Commandlist.

Document related:


Element related:


Attribute related:


And here a small example how to use this Commands:


You see it works with ID's. ID can be between 1 and 2^31 (2147483648). Always positive. Documents and Elements have seperate id-counts. Possible is Document ID=1 and Element ID = 1.

Comments, question, suggestions and bugs please post here.

P.S.: Sorry for my bad English. I hope you understand me.

EDIT (2011 09 13)
File: xml-plugin_[en]_20110912_madbit.zip (Megaupload) <-- OBSOLETE

ChangeLog:
ADD Documentation
FIX 'XML DUPLICATE ELEMENT' error.
FIX 'XML GET ATTRIBUTE' did not work correctly. (thanks: freight hopper)

EDIT (2011 09 28)
File: xml-plugin_20110928_madbit.zip (Uploading) <-- OBSOLETE

ChangeLog:
FIX Some documentation errors. (thanks: freight hopper)

EDIT (2013 01 25)
File: xml-plugin_20130125.zip <-- OBSOLETE

ChangeLog:
ADD XML PARSE DOCUMENT (to parse a xml from string)

EDIT (2013 02 04)
File: xml-plugin_[en]_20130204.zip

ChangeLog:
FIX XML REMOVE ELEMENT did not work because a wrong command-table. (thanks: Ruwbaen)

Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine

Attachments

Login to view attachments
WorldBot
12
Years of Service
User Offline
Joined: 5th Aug 2011
Location: In a Worms game
Posted: 19th Aug 2011 00:45
Thanks for sharing your plugin

Work like a charm for me and easy to use
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 21st Aug 2011 06:42
nice to hear

here is another example for using this plugin. it's more documented and the same example as in the example folder in the download.



With Computers you can solve Problems that you have never befor.

My English is so BAD ;(
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 23rd Aug 2011 18:31
Nice to see this and the working examples.

One question, are any other frameworks or runtimes required to run this, other than a standard DBPro Installation? ( I have played with so many other add-ons that have required additional software to be installed that I can't presently detect such a requirement).

Also the download is a bit goofy - two windows pop up on the other download site. One gives a 74kb file which is useless. The one behind it has a useable zip archive. Downloading directly from this forum would be easier . . .

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 24th Aug 2011 09:42
Quote: "One question, are any other frameworks or runtimes required to run this, other than a standard DBPro Installation? ( I have played with so many other add-ons that have required additional software to be installed that I can't presently detect such a requirement).
"


No, you need nothig. only DBPro and my plugin. It is Programmed completely in c/c++ and tinyxml (a c++ library).

Quote: "Also the download is a bit goofy - two windows pop up on the other download site. One gives a 74kb file which is useless. The one behind it has a useable zip archive. Downloading directly from this forum would be easier . . .
"


Sorry for this trouble. I will edit the first post.

With Computers you can solve Problems that you have never befor.

My English is so BAD ;(
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 27th Aug 2011 15:23
Good to know and the download works great. Thank you.

The Wilderbeast
18
Years of Service
User Offline
Joined: 14th Nov 2005
Location: UK
Posted: 2nd Sep 2011 23:56
Hi MadBit, I see you tried uploading the torrent to darkBIT but it didn't work - did you remember to download it and seed it afterwards?

I've re-created and uploaded the torrent for you and it is now working fine Here is the link if you want it:





10% TGC Discount!
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 3rd Sep 2011 00:34
Ahhh, Thank's. I dont know what i have make wrong. I have download the torrent. but the availability show me always zero. Maybe, i work with µTorrent 2.2.1?

Hmm, but your torrent works perfectly. Thank you.

With Computers you can solve Problems that you have never befor.

My English is so BAD ;(
The Wilderbeast
18
Years of Service
User Offline
Joined: 14th Nov 2005
Location: UK
Posted: 5th Sep 2011 10:44
The problem is that you need to leave it seeding for about an hour or two until on of our servers picks it up and starts seeding it 24/7.


10% TGC Discount!
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 7th Sep 2011 19:32
I've had a chance to play a bit more with your plugin and have a few questions/observations.

It seems your 'get' commands (like xml get root element) are more assignments to a pre-existing constant or variable, quite differnet from other xml plugins on this site which find or create a node number or elemnet ID for you.

Do you intend to develop this further? As in creating help files?

Can't get the 'xml get attribute' command to work, at least on a root element and this after I use 'xml count attributes' and 'xml get attribute name' to find count and names.

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 8th Sep 2011 11:59
Quote: "It seems your 'get' commands (like xml get root element) are more assignments to a pre-existing constant or variable, quite differnet from other xml plugins on this site which find or create a node number or elemnet ID for you."

The ID system is similar to that of DBPro itself. The ID's need not be specially created. the management of the ID's assume the plugin itself. That is the difference to DBPro. If an ID has already been used and not released then it will be overwritten. Do not forget to release the id, if you do not need this anymore.

Quote: "Do you intend to develop this further? As in creating help files?"

Yes. I try to help as best as possible and a documentary is also planned. If my poor English does not interfere.

Quote: "Can't get the 'xml get attribute' command to work, at least on a root element and this after I use 'xml count attributes' and 'xml get attribute name' to find count and names."

ohh. Thank you. This was a small bug. I fixed it and uploaded the patched dll file.
I have now tested using this xml file and the following code.

xml-file


code


If I have the documentation ready I'll post a new release.

With Computers you can solve Problems that you have never befor.

My English is so BAD ;(
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 9th Sep 2011 20:28
Thanks for the fix! I'll try again soon. Glad to hear you plan on developing the help files.

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 13th Sep 2011 09:49
So, now the documentation is ready. I've fixed a little bug.

In the first post you can download the new version.

If you find more bugs then just bring it on.

With Computers you can solve Problems that you have never befor.

My English is so BAD ;(
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 23rd Sep 2011 19:59 Edited at: 27th Sep 2011 17:47
Regarding the new version at megaupload, "The file you are trying to access is temporarily unavailable. Please try again later."

(forum download works fine)

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 24th Sep 2011 11:15
Now I've managed to still make the download on the forum. Had previously always get an error message.

So see the first post.

With Computers you can solve Problems that you have never befor.

My English is so BAD ;(
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 27th Sep 2011 17:49
Help files look great. Resuming my efforts . . .

freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 28th Sep 2011 05:58
I remain very interested in you product for purely selfish reasons. Found a few problems with the help files:

Index.html does not have XML SET ELEMENT NAME hyperlinked.

XML GET ATTRIBUTE brings up DBPro main menu, though page exists

XML INSERT COMMENT brings up a blank web page, though page exists

XML DUPLICATE ELEMENT brings up a blank web page, though page exists

XML SET ELEMENTS ABSOLUT hyperlinked but it doesn't bring up correct help page

XML GET NEXT ELEMENT example flawed? "Could not determine paramter type" error when using test.xml from test directory. Maybe we should run it against another test.xml file? If so, maybe your example code should have a section with an xml target file as text that we can copy, rename to test.xml and run the code against. Only a suggestion.

Thanks again for your work on this.

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 28th Sep 2011 19:43 Edited at: 28th Sep 2011 19:48
Quote: "Index.html does not have XML SET ELEMENT NAME hyperlinked."

FIXED

Quote: "XML GET ATTRIBUTE brings up DBPro main menu, though page exists"

I could not reproduce this error.

Quote: "XML INSERT COMMENT brings up a blank web page, though page exists"

FIXED

Quote: "XML DUPLICATE ELEMENT brings up a blank web page, though page exists"

FIXED

Quote: "XML SET ELEMENTS ABSOLUT hyperlinked but it doesn't bring up correct help page"

I could not reproduce this error.

Quote: "XML GET NEXT ELEMENT example flawed? "Could not determine paramter type" error when using test.xml from test directory. Maybe we should run it against another test.xml file? If so, maybe your example code should have a section with an xml target file as text that we can copy, rename to test.xml and run the code against. Only a suggestion."

Oh no, there I had made ​​one small error when copy / pasting.
The example produces the 'test.xml' file and then reads from it.

FIXED

I thank that you have made ​​me aware of these errors.

The new release can be found in the first post.

EDIT: Forum download works

With Computers you can solve Problems that you have never befor.

My English is so BAD ;(
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 19th Oct 2011 17:24
I'm going thru some crude tests and am having trouble with the XML GET CHILD ELEMENT command. I am using the file "zoo.xml", content reproduced below.



I am wondering about the range implications of this command. To get started the following code works:



But suppose I want to "grab" the JUNGLE element first without having to traverse all child elements. The range parameters of the XML GET CHILD ELEMENT suggests that I should be able to do this. The following code returns "ZOO":



The name variant of the command does work:



But only if the range is "1, "JUNGLE", 1". If I try 1, "JUNGLE", 2", it also returns "ZOO".

So how are the range parameters (from element, to element) really supposed to be used? Can you please provide an example using my lame zoo.xml?

Thanks, FH

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 19th Oct 2011 21:48
I'm sorry but this are not range elements.
FromElement is the basic element from which the next element is taken. The result is then stored in ToElement.
Unfortunately you can not retrieve the elements by numbers. So you need to specify the name, as you have already done. Or write a simple function to count the elements.
Below is a modification of your second listing with a simple count function.



I hope this does not make too much trouble.

With Computers you can solve Problems that you have never befor.
Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 20th Oct 2011 20:16
OK, I get it now, I think. Thanks for the clarification. Perhaps the following might help someone struggling as I was.

The xml file (zoo2.xml):



My new demo code:



My problem was that "to" and "from" are highly suggestive of a range within a list and I headed down the wrong path.

I would suggest some minor changes in the documentation. Maybe a prefatory note that an "element" is a user-specified, numeric handle not related to the structure's position among its peers. Perhaps a change in the XML GET CHILD ELEMENT documentation - change "FromElement, ChildName$, ToElement" to "FromParentElementID, ChildName$, ToElementID". And for XML GET NEXT ELEMENT parameter section "Starting Element Integer ID" and "Next Element Integer ID". Suggestions only. This is getting more and more interesting. I'm feelin' the power!

MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 20th Oct 2011 20:58 Edited at: 20th Oct 2011 20:58
Thank's for suggestions. I will change it as soon as possible.

And many thanks for your demo code.


With Computers you can solve Problems that you have never befor.
Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2024-04-18 19:10:09
Your offset time is: 2024-04-18 19:10:09