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

📄 reference.html

📁 minixml2.5最新的版本。 嵌入式xml 解析、查找、生成、遍历 功能,全部实现是标准c,移植很容易。 最新的2.5
💻 HTML
📖 第 1 页 / 共 5 页
字号:
&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>node</dt><dd class="description">Element node</dd><dt>name</dt><dd class="description">Name of attribute</dd><dt>value</dt><dd class="description">Attribute value</dd></dl><h4 class="discussion">Discussion</h4><p class="discussion">If the named attribute already exists, the value of the attributeis replaced by the new string value. The string value is copiedinto the element node. This function does nothing if the node isnot an element.</p><h3 class="function"><span class="info">&nbsp;Mini-XML 2.3&nbsp;</span><a name="mxmlElementSetAttrf">mxmlElementSetAttrf</a></h3><p class="description">Set an attribute with a formatted value.</p><p class="code">void mxmlElementSetAttrf (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *format,<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>node</dt><dd class="description">Element node</dd><dt>name</dt><dd class="description">Name of attribute</dd><dt>format</dt><dd class="description">Printf-style attribute value</dd><dt>...</dt><dd class="description">Additional arguments as needed</dd></dl><h4 class="discussion">Discussion</h4><p class="discussion">If the named attribute already exists, the value of the attributeis replaced by the new formatted string. The formatted string value iscopied into the element node. This function does nothing if the nodeis not an element.</p><h3 class="function"><a name="mxmlEntityAddCallback">mxmlEntityAddCallback</a></h3><p class="description">Add a callback to convert entities to Unicode.</p><p class="code">int mxmlEntityAddCallback (void);</p><h4 class="returnvalue">Return Value</h4><p class="description">0 on success, -1 on failure</p><h3 class="function"><a name="mxmlEntityGetName">mxmlEntityGetName</a></h3><p class="description">Get the name that corresponds to the character value.</p><p class="code">const char *mxmlEntityGetName (<br>&nbsp;&nbsp;&nbsp;&nbsp;int val<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>val</dt><dd class="description">Character value</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">Entity name or NULL</p><h4 class="discussion">Discussion</h4><p class="discussion">If val does not need to be represented by a named entity, NULL is returned.</p><h3 class="function"><a name="mxmlEntityGetValue">mxmlEntityGetValue</a></h3><p class="description">Get the character corresponding to a named entity.</p><p class="code">int mxmlEntityGetValue (<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>name</dt><dd class="description">Entity name</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">Character value or -1 on error</p><h4 class="discussion">Discussion</h4><p class="discussion">The entity name can also be a numeric constant. -1 is returned if thename is not known.</p><h3 class="function"><a name="mxmlEntityRemoveCallback">mxmlEntityRemoveCallback</a></h3><p class="description">Remove a callback.</p><p class="code">void mxmlEntityRemoveCallback (void);</p><h3 class="function"><a name="mxmlFindElement">mxmlFindElement</a></h3><p class="description">Find the named element.</p><p class="code"><a href="#mxml_node_t">mxml_node_t</a> *mxmlFindElement (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *top,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *attr,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *value,<br>&nbsp;&nbsp;&nbsp;&nbsp;int descend<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>node</dt><dd class="description">Current node</dd><dt>top</dt><dd class="description">Top node</dd><dt>name</dt><dd class="description">Element name or NULL for any</dd><dt>attr</dt><dd class="description">Attribute name, or NULL for none</dd><dt>value</dt><dd class="description">Attribute value, or NULL for any</dd><dt>descend</dt><dd class="description">Descend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">Element node or NULL</p><h4 class="discussion">Discussion</h4><p class="discussion">The search is constrained by the name, attribute name, and value; anyNULL names or values are treated as wildcards, so different kinds ofsearches can be implemented by looking for all elements of a given nameor all elements with a specific attribute. The descend argument determineswhether the search descends into child nodes; normally you will useMXML_DESCEND_FIRST for the initial search and MXML_NO_DESCEND to findadditional direct descendents of the node. The top node argumentconstrains the search to a particular node's children.</p><h3 class="function"><a name="mxmlIndexDelete">mxmlIndexDelete</a></h3><p class="description">Delete an index.</p><p class="code">void mxmlIndexDelete (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_index_t">mxml_index_t</a> *ind<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>ind</dt><dd class="description">Index to delete</dd></dl><h3 class="function"><a name="mxmlIndexEnum">mxmlIndexEnum</a></h3><p class="description">Return the next node in the index.</p><p class="code"><a href="#mxml_node_t">mxml_node_t</a> *mxmlIndexEnum (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_index_t">mxml_index_t</a> *ind<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>ind</dt><dd class="description">Index to enumerate</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">Next node or NULL if there is none</p><h4 class="discussion">Discussion</h4><p class="discussion">Nodes are returned in the sorted order of the index.</p><h3 class="function"><a name="mxmlIndexFind">mxmlIndexFind</a></h3><p class="description">Find the next matching node.</p><p class="code"><a href="#mxml_node_t">mxml_node_t</a> *mxmlIndexFind (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_index_t">mxml_index_t</a> *ind,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *element,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>ind</dt><dd class="description">Index to search</dd><dt>element</dt><dd class="description">Element name to find, if any</dd><dt>value</dt><dd class="description">Attribute value, if any</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">Node or NULL if none found</p><h4 class="discussion">Discussion</h4><p class="discussion">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().</p><h3 class="function"><a name="mxmlIndexNew">mxmlIndexNew</a></h3><p class="description">Create a new index.</p><p class="code"><a href="#mxml_index_t">mxml_index_t</a> *mxmlIndexNew (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *element,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *attr<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>node</dt><dd class="description">XML node tree</dd><dt>element</dt><dd class="description">Element to index or NULL for all</dd><dt>attr</dt><dd class="description">Attribute to index or NULL for none</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">New index</p><h4 class="discussion">Discussion</h4><p class="discussion">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.</p><h3 class="function"><a name="mxmlIndexReset">mxmlIndexReset</a></h3><p class="description">Reset the enumeration/find pointer in the index andreturn the first node in the index.</p><p class="code"><a href="#mxml_node_t">mxml_node_t</a> *mxmlIndexReset (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_index_t">mxml_index_t</a> *ind<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>ind</dt><dd class="description">Index to reset</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">First node or NULL if there is none</p><h4 class="discussion">Discussion</h4><p class="discussion">This function should be called prior to using mxmlIndexEnum() ormxmlIndexFind() for the first time.</p><h3 class="function"><a name="mxmlLoadFd">mxmlLoadFd</a></h3><p class="description">Load a file descriptor into an XML node tree.</p><p class="code"><a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadFd (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *top,<br>&nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_load_cb_t">mxml_load_cb_t</a> cb<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>top</dt><dd class="description">Top node</dd><dt>fd</dt><dd class="description">File descriptor to read from</dd><dt>cb</dt><dd class="description">Callback function or MXML_NO_CALLBACK</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">First node or NULL if the file could not be read.</p><h4 class="discussion">Discussion</h4><p class="discussion">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.<br><br>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.</p><h3 class="function"><a name="mxmlLoadFile">mxmlLoadFile</a></h3><p class="description">Load a file into an XML node tree.</p><p class="code"><a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadFile (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *top,<br>&nbsp;&nbsp;&nbsp;&nbsp;FILE *fp,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_load_cb_t">mxml_load_cb_t</a> cb<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>top</dt><dd class="description">Top node</dd><dt>fp</dt><dd class="description">File to read from</dd><dt>cb</dt><dd class="description">Callback function or MXML_NO_CALLBACK</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">First node or NULL if the file could not be read.</p><h4 class="discussion">Discussion</h4><p class="discussion">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.<br><br>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.</p><h3 class="function"><a name="mxmlLoadString">mxmlLoadString</a></h3><p class="description">Load a string into an XML node tree.</p><p class="code"><a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadString (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *top,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *s,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_load_cb_t">mxml_load_cb_t</a> cb<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>top</dt><dd class="description">Top node</dd><dt>s</dt><dd class="description">String to load</dd><dt>cb</dt><dd class="description">Callback function or MXML_NO_CALLBACK</dd></dl><h4 class="returnvalue">Return Value</h4><p class="description">First node or NULL if the string has errors.</p><h4 class="discussion">Discussion</h4><p class="discussion">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.<br><br>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.</p><h3 class="function"><span class="info">&nbsp;Mini-XML 2.3&nbsp;</span><a name="mxmlNewCDATA">mxmlNewCDATA</a></h3><p class="description">Create a new CDATA node.</p><p class="code"><a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCDATA (<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *parent,<br>&nbsp;&nbsp;&nbsp;&nbsp;const char *data<br>);</p><h4 class="parameters">Parameters</h4><dl><dt>parent</dt><dd class="description">Parent node or MXML_NO_PARENT</dd><dt>data</dt><dd class="description">Data string</dd>

⌨️ 快捷键说明

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