Open Forum > Round Table

Missing documentation for XML module

(1/2) > >>

votan:
I'm trying to do some XML parsing right now, but the chm help file does not contain any information for most of the xml commands.
Maybe someone here know this module and can give simple examples for every command?

Thanx in advance...

Support:

--- Code: ---module xml

REM """
The module xml.bas is based on the Gnome libxml2 library.
"""
' FUNCTION DECLARATIONS
declare sub     ::ParseFile    alias "sbxmlParseFile"     lib "xml"
declare sub     ::NewDoc       alias "sbxmlNewDoc"        lib "xml"
declare sub     ::FreeDoc      alias "sbxmlFreeDoc"       lib "xml"
declare sub     ::GetChildren  alias "getchildren"        lib "xml"
declare sub     ::SetChildren  alias "setchildren"        lib "xml"
declare sub     ::GetNext      alias "getnext"            lib "xml"
declare sub     ::SetNext      alias "setnext"            lib "xml"
declare sub     ::GetPrev      alias "getprev"            lib "xml"
declare sub     ::SetPrev      alias "setprev"            lib "xml"
declare sub     ::GetParent    alias "getparent"          lib "xml"
declare sub     ::SetParent    alias "setparent"          lib "xml"
declare sub     ::SetProp      alias "sbxmlSetProp"       lib "xml"
declare sub     ::GetProp      alias "sbxmlGetProp"       lib "xml"
declare sub     ::NewNs        alias "sbxmlNewNs"         lib "xml"
declare sub     ::FreeNs       alias "sbxmlFreeNs"        lib "xml"
declare sub     ::NewChild     alias "sbxmlNewChild"      lib "xml"
declare sub     ::NewTextChild alias "sbxmlNewTextChild"  lib "xml"
declare sub     ::NewDocNode   alias "sbxmlNewDocNode"    lib "xml"
declare sub     ::Doc2XML      alias "sbxmlDocDumpMemory" lib "xml"

end module

--- End code ---

The XML extension module was released in 2.0 but only with a minimal function interface and documentation.

http://xmlsoft.org/

If you find some time to expand the XML extension module to cover more of the libxml2 API, please share.

votan:
Yes, already took a look at the source... but am not so good in C....
Problem is that I can'T find out the exact syntax to get an XML node by it's name...
For example... my xml file looks like:
<stufflist>
<stuff_test>This is a test!</stuff_test>
<stuff_test2>And this is another test!</stuff_test2>
</stufflist>

Now I need to get the right command with the right syntax to fetch the text content of <stuff_test2>

Maybe you know the syntax?

Support:
As mentioned before, XML support is a first cut effort and seeing there is no working example programs I know of, looks like your pretty much on your own. Maybe someone else on the forum has used this extension module and can help you out.

Use the libxml2 link I posted and find the corresponding functions indicated by the alias function name in their docs. This should give your the required arguments and types. The interface.c file for the XML extension module should be easy enough to understand to get the functions in place working under scriba/sbhttpd.

Good luck and if you get something working please share.

If I find some time, I'll try and document what is there and create an example to get started with.

If I remember correctly, Armando wrote a quick SB XML program to test the module for the 2.1 release. Maybe he still has it floating around.

votan:
Just talked to Armando, but he said he also asked you for an XML example a longer time ago, but never heared back from you.
So seem that you are the only one who can help with the XML module...
BTW... using print xml::GetProp("text","name","node") kills the server service under windows ....
For you it's propably just a short look at the source of the module to see how the commands need to be used!?
Would be cool if you could look at it...

Navigation

[0] Message Index

[#] Next page

Go to full version