From 21cdbb457cd2fe98a8445db0457bd65503ffa9ab Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 3 Jan 2011 04:38:06 +0000 Subject: [PATCH] Update separate files docos and search stuff. --- www/docfiles/advanced.html | 37 +-- www/docfiles/basics.html | 201 +++++++++---- www/docfiles/index.html | 83 +++--- www/docfiles/install.html | 6 +- www/docfiles/intro.html | 12 +- www/docfiles/license.html | 33 +-- www/docfiles/mxmldoc.html | 10 +- www/docfiles/reference.html | 576 +++++++++++++++++++++++------------- www/docfiles/relnotes.html | 61 ++-- www/docfiles/schema.html | 10 +- www/documentation.php | 2 +- 11 files changed, 651 insertions(+), 380 deletions(-) diff --git a/www/docfiles/advanced.html b/www/docfiles/advanced.html index 8cf2a90..1796695 100644 --- a/www/docfiles/advanced.html +++ b/www/docfiles/advanced.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -76,7 +76,7 @@ MXML_REAL, or MXML_TEXT. The function is called after type = mxmlElementGetAttr(node, "type"); if (type == NULL) - type = node->value.element.name; + type = mxmlGetElement(node); if (!strcmp(type, "integer")) return (MXML_INTEGER); @@ -127,7 +127,7 @@ MXML_WS_BEFORE_CLOSE, or MXML_WS_AFTER_CLOSE. The callback * just common HTML elements... */ - name = node->value.element.name; + name = mxmlGetElement(node); if (!strcmp(name, "html") || !strcmp(name, "head") || @@ -291,8 +291,7 @@ MXML_WS_BEFORE_CLOSE, or MXML_WS_AFTER_CLOSE. The callback * function pointers... */ - node->value.custom.data = dt; - node->value.custom.destroy = free; + mxmlSetCustom(node, data, destroy); /* * Return with no errors... @@ -306,6 +305,8 @@ MXML_WS_BEFORE_CLOSE, or MXML_WS_AFTER_CLOSE. The callback contain a void pointer to the allocated custom data for the node and a pointer to a destructor function which will free the custom data when the node is deleted.

+ +

The save callback receives the node pointer and returns an allocated string containing the custom data value. The following save callback could be used for our ISO date/time type:

@@ -317,7 +318,7 @@ MXML_WS_BEFORE_CLOSE, or MXML_WS_AFTER_CLOSE. The callback iso_date_time_t *dt; - dt = (iso_date_time_t *)node->custom.data; + dt = (iso_date_time_t *)mxmlGetCustom(node); snprintf(data, sizeof(data), "%04u-%02u-%02uT%02u:%02u:%02uZ", @@ -512,7 +513,7 @@ mxmlIndexEnum.

* Retain headings and titles... */ - char *name = node->value.element.name; + char *name = mxmlGetElement(node); if (!strcmp(name, "html") || !strcmp(name, "head") || @@ -528,15 +529,17 @@ mxmlIndexEnum.

} else if (event == MXML_SAX_DIRECTIVE) mxmlRetain(node); - else if (event == MXML_SAX_DATA && - node->parent->ref_count > 1) + else if (event == MXML_SAX_DATA) { - /* - * If the parent was retained, then retain - * this data node as well. - */ + if (mxmlGetRefCount(mxmlGetParent(node)) > 1) + { + /* + * If the parent was retained, then retain + * this data node as well. + */ - mxmlRetain(node); + mxmlRetain(node); + } } } @@ -564,9 +567,9 @@ mxmlIndexEnum.

