<!--
 -  
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2018 OpenLink Software
 -  
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -  
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -  
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -  
 -  
-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<refentry id="VS-D-4">
  <refmeta>
    <refentrytitle>DAV Maintenance</refentrytitle>
    <refmiscinfo>tutorial</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>DAV Special URI's</refname>
    <refpurpose>DAV Special URI's</refpurpose>
  </refnamediv>

<refsect1 id="VS-D-4a">
<title>WebDAV parameters</title>
The WebDAV server has the following special URL parameters:
<itemizedlist mark="bullet">
  <listitem>XPATH - the XPATH query to perform against the existing XML document</listitem>
  <listitem>set_tag - the root XML element (default is 'document')</listitem>
  <listitem>result_tag - the elements tag</listitem>
</itemizedlist>
</refsect1>

<refsect1 id="VS-D-4b">
<title>Preparation</title>
This example uses the SQL/XML documents generated by <ulink url="../vs_d_3/vs_d_3.vsp">VS-D-3</ulink>.
</refsect1>

<refsect1 id="VS-D-4c">
<title>Example with result_tag</title>
From within a browser do an XPATH query for a subset of attributes. Use the following URL:
<programlisting>http://host:port/DAV/vs_d_3/URLMultiTable.xml?XPATH=/root/Customers/@CustomerID&amp;result_tag=id</programlisting>
<ulink url="/DAV/vs_d_3/URLMultiTable.xml?XPATH=/root/Customers/@CustomerID&result_tag=id">Or click this relative link.</ulink>
</refsect1>

<refsect1 id="VS-D-4d">
<title>Expected result with result_tag</title>
<para>For browsers such as Opera and Netscape, view the source of the result page to see the XML.
For browsers capable of rendering the XML, such as Internet Explorer 5+, the XML result will
be shown.</para>
<para>This excerpt from the expected output shows the xml document containing the CustomerID only:
</para>
<programlisting>
   &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
   &lt;document&gt;
   &lt;id&gt;
   ALFKI&lt;/id&gt;
   &lt;id&gt;
   ANATR&lt;/id&gt;
   &lt;id&gt;
   ANTON&lt;/id&gt;
   &lt;id&gt;
   AROUT&lt;/id&gt;
   &lt;id&gt;
   BERGS&lt;/id&gt;
   &lt;id&gt;
   BLAUS&lt;/id&gt;
   &lt;id&gt;
   BLONP&lt;/id&gt;
   &lt;id&gt;
   BOLID&lt;/id&gt;
   &lt;id&gt;
   BONAP&lt;/id&gt;
   ...
   &lt;/document&gt;
</programlisting>
</refsect1>

<refsect1 id="VS-D-4e">
<title>Example with set_tag</title>
<para>Similar to previous example, but replacing result_tag with the set_tag parameter. Enter this URL into a browser:</para>

<programlisting>http://host:port/DAV/vs_d_3/URLMultiTable.xml?XPATH=/root/Customers[@CustomerID+like+'A*']/@CustomerID&amp;set_tag=id</programlisting>
<ulink url="/DAV/vs_d_3/URLMultiTable.xml?XPATH=/root/Customers[@CustomerID+like+'A*']/@CustomerID&set_tag=id">Or click this relative link.</ulink>

<para>Note: the XPATH queries can only be performed against the persistent storage.</para>
</refsect1>

<refsect1 id="VS-D-4f">
<title>Expected result with set_tag</title>
<programlisting>
 &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
 &lt;id&gt;
 ALFKIANATRANTONAROUT&lt;/id&gt;
</programlisting>
</refsect1>

<refsect1 id="VS-D-4g">
<title>Example with set_tag and result_tag</title>
<para>Similar to previous example, but adding result_tag parameter. Enter this URL into a browser:</para>

<programlisting>http://host:port/DAV/vs_d_3/URLMultiTable.xml?XPATH=/root/Customers[@CustomerID+like+'A*']/@CustomerID&amp;set_tag=id&amp;result_tag=p</programlisting>
<ulink url="/DAV/vs_d_3/URLMultiTable.xml?XPATH=/root/Customers[@CustomerID+like+'A*']/@CustomerID&set_tag=id&result_tag=p">Or click this relative link.</ulink>

<para>Note: the XPATH queries can only be performed against the persistent storage.</para>
</refsect1>

<refsect1 id="VS-D-4h">
<title>Expected result with set_tag and result_tag</title>
<programlisting>
 &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
 &lt;id&gt;
&lt;p&gt;
ALFKI&lt;/p&gt;
&lt;p&gt;
ANATR&lt;/p&gt;
&lt;p&gt;
ANTON&lt;/p&gt;
&lt;p&gt;
AROUT&lt;/p&gt;
&lt;/id&gt;
</programlisting>
</refsect1>
</refentry>
