PureXML ( PB3.93 and PB4 )
Posted: Tue Mar 01, 2005 5:00 am
Good news...
I share a new userlibrary i made to parse XML file as easy as possible.
You can download it here :
http://www.penguinbyte.com/apps/pbwebst ... ureXML.zip
And here is the help file :
It is beta state - So please report bugs...
Best regards.
I share a new userlibrary i made to parse XML file as easy as possible.
You can download it here :
http://www.penguinbyte.com/apps/pbwebst ... ureXML.zip
And here is the help file :
Code: Select all
----------------------------------------------------------------------
Name PureXML
Version 1.0 Beta
Date Feb. 2005
Descr. A Purebasic XML Userlibrary based on the 'xmlparser.dll'
Written by Philippe Carpentier - flype@altern.org
Compil. Compiled with Purebasic 3.93 Beta 3
UserLibrary made with TailBite 1.2 Beta 2
Tested on Windows 98, 2000, XP
Requir. You must place the xmlparser.dll in same directory
----------------------------------------------------------------------
Main functions :
Result.b = PureXML_ParseFile(xmlFile.s)
Result.b = PureXML_ParseString(xmlString.s)
Result.s = PureXML_LastError()
The goal of this UserLib is two read XML data from
a file or from a string. Here are the functions :-)
----------------------------------------------------------------------
Callback functions ( no return value ) :
PureXML_SetOpenHandler(*funcPtr.l)
PureXML_SetCloseHandler(*funcPtr.l)
PureXML_SetDataHandler(*funcPtr.l)
PureXML_SetCommentHandler(*funcPtr.l)
PureXML_SetInvalidHandler(*funcPtr.l)
You should set those functions to catch XML events.
Then you can easily process what you need for each tag name.
;-
Procedure MyXML_o()
debug PureXML_Name()
EndProcedure
PureXML_SetOpenHandler(@MyXML_o)
;-
----------------------------------------------------------------------
Properties functions :
Result.s = PureXML_Name()
Result.s = PureXML_Data()
Result.s = PureXML_Attr(attrName.s)
This help you process data from XML tags.
An example :
<software id='0' name='purebasic'>
A great 'not so basic' language
</software>
PureXML_Name() >>> "software"
PureXML_Data() >>> " A great 'not so basic' language"
PureXML_Attr("id") >>> "0"
PureXML_Attr("name") >>> "purebasic"
----------------------------------------------------------------------
Have fun
flype - 2005
Best regards.