if (body) { - for (heading = body->child; + for (heading = mxmlGetFirstChild(body); heading; - heading = heading->next) + heading = mxmlGetNextSibling(heading)) print_children(heading); } diff --git a/www/docfiles/basics.html b/www/docfiles/basics.html index aa0f976..c3e3521 100644 --- a/www/docfiles/basics.html +++ b/www/docfiles/basics.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -39,7 +39,7 @@ hspace="10" src="2.gif" width="100">Getting Started with Mini-XML
  • Writing of UTF-8 encoded XML files and strings.
  • Support for arbitrary element names, attributes, and attribute values with no preset limits, just available memory.
  • -
  • Support for integer, real, opaque ("cdata"), and text data types in +
  • Support for integer, real, opaque ("CDATA"), and text data types in "leaf" nodes.
  • "Find", "index", and "walk" functions for easily accessing data in an XML document.
  • @@ -66,50 +66,14 @@ hspace="10" src="2.gif" width="100">Getting Started with Mini-XML pkg-config --libs mxml ENTER

    Nodes

    -

    Every piece of information in an XML file (elements, text, numbers) - is stored in memory in "nodes". Nodes are defined by the -mxml_node_t structure. The -type member defines the node type (element, integer, - opaque, real, or text) which determines which value you want to look at - in the value union.

    - - -
    - - - - - - - - - -
    Table 2-1: Mini-XML Node Value - Members
    ValueTypeNode member
    Customvoid * -node->value.custom.data
    Elementchar * -node->value.element.name
    Integerintnode->value.integer -
    Opaque (string)char * -node->value.opaque
    Realdoublenode->value.real
    Textchar *node->value.text.string -
    -
    -

    Each node also has a user_data member which allows you to - associate application-specific data with each node as needed.

    -

    New nodes are created using the -mxmlNewElement, -mxmlNewInteger, -mxmlNewOpaque, -mxmlNewReal, -mxmlNewText -mxmlNewTextf mxmlNewXML - functions. Only elements can have child nodes, and the top node - must be an element, usually the <?xml version="1.0"?> node - created by mxmlNewXML().

    -

    Nodes have pointers to the node above (parent), below ( -child), left (prev), and right (next) of the - current node. If you have an XML file like the following:

    +

    Every piece of information in an XML file is stored in memory in + "nodes". Nodes are defined by the +mxml_node_t structure. Each node has a typed value, optional + user data, a parent node, sibling nodes (previous and next), and + potentially child nodes.

    +

    For example, if you have an XML file like the following:

    -    <?xml version="1.0"?>
    +    <?xml version="1.0" encoding="utf-8"?>
         <data>
             <node>val1</node>
             <node>val2</node>
    @@ -125,7 +89,7 @@ child), left (prev), and right (next) of the
     

    the node tree for the file would look like the following in memory:

    -    ?xml
    +    ?xml version="1.0" encoding="utf-8"?
           |
         data
           |
    @@ -137,15 +101,100 @@ child), left (prev), and right (next) of the
                                |      |      |
                              val4   val5   val6
     
    -

    where "-" is a pointer to the next node and "|" is a pointer to the - first child node.

    -

    Once you are done with the XML data, use the -mxmlDelete function to recursively free the memory that is - used for a particular node or the entire tree:

    -
    -    mxmlDelete(tree);
    -
    +

    where "-" is a pointer to the sibling node and "|" is a pointer to + the first child or parent node.

    +

    The mxmlGetType + function gets the type of a node, one of MXML_CUSTOM, +MXML_ELEMENT, MXML_INTEGER, MXML_OPAQUE, +MXML_REAL, or MXML_TEXT. The parent and sibling nodes are + accessed using the +mxmlGetParent, mxmlGetNext, + and mxmlGetPrevious functions. + The mxmlGetUserData + function gets any user data associated with the node.

    +

    CDATA Nodes

    +

    CDATA (MXML_ELEMENT) nodes are created using the +mxmlNewCDATA function. The +mxmlGetCDATA function retrieves the CDATA string pointer + for a node.

    +
    Note: +

    CDATA nodes are currently stored in memory as special elements. This + will be changed in a future major release of Mini-XML.

    +
    +

    Custom Nodes

    +

    Custom (MXML_CUSTOM) nodes are created using the +mxmlNewCustom function or using a custom load callback + specified using the +mxmlSetCustomHandlers function. The +mxmlGetCustom function retrieves the custom value pointer + for a node.

    +

    Comment Nodes

    +

    Comment (MXML_ELEMENT) nodes are created using the +mxmlNewElement function. The +mxmlGetElement function retrieves the comment string + pointer for a node, including the surrounding "!--" and "--" + characters.

    +
    Note: +

    Comment nodes are currently stored in memory as special elements. + This will be changed in a future major release of Mini-XML.

    +
    +

    Element Nodes

    +

    Element (MXML_ELEMENT) nodes are created using the +mxmlNewElement function. The +mxmlGetElement function retrieves the element name, the +mxmlElementGetAttr function retrieves the value string for + a named attribute associated with the element, and the +mxmlGetFirstChild and +mxmlGetLastChild functions retrieve the first and last + child nodes for the element, respectively.

    +

    Integer Nodes

    +

    Integer (MXML_INTEGER) nodes are created using the +mxmlNewInteger function. The +mxmlGetInteger function retrieves the integer value for a + node.

    +

    Opaque Nodes

    +

    Opaque (MXML_OPAQUE) nodes are created using the +mxmlNewOpaque function. The +mxmlGetOpaque function retrieves the opaque string pointer + for a node. Opaque nodes are like string nodes but preserve all + whitespace between nodes.

    +

    Text Nodes

    +

    Text (MXML_TEXT) nodes are created using the +mxmlNewText and +mxmlNewTextf functions. Each text node consists of a text + string and (leading) whitespace value - the +mxmlGetText function retrieves the text string pointer and + whitespace value for a node.

    + + +

    Processing Instruction Nodes

    +

    Processing instruction (MXML_ELEMENT) nodes are created + using the mxmlNewElement + function. The +mxmlGetElement function retrieves the processing instruction + string for a node, including the surrounding "?" characters.

    +
    Note: +

    Processing instruction nodes are currently stored in memory as + special elements. This will be changed in a future major release of + Mini-XML.

    +
    +

    Real Number Nodes

    +

    Real number (MXML_REAL) nodes are created using the +mxmlNewReal function. The +mxmlGetReal function retrieves the CDATA string pointer for + a node.

    + +

    XML Declaration Nodes

    +

    XML declaration (MXML_ELEMENT) nodes are created using the mxmlNewXML function. The mxmlGetElement + function retrieves the XML declaration string for a node, including the + surrounding "?" characters.

    +
    Note: +

    XML declaration nodes are currently stored in memory as special + elements. This will be changed in a future major release of Mini-XML.

    +

    Creating XML Documents

    You can create and update XML documents in memory using the various @@ -182,9 +231,11 @@ mxmlNew functions. The following code will create the XML document node = mxmlNewElement(data, "node"); mxmlNewText(node, 0, "val8"); -

    We start by creating the <?xml version="1.0"?> node common - to all XML files using the -mxmlNewXML function:

    + + +

    We start by creating the declaration node common to all XML files + using the mxmlNewXML + function:

         xml = mxmlNewXML("1.0");
     
    @@ -208,7 +259,7 @@ mxmlNewText functions. The first argument of mxmlNewText

    The resulting in-memory XML document can then be saved or processed just like one loaded from disk or a string.

    - +

    Loading XML

    You load an XML file using the mxmlLoadFile function:

    @@ -256,7 +307,7 @@ mxmlLoadFile(). The second argument specifies the string or character buffer to load and must be a complete XML document including the ?xml element if the parent node is NULL.

    - +

    Saving XML

    You save an XML file using the mxmlSaveFile function:

    @@ -297,6 +348,8 @@ mxmlSaveFile(). The mxmlSaveString function takes pointer and size arguments for saving the XML document to a fixed-size buffer, while mxmlSaveAllocString() returns a string buffer that was allocated using malloc().

    + +

    Controlling Line Wrapping

    When saving XML documents, Mini-XML normally wraps output lines at column 75 so that the text is readable in terminal windows. The @@ -309,9 +362,23 @@ mxmlSaveFile(). The mxmlSaveString function takes pointer /* Disable wrapping */ mxmlSetWrapMargin(0); +

    Memory Management

    +

    Once you are done with the XML data, use the +mxmlDelete function to recursively free the memory that is + used for a particular node or the entire tree:

    +
    +    mxmlDelete(tree);
    +
    +

    You can also use reference counting to manage memory usage. The +mxmlRetain and +mxmlRelease functions increment and decrement a node's use + count, respectively. When the use count goes to 0, mxmlRelease + will automatically call mxmlDelete to actually free the memory + used by the node tree. New nodes automatically start with a use count + of 1.

    -

    Finding and Iterating Nodes

    +

    Finding and Iterating Nodes

    The mxmlWalkPrev and mxmlWalkNext functions can be used to iterate through the XML node tree:

    @@ -433,6 +500,18 @@ functions can be used to iterate through the XML node tree:

    the order would be reversed, ending at "?xml".

    +

    Finding Specific Nodes

    +

    You can find specific nodes in the tree using the +mxmlFindPath, for example:

    +
    +    mxml_node_t *value;
    +
    +    value = mxmlFindPath(tree, "path/to/*/foo/bar");
    +
    +

    The second argument is a "path" to the parent node. Each component of + the path is separated by a slash (/) and represents a named element in + the document tree or a wildcard (*) path representing 0 or more + intervening nodes.


    Contents Previous diff --git a/www/docfiles/index.html b/www/docfiles/index.html index 0e90a95..357fb88 100644 --- a/www/docfiles/index.html +++ b/www/docfiles/index.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -47,7 +47,20 @@ A { text-decoration: none } Getting Started with Mini-XML -
  • Finding and Iterating Nodes
  • +
  • Memory Management
  • +
  • Finding and Iterating Nodes
  • +
  • Finding Specific Nodes
  • More Mini-XML Programming Techniques @@ -101,35 +116,52 @@ A { text-decoration: none }
  • mxmlEntityRemoveCallback
  • mxmlFindElement
  • +
  • mxmlFindPath
  • +
  • mxmlGetCDATA
  • +
  • mxmlGetCustom
  • +
  • mxmlGetElement
  • +
  • mxmlGetFirstChild
  • +
  • mxmlGetInteger
  • +
  • mxmlGetLastChild
  • +
  • mxmlGetNextSibling
  • +
  • mxmlGetOpaque
  • +
  • mxmlGetParent
  • +
  • mxmlGetPrevSibling
  • +
  • mxmlGetReal
  • +
  • mxmlGetRefCount
  • +
  • mxmlGetText
  • +
  • mxmlGetType
  • +
  • mxmlGetUserData
  • mxmlIndexDelete
  • mxmlIndexEnum
  • mxmlIndexFind
  • +
  • mxmlIndexGetCount
  • mxmlIndexNew
  • mxmlIndexReset
  • mxmlLoadFd
  • mxmlLoadFile
  • mxmlLoadString
  • -
  • mxmlNewCDATA
  • -
  • mxmlNewCustom
  • +
  • mxmlNewCDATA
  • +
  • mxmlNewCustom
  • mxmlNewElement
  • mxmlNewInteger
  • mxmlNewOpaque
  • mxmlNewReal
  • mxmlNewText
  • mxmlNewTextf
  • -
  • mxmlNewXML
  • -
  • mxmlRelease
  • +
  • mxmlNewXML
  • +
  • mxmlRelease
  • mxmlRemove
  • -
  • mxmlRetain
  • -
  • mxmlSAXLoadFd
  • -
  • mxmlSAXLoadFile
  • -
  • mxmlSAXLoadString
  • +
  • mxmlRetain
  • +
  • mxmlSAXLoadFd
  • +
  • mxmlSAXLoadFile
  • +
  • mxmlSAXLoadString
  • mxmlSaveAllocString
  • mxmlSaveFd
  • mxmlSaveFile
  • mxmlSaveString
  • -
  • mxmlSetCDATA
  • -
  • mxmlSetCustom
  • +
  • mxmlSetCDATA
  • +
  • mxmlSetCustom
  • mxmlSetCustomHandlers
  • mxmlSetElement
  • @@ -140,22 +172,20 @@ mxmlEntityRemoveCallback
  • mxmlSetReal
  • mxmlSetText
  • mxmlSetTextf
  • -
  • mxmlSetWrapMargin
  • +
  • mxmlSetUserData
  • +
  • mxmlSetWrapMargin
  • mxmlWalkNext
  • mxmlWalkPrev
  • Data Types -
  • -
  • Structures - -
  • -
  • Unions -
  • Constants diff --git a/www/docfiles/install.html b/www/docfiles/install.html index 70ac246..25e07a3 100644 --- a/www/docfiles/install.html +++ b/www/docfiles/install.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -92,7 +92,7 @@ rpmbuild(8) software to create Red Hat Package Manager ("RPM") epm(1) program to create software packages in a variety of formats. The epm program is available from the following URL:

    -    http://www.easysw.com/epm/
    +    http://www.epmhome.org/
     

    Use the make command with the epm target to create portable and native packages for your system:

    diff --git a/www/docfiles/intro.html b/www/docfiles/intro.html index a984d66..865c6b8 100644 --- a/www/docfiles/intro.html +++ b/www/docfiles/intro.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -28,7 +28,7 @@ A { text-decoration: none }

    0Introduction

    -

    This programmers manual describes Mini-XML version 2.6, a small XML +

    This programmers manual describes Mini-XML version 2.7, a small XML parsing library that you can use to read and write XML data files in your C and C++ applications.

    Mini-XML was initially developed for the @@ -48,12 +48,12 @@ libxml2 library with something substantially smaller and libxml2.

    Thanks to lots of feedback and support from various developers, Mini-XML has evolved since then to provide a more complete XML - implementation and now stands at a whopping 3,441 lines of code, + implementation and now stands at a whopping 3,965 lines of code, compared to 103,893 lines of code for libxml2 version 2.6.9.

    Aside from Gutenprint, Mini-XML is used for the following projects/software applications:

    Please email me (mxml @ easysw . com) if you would like your project @@ -165,7 +165,7 @@ libxml2 library with something substantially smaller and

    Legal Stuff

    -

    The Mini-XML library is copyright 2003-2009 by Michael Sweet. License +

    The Mini-XML library is copyright 2003-2011 by Michael Sweet. License terms are described in Appendix A - Mini-XML License.


    diff --git a/www/docfiles/license.html b/www/docfiles/license.html index 090cf5c..7d526fd 100644 --- a/www/docfiles/license.html +++ b/www/docfiles/license.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -31,24 +31,21 @@ A { text-decoration: none }

    AMini-XML License

    The Mini-XML library and included programs are provided under the - terms of the GNU Library General Public License (LGPL) with the - following exceptions:

    -
      -
    1. Static linking of applications to the Mini-XML library does not - constitute a derivative work and does not require the author to provide - source code for the application, use the shared Mini-XML libraries, or - link their applications against a user-supplied version of Mini-XML. + terms of the GNU Library General Public License version 2 (LGPL2) with + the following exceptions:

      +

      1. Static linking of applications to the Mini-XML library does + not constitute a derivative work and does not require the author to + provide source code for the application, use the shared Mini-XML + libraries, or link their applications against a user-supplied version + of Mini-XML.

      If you link the application to a modified version of Mini-XML, then the changes to Mini-XML must be provided under the terms of the - LGPL in sections 1, 2, and 4.

      -
    2. -
    3. You do not have to provide a copy of the Mini-XML license with - programs that are linked to the Mini-XML library, nor do you have to - identify the Mini-XML license in your program or documentation as - required by section 6 of the LGPL.
    4. -
    - - + LGPL2 in sections 1, 2, and 4.

    +

    2. You do not have to provide a copy of the Mini-XML license + with programs that are linked to the Mini-XML library, nor do you have + to identify the Mini-XML license in your program or documentation as + required by section 6 of the LGPL2.

    +

     

    GNU LIBRARY GENERAL PUBLIC LICENSE

    Version 2, June 1991
    Copyright (C) 1991 Free Software Foundation, Inc. diff --git a/www/docfiles/mxmldoc.html b/www/docfiles/mxmldoc.html index 3683ad2..a799343 100644 --- a/www/docfiles/mxmldoc.html +++ b/www/docfiles/mxmldoc.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -89,7 +89,7 @@ hspace="10" src="4.gif" width="100">Using the mxmldoc Utility will document all public names it finds in your source files - any names starting with the underscore character (_) or names that are documented with the @private@ directive are - treated as private and are undocumented.

    + treated as private and are not documented.

    Comments appearing directly before a function or type definition are used to document that function or type. Comments appearing after argument, definition, return type, or variable declarations are used to @@ -144,8 +144,8 @@ hspace="10" src="4.gif" width="100">Using the mxmldoc Utility included in the documentation

  • @since ...@ - flags the item as new since a particular release. The text following the @since up to the closing @ - is highlighted in the generated documentation, e.g. @since CUPS - 1.3@.
  • + is highlighted in the generated documentation, e.g. @since Mini-XML + 2.7@. diff --git a/www/docfiles/reference.html b/www/docfiles/reference.html index 866909d..e5d51ac 100644 --- a/www/docfiles/reference.html +++ b/www/docfiles/reference.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -56,12 +56,45 @@ mxmlEntityGetValue mxmlEntityRemoveCallback
  • mxmlFindElement
  • +
  • +mxmlFindPath
  • +
  • +mxmlGetCDATA
  • +
  • +mxmlGetCustom
  • +
  • +mxmlGetElement
  • +
  • +mxmlGetFirstChild
  • +
  • +mxmlGetInteger
  • +
  • +mxmlGetLastChild
  • +
  • +mxmlGetNextSibling
  • +
  • +mxmlGetOpaque
  • +
  • mxmlGetParent +
  • +
  • +mxmlGetPrevSibling
  • +
  • +mxmlGetReal
  • +
  • +mxmlGetRefCount
  • +
  • +mxmlGetText
  • +
  • mxmlGetType
  • +
  • +mxmlGetUserData
  • mxmlIndexDelete
  • mxmlIndexEnum
  • mxmlIndexFind
  • +
  • +mxmlIndexGetCount
  • mxmlIndexNew
  • mxmlIndexReset
  • @@ -99,7 +132,7 @@ mxmlSAXLoadFd mxmlSAXLoadFile
  • mxmlSAXLoadString
  • -
  • +
  • mxmlSaveAllocString
  • mxmlSaveFd
  • @@ -127,7 +160,9 @@ mxmlSetReal mxmlSetText
  • mxmlSetTextf
  • -
  • +
  • +mxmlSetUserData
  • +
  • mxmlSetWrapMargin
  • mxmlWalkNext
  • @@ -137,18 +172,12 @@ mxmlWalkPrev
  • Data Types -
  • -
  • Structures - -
  • -
  • Unions -
  • Constants @@ -410,6 +419,291 @@ mxmlEntityRemoveCallback and MXML_NO_DESCEND to find additional direct descendents of the node. The top node argument constrains the search to a particular node's children.

    +

    + + Mini-XML 2.7 mxmlFindPath

    +

    Find a node with the given path.

    +

    mxml_node_t *mxmlFindPath ( +
        mxml_node_t *top, +
        const char *path +
    );

    +

    Parameters

    +
    +
    top
    +
    Top node
    +
    path
    +
    Path to element
    +
    +

    Return Value

    +

    Found node or NULL

    +

    Discussion

    +

    The "path" is a slash-separated list of element + names. The name "*" is considered a wildcard for one or more levels of + elements. For example, "foo/one/two", "bar/two/one", "*/one", and so + forth. +
    +
    The first child node of the found node is returned if the given + node has children and the first child is a value node.

    +

    + + Mini-XML 2.7 mxmlGetCDATA

    +

    Get the value for a CDATA node.

    +

    const char *mxmlGetCDATA ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    CDATA value or NULL

    +

    Discussion

    +

    NULL is returned if the node is not a + CDATA element.

    +

    + + Mini-XML 2.7 mxmlGetCustom

    +

    Get the value for a custom node.

    +

    const void *mxmlGetCustom ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Custom value or NULL

    +

    Discussion

    +

    NULL is returned if the node (or its + first child) is not a custom value node.

    +

    + + Mini-XML 2.7 mxmlGetElement

    +

    Get the name for an element node.

    +

    const char *mxmlGetElement ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Element name or NULL

    +

    Discussion

    +

    NULL is returned if the node is not + an element node.

    +

    + + Mini-XML 2.7 mxmlGetFirstChild

    +

    Get the first child of an element node.

    +

    mxml_node_t + *mxmlGetFirstChild ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    First child or NULL

    +

    Discussion

    +

    NULL is returned if the node is not + an element node or if the node has no children.

    +

    + + Mini-XML 2.7 mxmlGetInteger

    +

    Get the integer value from the specified node or + its first child.

    +

    int mxmlGetInteger ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Integer value or 0

    +

    Discussion

    +

    0 is returned if the node (or its first child) is + not an integer value node.

    +

    + + Mini-XML 2.7 mxmlGetLastChild

    +

    Get the last child of an element node.

    +

    mxml_node_t + *mxmlGetLastChild ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Last child or NULL

    +

    Discussion

    +

    NULL is returned if the node is not + an element node or if the node has no children.

    +

    mxmlGetNextSibling

    +

    Return the node type...

    +

    mxml_node_t + *mxmlGetNextSibling ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Get the next node for the current parent.

    +

    NULL is returned if this is the last + child for the current parent.

    +

    + + Mini-XML 2.7 mxmlGetOpaque

    +

    Get an opaque string value for a node or its + first child.

    +

    const char *mxmlGetOpaque ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Opaque string or NULL

    +

    Discussion

    +

    NULL is returned if the node (or its + first child) is not an opaque value node.

    +

    + + Mini-XML 2.7 mxmlGetParent

    +

    Get the parent node.

    +

    mxml_node_t *mxmlGetParent ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Parent node or NULL

    +

    Discussion

    +

    NULL is returned for a root node.

    +

    + + Mini-XML 2.7 mxmlGetPrevSibling

    +

    Get the previous node for the current parent.

    +

    mxml_node_t + *mxmlGetPrevSibling ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Previous node or NULL

    +

    Discussion

    +

    NULL is returned if this is the first + child for the current parent.

    +

    + + Mini-XML 2.7 mxmlGetReal

    +

    Get the real value for a node or its first child.

    +

    double mxmlGetReal ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Real value or 0.0

    +

    Discussion

    +

    0.0 is returned if the node (or its first child) + is not a real value node.

    +

    + + Mini-XML 2.7 mxmlGetRefCount

    +

    Get the current reference (use) count for a node.

    +

    int mxmlGetRefCount ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node
    +
    +

    Return Value

    +

    Reference count

    +

    Discussion

    +

    The initial reference count of new nodes is 1. Use + the mxmlRetain and +mxmlRelease functions to increment and decrement a + node's reference count. .

    +

    + + Mini-XML 2.7 mxmlGetText

    +

    Get the text value for a node or its first child.

    +

    const char *mxmlGetText ( +
        mxml_node_t *node, +
        int *whitespace +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    whitespace
    +
    1 if string is preceded by whitespace, 0 + otherwise
    +
    +

    Return Value

    +

    Text string or NULL

    +

    Discussion

    +

    NULL is returned if the node (or its + first child) is not a text node. The "whitespace" argument can be NULL.

    +

    + + Mini-XML 2.7 mxmlGetType

    +

    Get the node type.

    +

    mxml_type_t mxmlGetType ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    Type of node

    +

    Discussion

    +

    MXML_IGNORE is returned if "node" is +NULL.

    +

    + + Mini-XML 2.7 mxmlGetUserData

    +

    Get the user data pointer for a node.

    +

    void *mxmlGetUserData ( +
        mxml_node_t *node +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to get
    +
    +

    Return Value

    +

    User data pointer

    mxmlIndexDelete

    Delete an index.

    void mxmlIndexDelete ( @@ -458,6 +752,20 @@ mxmlEntityRemoveCallback this function for the first time with a particular set of "element" and "value" strings. Passing NULL for both "element" and "value" is equivalent to calling mxmlIndexEnum().

    +

    + + Mini-XML 2.7 mxmlIndexGetCount

    +

    Get the number of nodes in an index.

    +

    int mxmlIndexGetCount ( +
        mxml_index_t *ind +
    );

    +

    Parameters

    +
    +
    ind
    +
    Index of nodes
    +
    +

    Return Value

    +

    Number of nodes in index

    mxmlIndexNew

    Create a new index.

    mxml_index_t *mxmlIndexNew @@ -588,7 +896,7 @@ mxmlEntityRemoveCallback
    The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK, MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading child nodes of the specified type.

    -

    +

     Mini-XML 2.3 mxmlNewCDATA

    Create a new CDATA node.

    @@ -611,7 +919,7 @@ mxmlEntityRemoveCallback

    to specify that the new CDATA node has no parent. The data string must be nul-terminated and is copied into the new node. CDATA nodes use the MXML_ELEMENT type.

    -

    +

     Mini-XML 2.1 mxmlNewCustom

    Create a new custom data node.

    @@ -770,7 +1078,7 @@ mxmlEntityRemoveCallback

    parameter is used to specify whether leading whitespace is present before the node. The format string must be nul-terminated and is formatted into the new node.

    -

    +

     Mini-XML 2.3 mxmlNewXML

    Create a new XML document tree.

    @@ -788,7 +1096,7 @@ mxmlEntityRemoveCallback

    The "version" argument specifies the version number to put in the ?xml element node. If NULL, version 1.0 is assumed.

    -

    +

     Mini-XML 2.3 mxmlRelease

    Release a node.

    @@ -819,7 +1127,7 @@ mxmlEntityRemoveCallback

    Does not free memory used by the node - use mxmlDelete() for that. This function does nothing if the node has no parent.

    -

    +

     Mini-XML 2.3 mxmlRetain

    Retain a node.

    @@ -833,7 +1141,7 @@ mxmlEntityRemoveCallback

    Return Value

    New reference count

    -

    +

     Mini-XML 2.3 mxmlSAXLoadFd

    Load a file descriptor into an XML node tree @@ -875,7 +1183,7 @@ mxmlEntityRemoveCallback


    The SAX callback must call mxmlRetain() for any nodes that need to be kept for later use. Otherwise, nodes are deleted when the parent node is closed or after each data, comment, CDATA, or directive node.

    -

    +

     Mini-XML 2.3 mxmlSAXLoadFile

    Load a file into an XML node tree using a SAX @@ -918,7 +1226,7 @@ mxmlEntityRemoveCallback


    The SAX callback must call mxmlRetain() for any nodes that need to be kept for later use. Otherwise, nodes are deleted when the parent node is closed or after each data, comment, CDATA, or directive node.

    -

    +

     Mini-XML 2.3 mxmlSAXLoadString

    Load a string into an XML node tree using a SAX @@ -963,7 +1271,7 @@ mxmlEntityRemoveCallback

    node is closed or after each data, comment, CDATA, or directive node.

    mxmlSaveAllocString

    -

    Save an XML node tree to an allocated string.

    +

    Save an XML tree to an allocated string.

    char *mxmlSaveAllocString (
        mxml_node_t *node,
        mxml_save_cb_t cb @@ -1068,7 +1376,7 @@ mxmlEntityRemoveCallback MXML_NO_CALLBACK is specified, whitespace will only be added before MXML_TEXT nodes with leading whitespace and before attribute names inside opening element tags.

    -

    +

     Mini-XML 2.3 mxmlSetCDATA

    Set the element name of a CDATA node.

    @@ -1088,7 +1396,7 @@ mxmlEntityRemoveCallback

    Discussion

    The node is not changed if it is not a CDATA element node.

    -

    +

     Mini-XML 2.1 mxmlSetCustom

    Set the data and destructor of a custom data @@ -1261,10 +1569,27 @@ mxmlSetCustomHandlers

    0 on success, -1 on failure

    Discussion

    The node is not changed if it is not a text node.

    -

    +

    + + Mini-XML 2.7 mxmlSetUserData

    +

    Set the user data pointer for a node.

    +

    int mxmlSetUserData ( +
        mxml_node_t *node, +
        void *data +
    );

    +

    Parameters

    +
    +
    node
    +
    Node to set
    +
    data
    +
    User data pointer
    +
    +

    Return Value

    +

    0 on success, -1 on failure

    +

     Mini-XML 2.3 mxmlSetWrapMargin

    -

    Set the the wrap margin when saving XML data.

    +

    Set the wrap margin when saving XML data.

    void mxmlSetWrapMargin (
        int column
    );

    @@ -1322,10 +1647,6 @@ mxmlSetCustomHandlers node's last child is considered to be the previous node. The top node argument constrains the walk to the node's children.

    Data Types

    -

    mxml_attr_t

    -

    An XML element attribute value.

    -

    typedef struct mxml_attr_s - mxml_attr_t;

    mxml_custom_destroy_cb_t

    Custom data destructor

    @@ -1340,16 +1661,6 @@ mxml_custom_save_cb_t

    Custom data save callback function

    typedef char *(*mxml_custom_save_cb_t)( mxml_node_t *);

    -

    - - Mini-XML 2.1 mxml_custom_t

    -

    An XML custom value.

    -

    typedef struct mxml_custom_s - mxml_custom_t;

    -

    mxml_element_t

    -

    An XML element value.

    -

    typedef struct mxml_element_s - mxml_element_t;

    mxml_entity_cb_t

    Entity callback function

    typedef int (*mxml_entity_cb_t)(const char *);

    @@ -1380,161 +1691,10 @@ mxml_node_t *, mxml_sax_event_t, void *);

    SAX event type.

    typedef enum mxml_sax_event_e mxml_sax_event_t;

    -

    mxml_text_t

    -

    An XML text value.

    -

    typedef struct mxml_text_s - mxml_text_t;

    mxml_type_t

    The XML node type.

    typedef enum mxml_type_e mxml_type_t;

    -

    mxml_value_t

    -

    An XML node value.

    -

    typedef union mxml_value_u - mxml_value_t;

    -

    Structures

    -

    mxml_attr_s

    -

    An XML element attribute value.

    -

    struct mxml_attr_s { -
        char *name; -
        char *value; -
    };

    -

    Members

    -
    -
    name
    -
    Attribute name
    -
    value
    -
    Attribute value
    -
    -

    - - Mini-XML 2.1 mxml_custom_s

    -

    An XML custom value.

    -

    struct mxml_custom_s { -
        void *data; -
        mxml_custom_destroy_cb_t - destroy; -
    };

    -

    Members

    -
    -
    data
    -
    Pointer to (allocated) custom data
    -
    destroy
    -
    Pointer to destructor function
    -
    -

    mxml_element_s

    -

    An XML element value.

    -

    struct mxml_element_s { -
        mxml_attr_t *attrs; -
        char *name; -
        int num_attrs; -
    };

    -

    Members

    -
    -
    attrs
    -
    Attributes
    -
    name
    -
    Name of element
    -
    num_attrs
    -
    Number of attributes
    -
    -

    mxml_index_s

    -

    An XML node index.

    -

    struct mxml_index_s { -
        int alloc_nodes; -
        char *attr; -
        int cur_node; -
        mxml_node_t **nodes; -
        int num_nodes; -
    };

    -

    Members

    -
    -
    alloc_nodes
    -
    Allocated nodes in index
    -
    attr
    -
    Attribute used for indexing or NULL
    -
    cur_node
    -
    Current node
    -
    nodes
    -
    Node array
    -
    num_nodes
    -
    Number of nodes in index
    -
    -

    mxml_node_s

    -

    An XML node.

    -

    struct mxml_node_s { -
        struct mxml_node_s *child; -
        struct mxml_node_s *last_child; -
        struct mxml_node_s *next; -
        struct mxml_node_s *parent; -
        struct mxml_node_s *prev; -
        int ref_count; -
        mxml_type_t type; -
        void *user_data; -
        mxml_value_t value; -
    };

    -

    Members

    -
    -
    child
    -
    First child node
    -
    last_child
    -
    Last child node
    -
    next
    -
    Next node under same parent
    -
    parent
    -
    Parent node
    -
    prev
    -
    Previous node under same parent
    -
    ref_count
    -
    Use count
    -
    type
    -
    Node type
    -
    user_data
    -
    User data
    -
    value
    -
    Node value
    -
    -

    mxml_text_s

    -

    An XML text value.

    -

    struct mxml_text_s { -
        char *string; -
        int whitespace; -
    };

    -

    Members

    -
    -
    string
    -
    Fragment string
    -
    whitespace
    -
    Leading whitespace?
    -
    -

    Unions

    -

    mxml_value_u

    -

    An XML node value.

    -

    union mxml_value_u { -
        mxml_custom_t custom; -
        mxml_element_t element; -
        int integer; -
        char *opaque; -
        double real; -
        mxml_text_t text; -
    };

    -

    Members

    -
    -
    custom - -  Mini-XML 2.1 
    -
    Custom data
    -
    element
    -
    Element
    -
    integer
    -
    Integer number
    -
    opaque
    -
    Opaque string
    -
    real
    -
    Real number
    -
    text
    -
    Text fragment
    -

    Constants

    mxml_sax_event_e

    SAX event type.

    diff --git a/www/docfiles/relnotes.html b/www/docfiles/relnotes.html index 6af7afd..4d34e95 100644 --- a/www/docfiles/relnotes.html +++ b/www/docfiles/relnotes.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -30,7 +30,26 @@ A { text-decoration: none }

    BRelease Notes

    -

    Changes in Mini-XML 2.6

    +

    Changes in Mini-XML 2.7

    + +

    Changes in Mini-XML 2.6

    -

    Changes in Mini-XML 2.5

    +

    Changes in Mini-XML 2.5

    -

    Changes in Mini-XML 2.4

    +

    Changes in Mini-XML 2.4

    -

    Changes in Mini-XML 2.3

    +

    Changes in Mini-XML 2.3

    -

    Changes in Mini-XML 2.2.2

    +

    Changes in Mini-XML 2.2.2

    -

    Changes in Mini-XML 2.2.1

    +

    Changes in Mini-XML 2.2.1

    -

    Changes in Mini-XML 2.2

    +

    Changes in Mini-XML 2.2

    -

    Changes in Mini-XML 2.1

    +

    Changes in Mini-XML 2.1

    -

    Changes in Mini-XML 2.0

    +

    Changes in Mini-XML 2.0

    -

    Changes in Mini-XML 1.3

    +

    Changes in Mini-XML 1.3

    -

    Changes in Mini-XML 1.2

    +

    Changes in Mini-XML 1.2

    -

    Changes in Mini-XML 1.1.2

    +

    Changes in Mini-XML 1.1.2

    -

    Changes in Mini-XML 1.1.1

    +

    Changes in Mini-XML 1.1.1

    -

    Changes in Mini-XML 1.1

    +

    Changes in Mini-XML 1.1

    -

    Changes in Mini-XML 1.0

    +

    Changes in Mini-XML 1.0

    -

    Changes in Mini-XML 0.93

    +

    Changes in Mini-XML 0.93

    -

    Changes in Mini-XML 0.92

    +

    Changes in Mini-XML 0.92

    -

    Changes in Mini-XML 0.91

    +

    Changes in Mini-XML 0.91

    -

    Changes in Mini-XML 0.9

    +

    Changes in Mini-XML 0.9

    diff --git a/www/docfiles/schema.html b/www/docfiles/schema.html index 62b2c15..907438e 100644 --- a/www/docfiles/schema.html +++ b/www/docfiles/schema.html @@ -1,9 +1,9 @@ -Mini-XML Programmers Manual, Version 2.6 +Mini-XML Programmers Manual, Version 2.7 - + @@ -31,7 +31,7 @@ hspace="10" src="D.gif" width="100">XML Schema

    This appendix provides the XML schema that is used for the XML files produced by mxmldoc. This schema is available on-line at:

    -    http://www.easysw.com/~mike/mxmldoc.xsd
    +    http://www.minixml.org/mxmldoc.xsd
     

    mxmldoc.xsd

    
    @@ -39,8 +39,8 @@ hspace="10" src="D.gif" width="100">XML Schema
     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <xsd:annotation>
         <xsd:documentation xml:lang="en">
    -      Mini-XML 2.3 documentation schema for mxmldoc output.
    -      Copyright 2003-2007 by Michael Sweet.
    +      Mini-XML 2.7 documentation schema for mxmldoc output.
    +      Copyright 2003-2011 by Michael Sweet.
         </xsd:documentation>
       </xsd:annotation>
     
    diff --git a/www/documentation.php b/www/documentation.php
    index 2c483f4..1323a03 100644
    --- a/www/documentation.php
    +++ b/www/documentation.php
    @@ -164,7 +164,7 @@ else
       {
         // Run htmlsearch to search the documentation...
         $matches = array();
    -    $fp      = popen("/home/mike/bin/htmlsearch " . escapeshellarg($q), "r");
    +    $fp      = popen("/usr/local/bin/websearch " . escapeshellarg($q), "r");
     
         while ($line = fgets($fp, 1024))
         {