BltInFunc-FROMXML.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <sect1 id="FROMXML">
  5. <title>FROMXML</title>
  6. <para><emphasis role="bold">FROMXML<indexterm>
  7. <primary>FROMXML</primary>
  8. </indexterm><indexterm>
  9. <primary>FROMXML function</primary>
  10. </indexterm>(</emphasis><emphasis> record, xmlstring </emphasis><emphasis
  11. role="bold">)</emphasis></para>
  12. <para><informaltable colsep="1" frame="all" rowsep="1">
  13. <tgroup cols="2">
  14. <colspec colwidth="77.95pt" />
  15. <tbody>
  16. <row>
  17. <entry><emphasis>record</emphasis></entry>
  18. <entry>The RECORD structure to produce. Each field must specify
  19. the XPATH to the data in the <emphasis>xmlstring</emphasis> that
  20. it should hold.</entry>
  21. </row>
  22. <row>
  23. <entry><emphasis>xmlstring</emphasis></entry>
  24. <entry>A string containing the XML to convert.</entry>
  25. </row>
  26. <row>
  27. <entry>Return:</entry>
  28. <entry>FROMXML returns a single row (record).</entry>
  29. </row>
  30. </tbody>
  31. </tgroup>
  32. </informaltable></para>
  33. <para>The <emphasis role="bold">FROMXML </emphasis>function returns a single
  34. row (record) in the <emphasis>record</emphasis> format from the specified
  35. <emphasis>xmlstring</emphasis>. This may be used anywhere a single row can
  36. be used (similar to the ROW function).</para>
  37. <para>Example:</para>
  38. <programlisting>namesRec := RECORD
  39. UNSIGNED2 EmployeeID{xpath('EmpID')};
  40. STRING10 Firstname{xpath('FName')};
  41. STRING10 Lastname{xpath('LName')};
  42. END;
  43. x := '&lt;Row&gt;&lt;FName&gt;George&lt;/FName&gt;&lt;LName&gt;Jetson&lt;/LName&gt;&lt;EmpID&gt;42&lt;/EmpID&gt;&lt;/Row&gt;';
  44. rec := FROMXML(namesRec,x);
  45. OUTPUT(rec);</programlisting>
  46. <para>See Also: <link linkend="ROW">ROW</link>, <link linkend="TOXML">TOXML</link></para>
  47. </sect1>