xml.bi | |
License | Copyright © 2009, FreeBASIC Extended Library Development Group |
Macros | |
FBEXT_XML_IS_WHITESPACE | returns true if character is a whitespace character. |
ext.xml | |
Enumerations | |
char | Contains the ASCII characters that are special or must be escaped in XML. |
Functions | |
encode_entities | Encodes special characters in a string to their proper form. |
decode_entities | Decodes special characters in a string to their standard form. |
encode_utf8 | Encodes a UTF-8 character to its string representation. |
decode_utf8 | Decodes a UTF-8 character from its string representation. |
Enumerations | |
node_type_e | Represents the different types of nodes supported. |
node | Child XML class, branch and leaf nodes. |
Variables | |
tag | Contains this child’s tag name |
Functions | |
node_type | Access the type of the node. |
Properties | |
attribute | Access the value of an attribute of the node. |
attribute | Set the value of an attribute of this node. |
getText | Returns the value of a Text element. |
setText | Sets the value of a Text element. |
Functions | |
children | Count the number of child nodes. |
children | Count the number of child nodes with a specific tag. |
children | Count the number of child nodes with a specific type. |
child | Access a specific child of this node. |
child | Access a specific child of this node by tag. |
child | Access a specific child of this node by type. |
last_child | Access the child with the highest integer index. |
appendChild | Add a child onto this node. |
remove_child | Remove a child from this node. |
remove_child | Remove a child from this node by tag. |
remove_child | Remove a child from this node by type. |
Parent( ) as node ptr | |
tree | Base XML class, node is a sub-class of this class. |
Variables | |
root | Used to access the XML document structure. |
Functions | |
load | Loads a XML data structure from a file. |
unload | Unloads a XML data structure to a file |
Copyright © 2009, FreeBASIC Extended Library Development Group
Distributed under the FreeBASIC Extended Library Group license. See accompanying file LICENSE.txt or copy at http://code.google.com- /p- /fb-extended-lib- /wiki- /License
Enumerations | |
char | Contains the ASCII characters that are special or must be escaped in XML. |
Functions | |
encode_entities | Encodes special characters in a string to their proper form. |
decode_entities | Decodes special characters in a string to their standard form. |
encode_utf8 | Encodes a UTF-8 character to its string representation. |
decode_utf8 | Decodes a UTF-8 character from its string representation. |
Enumerations | |
node_type_e | Represents the different types of nodes supported. |
declare function decode_utf8( byval src as zstring ptr, byref u as integer ) as integer
Decodes a UTF-8 character from its string representation.
src | zstring ptr containing the encoded UTF-8 character. |
u | integer representation of the encoded UTF-8 character is returned via this parameter. |
integer, the number of characters the UTF-8 character occupied while encoded.
Child XML class, branch and leaf nodes.
Supports casting to string to print out XML data of the node and its children.
Variables | |
tag | Contains this child’s tag name |
Functions | |
node_type | Access the type of the node. |
Properties | |
attribute | Access the value of an attribute of the node. |
attribute | Set the value of an attribute of this node. |
getText | Returns the value of a Text element. |
setText | Sets the value of a Text element. |
Functions | |
children | Count the number of child nodes. |
children | Count the number of child nodes with a specific tag. |
children | Count the number of child nodes with a specific type. |
child | Access a specific child of this node. |
child | Access a specific child of this node by tag. |
child | Access a specific child of this node by type. |
last_child | Access the child with the highest integer index. |
appendChild | Add a child onto this node. |
remove_child | Remove a child from this node. |
remove_child | Remove a child from this node by tag. |
remove_child | Remove a child from this node by type. |
Parent( ) as node ptr |
declare function appendChild( byref tag as const string, byval node_type as node_type_e = element ) as node ptr
Add a child onto this node.
tag | tag to give new child. |
node_type | optional type of node to create, defaults to element. |
node ptr of the new child, not needed for normal usage.
returns true if character is a whitespace character.
#define FBEXT_XML_IS_WHITESPACE( c ) ((c) = &h09 or (c) = &h0a or (c) = &h0d or (c) = &h20)
Encodes special characters in a string to their proper form.
declare function encode_entities( byref text as const string ) as string
Decodes special characters in a string to their standard form.
declare function decode_entities( byref text as const string ) as string
Encodes a UTF-8 character to its string representation.
declare function encode_utf8( byval u as integer ) as zstring ptr
Decodes a UTF-8 character from its string representation.
declare function decode_utf8( byval src as zstring ptr, byref u as integer ) as integer
Contains this child’s tag name
as string tag
Access the type of the node.
declare function nodeType() as node_type_e
Access the value of an attribute of the node.
declare property attribute( byref attribute as const string ) as string
Returns the value of a Text element.
declare property getText( ) as string
Sets the value of a Text element.
declare property setText( byref text_ as const string )
Count the number of child nodes.
declare function children() as integer
Access a specific child of this node.
declare function child( byval index as integer = 0 ) as node ptr
Add a child onto this node.
declare function appendChild( byref tag as const string, byval node_type as node_type_e = element ) as node ptr
Used to access the XML document structure.
as node ptr root
Loads a XML data structure from a file.
declare function load( byref xmlfile as const string ) as integer
Unloads a XML data structure to a file
declare function unload( byref xmlfile as const string ) as integer