⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reference.html

📁 MINIXml 具有 解析、查找、生成、遍历 功能,一般不是太复杂的应用足够了。可贵的是全部实现是标准c,移植很容易。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
mxmlFindElement(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    <a href='#mxml_node_t'>mxml_node_t</a> * top,    const char * name,    const char * attr,    const char * value,    int descend);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>node</tt></td><td>Current node</td></tr><tr><td><tt>top</tt></td><td>Top node</td></tr><tr><td><tt>name</tt></td><td>Element name or NULL for any</td></tr><tr><td><tt>attr</tt></td><td>Attribute name, or NULL for none</td></tr><tr><td><tt>value</tt></td><td>Attribute value, or NULL for any</td></tr><tr><td><tt>descend</tt></td><td>Descend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST</td></tr></tbody></table></div><h4>Returns</h4><p>Element node or NULL</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlIndexDelete'>mxmlIndexDelete()</a></h3><h4>Description</h4><p>Delete an index.<h4>Syntax</h4><p><tt>void<br>mxmlIndexDelete(    <a href='#mxml_index_t'>mxml_index_t</a> * ind);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>ind</tt></td><td>Index to delete</td></tr></tbody></table></div><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlIndexEnum'>mxmlIndexEnum()</a></h3><h4>Description</h4><p>Return the next node in the index.<p>Nodes are returned in the sorted order of the index.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlIndexEnum(    <a href='#mxml_index_t'>mxml_index_t</a> * ind);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>ind</tt></td><td>Index to enumerate</td></tr></tbody></table></div><h4>Returns</h4><p>Next node or NULL if there is none</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlIndexFind'>mxmlIndexFind()</a></h3><h4>Description</h4><p>Find the next matching node.<p>You should call mxmlIndexReset() prior to using this function forthe first time with a particular set of &quot;element&quot; and &quot;value&quot;strings. Passing NULL for both &quot;element&quot; and &quot;value&quot; is equivalentto calling mxmlIndexEnum().<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlIndexFind(    <a href='#mxml_index_t'>mxml_index_t</a> * ind,    const char * element,    const char * value);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>ind</tt></td><td>Index to search</td></tr><tr><td><tt>element</tt></td><td>Element name to find, if any</td></tr><tr><td><tt>value</tt></td><td>Attribute value, if any</td></tr></tbody></table></div><h4>Returns</h4><p>Node or NULL if none found</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlIndexNew'>mxmlIndexNew()</a></h3><h4>Description</h4><p>Create a new index.<p>The index will contain all nodes that contain the named element and/orattribute. If both &quot;element&quot; and &quot;attr&quot; are NULL, then the index willcontain a sorted list of the elements in the node tree.  Nodes aresorted by element name and optionally by attribute value if the &quot;attr&quot;argument is not NULL.<h4>Syntax</h4><p><tt><a href='#mxml_index_t'>mxml_index_t</a> *<br>mxmlIndexNew(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    const char * element,    const char * attr);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>node</tt></td><td>XML node tree</td></tr><tr><td><tt>element</tt></td><td>Element to index or NULL for all</td></tr><tr><td><tt>attr</tt></td><td>Attribute to index or NULL for none</td></tr></tbody></table></div><h4>Returns</h4><p>New index</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlIndexReset'>mxmlIndexReset()</a></h3><h4>Description</h4><p>Reset the enumeration/find pointer in the index andreturn the first node in the index.<p>This function should be called prior to using mxmlIndexEnum() ormxmlIndexFind() for the first time.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlIndexReset(    <a href='#mxml_index_t'>mxml_index_t</a> * ind);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>ind</tt></td><td>Index to reset</td></tr></tbody></table></div><h4>Returns</h4><p>First node or NULL if there is none</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlLoadFd'>mxmlLoadFd()</a></h3><h4>Description</h4><p>Load a file descriptor into an XML node tree.<p>The nodes in the specified file are added to the specified top node.If no top node is provided, the XML file MUST be well-formed with asingle parent node like &lt;?xml&gt; for the entire file. The callbackfunction returns the value type that should be used for child nodes.If MXML_NO_CALLBACK is specified then all child nodes will be eitherMXML_ELEMENT or MXML_TEXT nodes.<p>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlLoadFd(    <a href='#mxml_node_t'>mxml_node_t</a> * top,    int fd,    <a href='#mxml_load_cb_t'>mxml_load_cb_t</a> cb);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>top</tt></td><td>Top node</td></tr><tr><td><tt>fd</tt></td><td>File descriptor to read from</td></tr><tr><td><tt>cb</tt></td><td>Callback function or MXML_NO_CALLBACK</td></tr></tbody></table></div><h4>Returns</h4><p>First node or NULL if the file could not be read.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlLoadFile'>mxmlLoadFile()</a></h3><h4>Description</h4><p>Load a file into an XML node tree.<p>The nodes in the specified file are added to the specified top node.If no top node is provided, the XML file MUST be well-formed with asingle parent node like &lt;?xml&gt; for the entire file. The callbackfunction returns the value type that should be used for child nodes.If MXML_NO_CALLBACK is specified then all child nodes will be eitherMXML_ELEMENT or MXML_TEXT nodes.<p>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlLoadFile(    <a href='#mxml_node_t'>mxml_node_t</a> * top,    FILE * fp,    <a href='#mxml_load_cb_t'>mxml_load_cb_t</a> cb);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>top</tt></td><td>Top node</td></tr><tr><td><tt>fp</tt></td><td>File to read from</td></tr><tr><td><tt>cb</tt></td><td>Callback function or MXML_NO_CALLBACK</td></tr></tbody></table></div><h4>Returns</h4><p>First node or NULL if the file could not be read.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlLoadString'>mxmlLoadString()</a></h3><h4>Description</h4><p>Load a string into an XML node tree.<p>The nodes in the specified string are added to the specified top node.If no top node is provided, the XML string MUST be well-formed with asingle parent node like &lt;?xml&gt; for the entire string. The callbackfunction returns the value type that should be used for child nodes.If MXML_NO_CALLBACK is specified then all child nodes will be eitherMXML_ELEMENT or MXML_TEXT nodes.<p>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlLoadString(    <a href='#mxml_node_t'>mxml_node_t</a> * top,    const char * s,    <a href='#mxml_load_cb_t'>mxml_load_cb_t</a> cb);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>top</tt></td><td>Top node</td></tr><tr><td><tt>s</tt></td><td>String to load</td></tr><tr><td><tt>cb</tt></td><td>Callback function or MXML_NO_CALLBACK</td></tr></tbody></table></div><h4>Returns</h4><p>First node or NULL if the string has errors.</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlNewCDATA'>mxmlNewCDATA()</a></h3><h4>Description</h4><p>Create a new CDATA node.<p>The new CDATA node is added to the end of the specified parent's childlist. The constant MXML_NO_PARENT can be used to specify that the newCDATA node has no parent. The data string must be nul-terminated andis copied into the new node. CDATA nodes use the MXML_ELEMENT type.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewCDATA(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    const char * data);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>parent</tt></td><td>Parent node or MXML_NO_PARENT</td></tr><tr><td><tt>data</tt></td><td>Data string</td></tr></tbody></table></div><h4>Returns</h4><p>New node</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span><a name='mxmlNewCustom'>mxmlNewCustom()</a></h3><h4>Description</h4><p>Create a new custom data node.<p>The new custom node is added to the end of the specified parent's childlist. The constant MXML_NO_PARENT can be used to specify that the newelement node has no parent. NULL can be passed when the data in thenode is not dynamically allocated or is separately managed.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewCustom(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    void * data,    <a href='#mxml_custom_destroy_cb_t'>mxml_custom_destroy_cb_t</a> destroy);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>parent</tt></td><td>Parent node or MXML_NO_PARENT</td></tr><tr><td><tt>data</tt></td><td>Pointer to data</td></tr><tr><td><tt>destroy</tt></td><td>Function to destroy data</td></tr></tbody></table></div><h4>Returns</h4><p>New node</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlNewElement'>mxmlNewElement()</a></h3><h4>Description</h4><p>Create a new element node.<p>The new element node is added to the end of the specified parent's childlist. The constant MXML_NO_PARENT can be used to specify that the newelement node has no parent.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewElement(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    const char * name);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>parent</tt></td><td>Parent node or MXML_NO_PARENT</td></tr><tr><td><tt>name</tt></td><td>Name of element</td></tr></tbody></table></div><h4>Returns</h4><p>New node</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlNewInteger'>mxmlNewInteger()</a></h3><h4>Description</h4><p>Create a new integer node.<p>The new integer node is added to the end of the specified parent's childlist. The constant MXML_NO_PARENT can be used to specify that the newinteger node has no parent.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewInteger(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    int integer);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>parent</tt></td><td>Parent node or MXML_NO_PARENT</td></tr><tr><td><tt>integer</tt></td><td>Integer value</td></tr></tbody></table></div><h4>Returns</h4><p>New node</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlNewOpaque'>mxmlNewOpaque()</a></h3><h4>Description</h4><p>Create a new opaque string.<p>The new opaque node is added to the end of the specified parent's childlist. The constant MXML_NO_PARENT can be used to specify that the newopaque node has no parent. The opaque string must be nul-terminated andis copied into the new node.<h4>Syntax</h4><p><tt>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -