1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2024 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
-
-
-->
<sect2 id="admui.xmlservices"><title>XML Services</title>
<sect3 id="sqlxmlstmts">
<title>SQL-XML Statements</title>
<para>
Go to XML/SQL-XML and enter a SQL to XML statement in the <emphasis>SQLX or SQL-XML Query</emphasis> text-area:
</para>
<example><title>For example:</title>
<programlisting>
SELECT "product".ProductID AS "id",
"product".ProductName AS "name"
FROM
"Demo"."demo"."Products" as "product"
FOR XML AUTO ELEMENT
</programlisting>
</example>
<figure float="1"><title>SQL-XML Statements</title>
<graphic fileref="ui/sql_xml_mng_01.png"/></figure>
<para>
Type the root XML element name into the <emphasis>Root Element</emphasis> field.
The results of the query will be contained within this root element.</para>
<para>
Type the full path and resource name where you want your XML resource to reside under WebDAV
in the <emphasis>WebDAV Resource path for the result</emphasis> field. Collection(s) described
in the full path must already exist.</para>
<para>
You may use the <emphasis>Browse</emphasis> button next to the <emphasis>WebDAV Resource path
for the result</emphasis> field to navigate existing WebDAV collections (folders) or resources
to store the result of query.</para>
<para>
From the "Stored Queries" tab if you choose a resource that already exists as a query in WebDAV resource,
after click the "Edit" link, the form will automatically acquire the details from the query.</para>
<para>
If an XSLT transformation should be performed on retrieval time then you may either type the location
of the stylesheet in the <emphasis>Stylesheet</emphasis> field or press the
<emphasis>Browse</emphasis> button next to it to search for a valid XSLT stylesheet from the WebDAV
repository.</para>
<para>
Provide the appropriate <emphasis>WebDAV owner</emphasis> and <emphasis>group</emphasis> of stored result
using the drop downs provided.</para>
<para>
Select appropriate <emphasis>permissions</emphasis> for the stored result.</para>
<para>
The query can be set to update itself at specific intervals of time or execute every time the resource
is retrieved. If <emphasis>Persist XML</emphasis> is checked the query will be executed
on <emphasis>Update every</emphasis> 10 minutes by default.</para>
<para>
Press the <emphasis>Execute</emphasis> button to execute the statement and store as a WebDAV
resource. Use <emphasis>Reset</emphasis> to clear the form</para>
<para>
If you want to build a schema definition for the result then press the
<emphasis>Create XML Schema</emphasis> radio-button.
</para>
<para>
Virtuoso can provide the generated XML output with a full DTD for the data. Press
<emphasis>Create External DTD</emphasis> to enable this option for the query.
</para>
</sect3>
<sect3 id="xpathsearch">
<title>XQuery Search</title>
<para>Go to XML / XQuery /Xquery Basic.
</para>
<para>XQuery Document Search applies the XPATH expression to every realized XML contained
within the Query Scope to qualify search hit results. Note that this does not include XML Views unless
persistent.
</para>
<figure float="1"><title>XPATH Query of DAV</title>
<graphic fileref="ui/dav_xpath_01.png"/></figure>
<para>Choose the <emphasis>Scope of Query</emphasis> from within the WebDAV repository. You may
define the scope as either No Context, DAV Resource (file), DAV Collection (folder), External Document URL,
External Collection URL or Database Table. Use the <emphasis>Browse</emphasis> button to
browse the contents of WebDAV to make a selection. The query will then be confined to the selected resource
or collection and its children. Then Click the button "Next" in order to continue.
</para>
<figure float="1"><title>XPATH Query of DAV</title>
<graphic fileref="ui/dav_xpath_02.png"/></figure>
<para>Enter that XPATH query expression into the text area that you wish
to interrogate your WebDAV XML documents with. e.g. <emphasis>//*</emphasis> or <emphasis>//title</emphasis>
</para>
<para>The <emphasis>Root Element</emphasis> field allows you specify the name of the root
element to contain document element matches for each document found. This aids stylesheet design.
</para>
<para>Choose an <emphasis>Output Style Sheet</emphasis> by either typing its
URL or using <emphasis>Browse</emphasis> to select an XSL resource from WebDAV. You only need to
specify a style sheet if you want to transform your XML results using XSLT.
</para>
<para>Click the button "Next" in order to continue.
</para>
<para>Choose an <emphasis>Store into</emphasis> location by either typing its
URL or using <emphasis>Browse</emphasis> to select a DAV resource from WebDAV
</para>
<para>Set <emphasis>Permissions</emphasis> for the output result. Check "r" for read rights for Group and
Users in order to view later the saved xml file.
</para>
<para>You may want to <emphasis>Replace the existing resource</emphasis> by checking the shown check-box with this label.
</para>
<para>Choose <emphasis>Output Type</emphasis> that you wish to obtain.
<emphasis>Persist XML</emphasis> should be selected with Update interval im minutes or if you want to be created as XML Template,
fill in the "Create as XML Template Description" field.
</para>
<para>Click the button "Save".
</para>
<figure float="1"><title>XPATH Query of DAV</title>
<graphic fileref="ui/dav_xpath_03.png"/></figure>
<figure float="1"><title>XPATH Query of DAV</title>
<graphic fileref="ui/dav_xpath_04.png"/></figure>
<para>If for location you have chosen /DAV/xmlsql/xquery.xml, you can view the saved file accessing the
url: http://host:port/DAV/xmlsql/xquery.xml
</para>
<figure float="1"><title>XPATH Query of DAV</title>
<graphic fileref="ui/dav_xpath_05.png"/></figure>
</sect3>
</sect2>
|