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

📄 cpl__minixml_8h.html

📁 gdal库的学习文档
💻 HTML
📖 第 1 页 / 共 4 页
字号:
</div></div><p><a class="anchor" name="cb137728b61e42765ea7e5188a24f90e"></a><!-- doxytag: member="cpl_minixml.h::CPLGetXMLNode" ref="cb137728b61e42765ea7e5188a24f90e" args="(CPLXMLNode *poRoot, const char *pszPath)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a>* CPLGetXMLNode           </td>          <td>(</td>          <td class="paramtype"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a> *&nbsp;</td>          <td class="paramname"> <em>psRoot</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const char *&nbsp;</td>          <td class="paramname"> <em>pszPath</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Find node by path. <p>Searches the document or subdocument indicated by psRoot for an element (or attribute) with the given path. The path should consist of a set of element names separated by dots, not including the name of the root element (psRoot). If the requested element is not found NULL is returned.<p>Attribute names may only appear as the last item in the path.<p>The search is done from the root nodes children, but all intermediate nodes in the path must be specified. Seaching for "name" would only find a name element or attribute if it is a direct child of the root, not at any level in the subdocument.<p>If the pszPath is prefixed by "=" then the search will begin with the root node, and it's siblings, instead of the root nodes children. This is particularly useful when searching within a whole document which is often prefixed by one or more "junk" nodes like the &lt;?xml&gt; declaration.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psRoot</em>&nbsp;</td><td>the subtree in which to search. This should be a node of type CXT_Element. NULL is safe.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>pszPath</em>&nbsp;</td><td>the list of element names in the path (dot separated).</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the requested element node, or NULL if not found. </dd></dl></div></div><p><a class="anchor" name="17930604c1a02ccf01cee16bc5c170e6"></a><!-- doxytag: member="cpl_minixml.h::CPLGetXMLValue" ref="17930604c1a02ccf01cee16bc5c170e6" args="(CPLXMLNode *poRoot, const char *pszPath, const char *pszDefault)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">const char* CPLGetXMLValue           </td>          <td>(</td>          <td class="paramtype"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a> *&nbsp;</td>          <td class="paramname"> <em>psRoot</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const char *&nbsp;</td>          <td class="paramname"> <em>pszPath</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const char *&nbsp;</td>          <td class="paramname"> <em>pszDefault</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Fetch element/attribute value. <p>Searches the document for the element/attribute value associated with the path. The corresponding node is internally found with <a class="el" href="cpl__minixml_8h.html#cb137728b61e42765ea7e5188a24f90e">CPLGetXMLNode()</a> (see there for details on path handling). Once found, the value is considered to be the first CXT_Text child of the node.<p>If the attribute/element search fails, or if the found node has not value then the passed default value is returned.<p>The returned value points to memory within the document tree, and should not be altered or freed.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psRoot</em>&nbsp;</td><td>the subtree in which to search. This should be a node of type CXT_Element. NULL is safe.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>pszPath</em>&nbsp;</td><td>the list of element names in the path (dot separated). An empty path means get the value of the psRoot node.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>pszDefault</em>&nbsp;</td><td>the value to return if a corresponding value is not found, may be NULL.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the requested value or pszDefault if not found. </dd></dl></div></div><p><a class="anchor" name="ebe69e0041052c5bf04f5ba90ad77234"></a><!-- doxytag: member="cpl_minixml.h::CPLParseXMLFile" ref="ebe69e0041052c5bf04f5ba90ad77234" args="(const char *pszFilename)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a>* CPLParseXMLFile           </td>          <td>(</td>          <td class="paramtype">const char *&nbsp;</td>          <td class="paramname"> <em>pszFilename</em>          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Parse XML file into tree. <p>The named file is opened, loaded into memory as a big string, and parsed with <a class="el" href="cpl__minixml_8h.html#d2770716fe2b8dac4969df728e274c9b">CPLParseXMLString()</a>. Errors in reading the file or parsing the XML will be reported by <a class="el" href="cpl__error_8h.html#ad2b98dd58e4de706a245faddac90403">CPLError()</a>.<p>The "large file" API is used, so XML files can come from virtualized files.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>pszFilename</em>&nbsp;</td><td>the file to open.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>NULL on failure, or the document tree on success. </dd></dl></div></div><p><a class="anchor" name="d2770716fe2b8dac4969df728e274c9b"></a><!-- doxytag: member="cpl_minixml.h::CPLParseXMLString" ref="d2770716fe2b8dac4969df728e274c9b" args="(const char *)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a>* CPLParseXMLString           </td>          <td>(</td>          <td class="paramtype">const char *&nbsp;</td>          <td class="paramname"> <em>pszString</em>          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Parse an XML string into tree form. <p>The passed document is parsed into a CPLXMLNode tree representation. If the document is not well formed XML then NULL is returned, and errors are reported via <a class="el" href="cpl__error_8h.html#ad2b98dd58e4de706a245faddac90403">CPLError()</a>. No validation beyond wellformedness is done. The <a class="el" href="cpl__minixml_8h.html#ebe69e0041052c5bf04f5ba90ad77234">CPLParseXMLFile()</a> convenience function can be used to parse from a file.<p>The returned document tree is is owned by the caller and should be freed with <a class="el" href="cpl__minixml_8h.html#9e05eabc54728fb3266576404200da40">CPLDestroyXMLNode()</a> when no longer needed.<p>If the document has more than one "root level" element then those after the first will be attached to the first as siblings (via the psNext pointers) even though there is no common parent. A document with no XML structure (no angle brackets for instance) would be considered well formed, and returned as a single CXT_Text node.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>pszString</em>&nbsp;</td><td>the document to parse.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>parsed tree or NULL on error. </dd></dl></div></div><p><a class="anchor" name="abe9f99875faf356b34d2b97a0668ffb"></a><!-- doxytag: member="cpl_minixml.h::CPLRemoveXMLChild" ref="abe9f99875faf356b34d2b97a0668ffb" args="(CPLXMLNode *psParent, CPLXMLNode *psChild)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int CPLRemoveXMLChild           </td>          <td>(</td>          <td class="paramtype"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a> *&nbsp;</td>          <td class="paramname"> <em>psParent</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a> *&nbsp;</td>          <td class="paramname"> <em>psChild</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Remove child node from parent. <p>The passed child is removed from the child list of the passed parent, but the child is not destroyed. The child retains ownership of it's own children, but is cleanly removed from the child list of the parent.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psParent</em>&nbsp;</td><td>the node to the child is attached to.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>psChild</em>&nbsp;</td><td>the child to remove.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>TRUE on success or FALSE if the child was not found. </dd></dl></div></div><p><a class="anchor" name="a1d07b7ebe279176dafa455a70043680"></a><!-- doxytag: member="cpl_minixml.h::CPLSearchXMLNode" ref="a1d07b7ebe279176dafa455a70043680" args="(CPLXMLNode *poRoot, const char *pszTarget)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a>* CPLSearchXMLNode           </td>          <td>(</td>          <td class="paramtype"><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a> *&nbsp;</td>

⌨️ 快捷键说明

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