<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<refentry id="AsXMLData">
<refmeta>
<refentrytitle role="top_of_page" id="AsXMLData.top_of_page">AsXMLData</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>APPSTREAM Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>AsXMLData</refname>
<refpurpose>AppStream data XML serialization.</refpurpose>
</refnamediv>

<refsect1 id="AsXMLData.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="function_type"><link linkend="AsXMLData"><returnvalue>AsXMLData</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="as-xmldata-new">as_xmldata_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-xmldata-initialize">as_xmldata_initialize</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="AsComponent"><returnvalue>AsComponent</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="as-xmldata-parse-upstream-data">as_xmldata_parse_upstream_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GPtrArray"><returnvalue>GPtrArray</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="as-xmldata-parse-distro-data">as_xmldata_parse_distro_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-xmldata-update-cpt-with-upstream-data">as_xmldata_update_cpt_with_upstream_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="as-xmldata-serialize-to-upstream">as_xmldata_serialize_to_upstream</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="as-xmldata-serialize-to-distro">as_xmldata_serialize_to_distro</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-xmldata-set-parser-mode">as_xmldata_set_parser_mode</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="as-xmldata-parse-component-node">as_xmldata_parse_component_node</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="AsXMLData.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="name" colwidth="150px"/>
<colspec colname="description"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="AS-TYPE-XMLDATA:CAPS">AS_TYPE_XMLDATA</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="AsXMLDataClass">AsXMLDataClass</link></entry></row>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="AsXMLData-struct">AsXMLData</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="AsXMLData.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> AsXMLData
</screen>
</refsect1>

<refsect1 id="AsXMLData.includes"><title>Includes</title><synopsis>#include &lt;appstream.h&gt;
</synopsis></refsect1>

<refsect1 id="AsXMLData.description" role="desc">
<title role="desc.title">Description</title>
<para>Private class to serialize AppStream data into its XML representation and
deserialize the data again.
This class is used by <link linkend="AsMetadata"><type>AsMetadata</type></link> to read AppStream XML.</para>
<para>See also: <link linkend="AsComponent"><type>AsComponent</type></link>, <link linkend="AsMetadata"><type>AsMetadata</type></link></para>

</refsect1>
<refsect1 id="AsXMLData.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="as-xmldata-new" role="function">
<title>as_xmldata_new&#160;()</title>
<indexterm zone="as-xmldata-new"><primary>as_xmldata_new</primary></indexterm>
<programlisting language="C"><link linkend="AsXMLData"><returnvalue>AsXMLData</returnvalue></link>&#160;*
as_xmldata_new (<parameter><type>void</type></parameter>);</programlisting>
</refsect2>
<refsect2 id="as-xmldata-initialize" role="function">
<title>as_xmldata_initialize&#160;()</title>
<indexterm zone="as-xmldata-initialize"><primary>as_xmldata_initialize</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
as_xmldata_initialize (<parameter><link linkend="AsXMLData"><type>AsXMLData</type></link> *xdt</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *locale</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *origin</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *media_baseurl</parameter>,
                       <parameter>const <link linkend="gchar"><type>gchar</type></link> *arch</parameter>,
                       <parameter><link linkend="gint"><type>gint</type></link> priority</parameter>);</programlisting>
