Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/xml2.sgml`
f2042d0e70db25d1cfadf5e43c01271e83a996a84e281e3a0000000100000fa3
 <type>text</type> )
        <returnvalue>real</returnvalue>
       </para>
       <para>
        Evaluates the XPath query on the supplied document, and
        casts the result to <type>real</type>.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <function>xpath_bool</function> ( <parameter>document</parameter> <type>text</type>, <parameter>query</parameter> <type>text</type> )
        <returnvalue>boolean</returnvalue>
       </para>
       <para>
        Evaluates the XPath query on the supplied document, and
        casts the result to <type>boolean</type>.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <function>xpath_nodeset</function> ( <parameter>document</parameter> <type>text</type>, <parameter>query</parameter> <type>text</type>, <parameter>toptag</parameter> <type>text</type>, <parameter>itemtag</parameter> <type>text</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        Evaluates the query on the document and wraps the result in XML
        tags. If the result is multivalued, the output will look like:
<synopsis>
&lt;toptag&gt;
&lt;itemtag&gt;Value 1 which could be an XML fragment&lt;/itemtag&gt;
&lt;itemtag&gt;Value 2....&lt;/itemtag&gt;
&lt;/toptag&gt;
</synopsis>
        If either <parameter>toptag</parameter>
        or <parameter>itemtag</parameter> is an empty string, the relevant tag
        is omitted.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <function>xpath_nodeset</function> ( <parameter>document</parameter> <type>text</type>, <parameter>query</parameter> <type>text</type>, <parameter>itemtag</parameter> <type>text</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        Like <function>xpath_nodeset(document, query, toptag, itemtag)</function> but result omits <parameter>toptag</parameter>.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <function>xpath_nodeset</function> ( <parameter>document</parameter> <type>text</type>, <parameter>query</parameter> <type>text</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        Like <function>xpath_nodeset(document, query, toptag, itemtag)</function> but result omits both tags.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <function>xpath_list</function> ( <parameter>document</parameter> <type>text</type>, <parameter>query</parameter> <type>text</type>, <parameter>separator</parameter> <type>text</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        Evaluates the query on the document and returns multiple values
        separated by the specified separator, for example <literal>Value
        1,Value 2,Value 3</literal> if <parameter>separator</parameter>
        is <literal>,</literal>.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <function>xpath_list</function> ( <parameter>document</parameter> <type>text</type>, <parameter>query</parameter> <type>text</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        This is a wrapper for the above function that uses <literal>,</literal>
        as the separator.
       </para></entry>
      </row>
     </tbody>
    </tgroup>
  </table>
 </sect2>

 <sect2 id="xml2-xpath-table">
  <title><literal>xpath_table</literal></title>

  <indexterm>
   <primary>xpath_table</primary>
  </indexterm>

<synopsis>
xpath_table(text key, text document, text relation, text xpaths, text criteria) returns setof record
</synopsis>

  <para>
   <function>xpath_table</function> is a table function that evaluates a set of XPath
   queries

Title: xml2 Module Functions
Summary
The xml2 module provides various functions for working with XML documents, including XPath querying, XML parsing, and validation, with functions such as xpath_string, xpath_number, xpath_bool, xpath_nodeset, and xpath_list, as well as the xpath_table table function.