<para>Initialize the XML handler.</para>
<refsect3 id="as-xmldata-initialize.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>xdt</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsXMLData"><type>AsXMLData</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="as-xmldata-parse-upstream-data" role="function">
<title>as_xmldata_parse_upstream_data&#160;()</title>
<indexterm zone="as-xmldata-parse-upstream-data"><primary>as_xmldata_parse_upstream_data</primary></indexterm>
<programlisting language="C"><link linkend="AsComponent"><returnvalue>AsComponent</returnvalue></link>&#160;*
as_xmldata_parse_upstream_data (<parameter><link linkend="AsXMLData"><type>AsXMLData</type></link> *xdt</parameter>,
                                <parameter>const <link linkend="gchar"><type>gchar</type></link> *data</parameter>,
                                <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parse AppStream upstream metadata.</para>
<refsect3 id="as-xmldata-parse-upstream-data.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>xdt</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsXMLData"><type>AsXMLData</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>XML representing upstream metadata.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>A <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="as-xmldata-parse-upstream-data.returns" role="returns">
<title>Returns</title>
<para> An <link linkend="AsComponent"><type>AsComponent</type></link>, deserialized from the XML. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="as-xmldata-parse-distro-data" role="function">
<title>as_xmldata_parse_distro_data&#160;()</title>
<indexterm zone="as-xmldata-parse-distro-data"><primary>as_xmldata_parse_distro_data</primary></indexterm>
<programlisting language="C"><link linkend="GPtrArray"><returnvalue>GPtrArray</returnvalue></link>&#160;*
as_xmldata_parse_distro_data (<parameter><link linkend="AsXMLData"><type>AsXMLData</type></link> *xdt</parameter>,
                              <parameter>const <link linkend="gchar"><type>gchar</type></link> *data</parameter>,
                              <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parse AppStream upstream metadata.</para>
<refsect3 id="as-xmldata-parse-distro-data.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>xdt</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsXMLData"><type>AsXMLData</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>XML representing distro metadata.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>A <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="as-xmldata-parse-distro-data.returns" role="returns">
<title>Returns</title>
<para> An array of <link linkend="AsComponent"><type>AsComponent</type></link>, deserialized from the XML. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>element-type</acronym> AsComponent]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="as-xmldata-update-cpt-with-upstream-data" role="function">
<title>as_xmldata_update_cpt_with_upstream_data&#160;()</title>
<indexterm zone="as-xmldata-update-cpt-with-upstream-data"><primary>as_xmldata_update_cpt_with_upstream_data</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
as_xmldata_update_cpt_with_upstream_data
                               (<parameter><link linkend="AsXMLData"><type>AsXMLData</type></link> *xdt</parameter>,
                                <parameter>const <link linkend="gchar"><type>gchar</type></link> *data</parameter>,
                                <parameter><link linkend="AsComponent"><type>AsComponent</type></link> *cpt</parameter>,
                                <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Parse AppStream upstream metadata.</para>
<refsect3 id="as-xmldata-update-cpt-with-upstream-data.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>xdt</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsXMLData"><type>AsXMLData</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>XML representing upstream metadata.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cpt</para></entry>
<entry role="parameter_description"><para>Component that should be updated.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>A <link linkend="GError"><type>GError</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="as-xmldata-serialize-to-upstream" role="function">
<title>as_xmldata_serialize_to_upstream&#160;()</title>
<indexterm zone="as-xmldata-serialize-to-upstream"><primary>as_xmldata_serialize_to_upstream</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
as_xmldata_serialize_to_upstream (<parameter><link linkend="AsXMLData"><type>AsXMLData</type></link> *xdt</parameter>,
                                  <parameter><link linkend="AsComponent"><type>AsComponent</type></link> *cpt</parameter>);</programlisting>
<para>Serialize an <link linkend="AsComponent"><type>AsComponent</type></link> to upstream XML.</para>
<refsect3 id="as-xmldata-serialize-to-upstream.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>xdt</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsXMLData"><type>AsXMLData</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cpt</para></entry>
<entry role="parameter_description"><para>The component to serialize.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="as-xmldata-serialize-to-upstream.returns" role="returns">
<title>Returns</title>
<para> XML metadata.</para>
</refsect3></refsect2>
<refsect2 id="as-xmldata-serialize-to-distro" role="function">
<title>as_xmldata_serialize_to_distro&#160;()</title>
<indexterm zone="as-xmldata-serialize-to-distro"><primary>as_xmldata_serialize_to_distro</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
as_xmldata_serialize_to_distro (<parameter><link linkend="AsXMLData"><type>AsXMLData</type></link> *xdt</parameter>,
                                <parameter><link linkend="GPtrArray"><type>GPtrArray</type></link> *cpts</parameter>,
                                <parameter><link linkend="gboolean"><type>gboolean</type></link> write_header</parameter>);</programlisting>
<para>Serialize an <link linkend="AsComponent"><type>AsComponent</type></link> to distro XML.</para>
<refsect3 id="as-xmldata-serialize-to-distro.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>xdt</para></entry>
<entry role="parameter_description"><para>An instance of <link linkend="AsXMLData"><type>AsXMLData</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="as-xmldata-serialize-to-distro.returns" role="returns">
<title>Returns</title>
<para> XML metadata.</para>
</refsect3></refsect2>
<refsect2 id="as-xmldata-set-parser-mode" role="function">
<title>as_xmldata_set_parser_mode&#160;()</title>
<indexterm zone="as-xmldata-set-parser-mode"><primary>as_xmldata_set_parser_mode</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
as_xmldata_set_parser_mode (<parameter><link linkend="AsXMLData"><type>AsXMLData</type></link> *xdt</parameter>,
                            <parameter><link linkend="AsParserMode"><type>AsParserMode</type></link> mode</parameter>);</programlisting>
</refsect2>
<refsect2 id="as-xmldata-parse-component-node" role="function">
<title>as_xmldata_parse_component_node&#160;()</title>
<indexterm zone="as-xmldata-parse-component-node"><primary>as_xmldata_parse_component_node</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
as_xmldata_parse_component_node (<parameter><link linkend="AsXMLData"><type>AsXMLData</type></link> *metad</parameter>,
                                 <parameter><link linkend="xmlNode"><type>xmlNode</type></link> *node</parameter>,
                                 <parameter><link linkend="AsComponent"><type>AsComponent</type></link> *cpt</parameter>,
                                 <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
</refsect2>

</refsect1>
<refsect1 id="AsXMLData.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="AS-TYPE-XMLDATA:CAPS" role="macro">
<title>AS_TYPE_XMLDATA</title>
<indexterm zone="AS-TYPE-XMLDATA:CAPS"><primary>AS_TYPE_XMLDATA</primary></indexterm>
<programlisting language="C">#define AS_TYPE_XMLDATA (as_xmldata_get_type ())
</programlisting>
<para>
</para>
</refsect2>
<refsect2 id="AsXMLDataClass" role="struct">
<title>struct AsXMLDataClass</title>
<indexterm zone="AsXMLDataClass"><primary>AsXMLDataClass</primary></indexterm>
<programlisting language="C">struct AsXMLDataClass {
	GObjectClass		parent_class;
};
</programlisting>
<para>
</para>
</refsect2>
<refsect2 id="AsXMLData-struct" role="struct">
<title>AsXMLData</title>
<indexterm zone="AsXMLData-struct"><primary>AsXMLData</primary></indexterm>
<programlisting language="C">typedef struct _AsXMLData AsXMLData;</programlisting>
<para>
</para>
</refsect2>

</refsect1>

</refentry>
