From: Wolfgang M. M. <wol...@us...> - 2004-10-29 21:14:29
|
Update of /cvsroot/exist/eXist-1.0/webapp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20503/webapp Modified Files: quickstart.xml examples.xml xinclude.xml Log Message: Index: quickstart.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/quickstart.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** quickstart.xml 16 Oct 2004 19:55:33 -0000 1.16 --- quickstart.xml 29 Oct 2004 21:14:17 -0000 1.17 *************** *** 264,273 **** </variablelist> </section> <section> <title>Using the Client to Index Files</title> ! <para>There is no preferred way to work with eXist. The server ! offers quite a number of different interfaces, including ! XML-RPC, SOAP, REST-style HTTP or direct access via Cocoon ! and the XML:DB API.</para> <para>This section explains how to add and query files using the admin client. The command-line client may either be controlled by --- 264,299 ---- </variablelist> </section> + <section> + <title>Import the Example Documents</title> + + <para>To play with the database, we first need to store something into it. + The examples that come with eXist require a few documents to be stored into + the correct collections.</para> + + <para>To make things as simple as possible, we added an XQuery script + to create the required collections and import the files. However, you can + also do that manually as described in the next section.</para> + + <para>The setup script can be found in the admin web application, which + is itself completely written in XQuery and can be used for the basic + administration steps. Browse to</para> + + <para><ulink url="http://localhost:8080/exist/admin/admin.xql"> + http://localhost:8080/exist/admin/admin.xql</ulink></para> + + <para>or select <option>Administration/Admin</option> from the + sidebar on the start page of eXist.</para> + + <para>Login as "admin" and leave the password field empty. Once logged + in, select <option>Examples Setup</option> from the menu at the left.</para> + </section> + <section> <title>Using the Client to Index Files</title> ! ! <para>There is no preferred way to work with eXist. The server ! offers quite a number of different interfaces, including ! XML-RPC, SOAP, REST-style HTTP or direct access via Cocoon ! and the XML:DB API.</para> <para>This section explains how to add and query files using the admin client. The command-line client may either be controlled by Index: examples.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/examples.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** examples.xml 27 Oct 2004 21:01:14 -0000 1.6 --- examples.xml 29 Oct 2004 21:14:17 -0000 1.7 *************** *** 12,35 **** <p>XQuery is probably the next big language for Web programming. ! Contrary to JSP, PHP, ASP, XSP, it is not a mix of a "normal" programming language with HTML, it is a single language that is designed by the W3C from scratch to support the procedural aspect and the XML. XQuery is equally good for Web XHTML content creation as for querying XML. And with the eXist HTTP request extensions there are the necessary functions to access the HTTP request.</p> ! <p>The examples here demonstrate eXist's new XQuery processing features. eXist provides two alternatives to execute a single ! XQuery script in a web application: ! <ul> <li> ! <para>a generator for Cocoon, called <b>XQueryGenerator</b>, and </para> </li> <li> ! a servlet, implemented in class <b>XQueryServlet</b>. </li> ! </ul> ! The XQueryGenerator passes the ! generated output of the XQuery script as a SAX stream into the ! Cocoon pipeline. Use it if you need the full power of Cocoon. The servlet is configured to respond to ! requests ending with the suffix <code>.xql</code>.</p> <p>Both alternatives, the XQueryGenerator as well as the servlet, ! keep the compiled XQuery script in a cache. The code will only ! be recompiled if the source file has changed.</p> <table border="0" width="100%" cellspacing="10"> --- 12,42 ---- <p>XQuery is probably the next big language for Web programming. ! Contrary to JSP, PHP, ASP, XSP, it is not a mix of a "normal" ! programming language with HTML, it is a single language that ! is designed by the W3C from scratch to support the procedural ! aspect and the XML. XQuery is equally good for Web XHTML content ! creation as for querying XML. And with the eXist HTTP request extensions ! there are the necessary functions to access the HTTP request.</p> ! ! <p>The examples here demonstrate eXist's XQuery processing features. eXist provides two alternatives to execute a single ! XQuery script in a web application:</p> ! <ul> <li> ! a generator for Cocoon, called <b>XQueryGenerator</b>, and </li> <li> ! a servlet, implemented in class <b>XQueryServlet</b>. </li> ! </ul> ! ! <p>The XQueryGenerator passes the ! generated output of the XQuery script as a SAX stream into the ! Cocoon pipeline. Use it if you need the full power of Cocoon. The servlet ! is configured to respond to requests ending with the suffix <code>.xql</code>.</p> <p>Both alternatives, the XQueryGenerator as well as the servlet, ! keep the compiled XQuery script in a cache. The code will only ! be recompiled if the source file has changed.</p> <table border="0" width="100%" cellspacing="10"> *************** *** 94,98 **** <tr> <td width="30%" valign="top"> ! <link href="xquery/biblio.xml">Bibliography</link> </td> <td width="70%"> --- 101,105 ---- <tr> <td width="30%" valign="top"> ! <link href="xquery/biblio.xml">Bibliography 2</link> </td> <td width="70%"> Index: xinclude.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/xinclude.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** xinclude.xml 27 Jul 2004 12:38:34 -0000 1.4 --- xinclude.xml 29 Oct 2004 21:14:17 -0000 1.5 *************** *** 1,7 **** <?xml version="1.0" encoding="UTF-8"?> ! <book xmlns:ci="http://apache.org/cocoon/include/1.0"> <bookinfo> ! <graphic fileref="/exist/logo.jpg"/> ! <title>Open Source Native XML Database</title> <author> <firstname>Wolfgang M.</firstname> --- 1,10 ---- <?xml version="1.0" encoding="UTF-8"?> ! <?xml-stylesheet href="db2html.xsl" type="text/xsl"?> ! ! <book xmlns:xi="http://www.w3.org/2001/XInclude"> <bookinfo> ! <graphic fileref="logo.jpg"/> ! <style href="default-style.css"/> ! <title>Open Source XML Database</title> <author> <firstname>Wolfgang M.</firstname> *************** *** 9,20 **** <affiliation> <address format="linespecific"> ! <email>wol...@ex...</email> </address> </affiliation> </author> </bookinfo> ! <ci:include src="sidebar.xml"/> <chapter> ! <title>XInclude</title> <para>Beginning with version 0.9, eXist comes with partial support for the XInclude standard. If configured, the server will scan a --- 12,23 ---- <affiliation> <address format="linespecific"> ! <email>me...@if...</email> </address> </affiliation> </author> </bookinfo> ! <xi:include href="sidebar.xml"/> <chapter> ! <title>XInclude Examples</title> <para>Beginning with version 0.9, eXist comes with partial support for the XInclude standard. If configured, the server will scan a *************** *** 23,29 **** --- 26,34 ---- of the document, i.e. whenever you retrieve a document containing XInclude tags.</para> + <para>eXist's support for XInclude is not complete. You cannot include raw text, just XML. The fallback element is ignored. Also just basic XPath is allowed for XPointers.</para> + <para>Why do we need XInclude? One reason is that eXist does not preserve entity declarations. Entities are resolved by the XML *************** *** 38,60 **** <section> <title>Viewing the Examples</title> ! <para>If you have set up the provided sample files ! as described in the <ulink href="quickstart.xml">Quick Start</ulink>, ! there should be a collection <filename>/db/xinclude</filename> on ! your database with an XML file called <filename>xinclude.xml</filename>. ! It basically contains the same text as this document. However, the ! provided examples will actually work, i.e. you will be able to see the ! effect.</para> ! <para>So if your setup is correct, try to browse to ! <ulink href="xmldb/db/xinclude/xinclude.xml"> ! http://localhost:8080/exist/xmldb/db/xinclude/xinclude.xml ! </ulink> </para> </section> <section> <title>Including a Document</title> <para>To include an entire document, just specify its path in the <option>href</option> attribute of an <sgmltag>xi:include</sgmltag> ! tag. For example, the sidebar shown at the left of all ! documents can be included as follows:</para> <synopsis><![CDATA[<xi:include href="sidebar.xml"/>]]></synopsis> <para>Please note that, as usual, you have to provide the correct namespace --- 43,66 ---- <section> <title>Viewing the Examples</title> ! <para>If you came here from the examples page, you are already looking at ! a page that has been passed through XInclude, and you can see the live effect ! of all the examples below. If not, try to browse to</para> ! ! <para><ulink url="servlet/db/xinclude/xinclude.xml">servlet/db/xinclude/xinclude.xml</ulink> </para> + + <para>and continue to read there.</para> + + <para>By the way, this page also demonstrates some of the possibilities of eXist's REST + interface. All the files required to render this page reside in the database and are + read from there, including the two XSLT stylesheets used for the formatting.</para> </section> + <section> <title>Including a Document</title> <para>To include an entire document, just specify its path in the <option>href</option> attribute of an <sgmltag>xi:include</sgmltag> ! tag. For example, the sidebar shown at the left of this ! documents has been included as follows:</para> <synopsis><![CDATA[<xi:include href="sidebar.xml"/>]]></synopsis> <para>Please note that, as usual, you have to provide the correct namespace *************** *** 67,71 **** <para>The fragment part of the URI reference in the href attribute is interpreted as an XPointer. If the fragment is just a ! barename - now also called a shorthand pointer - it will select the first element of the target document that has an attribute of type ID matching the name. For example, the following xinclude selects the p element from file --- 73,78 ---- <para>The fragment part of the URI reference in the href attribute is interpreted as an XPointer. If the fragment is just a ! barename - now called shorthand pointer - it will select the first ! element of the target document that has an attribute of type ID matching the name. For example, the following xinclude selects the p element from file *************** *** 73,81 **** with value "statement".</para> <synopsis><![CDATA[<xi:include href="disclaimer.xml#statement"/>]]></synopsis> </section> <section> <title>Selecting Fragments by an XPath Expression</title> <para>We may also use an XPath expression to select fragments. The ! XPath expression is passed to the <command>xpointer()</command> scheme. The results of the expression will be included in place of the <sgmltag>xi:include</sgmltag> element. The following --- 80,92 ---- with value "statement".</para> <synopsis><![CDATA[<xi:include href="disclaimer.xml#statement"/>]]></synopsis> + <para>The result of the XInclude will be displayed below:</para> + <xml-source> + <xi:include href="disclaimer.xml#statement"/> + </xml-source> </section> <section> <title>Selecting Fragments by an XPath Expression</title> <para>We may also use an XPath expression to select fragments. The ! XPath expression is passed to the <command>xpointer()</command> scheme. The results of the expression will be included in place of the <sgmltag>xi:include</sgmltag> element. The following *************** *** 83,90 **** --- 94,116 ---- <synopsis><xi:include href="/db/shakespeare/plays/macbeth.xml #xpointer(//SPEECH[SPEAKER&='witch' and near(LINE, 'fenny snake')])/></synopsis> + <para>As before, the results are included below:</para> + <xml-source> + <xi:include href="/db/shakespeare/plays/macbeth.xml#xpointer(//SPEECH[SPEAKER&='witch' and near(LINE, 'fenny snake')])"/> + </xml-source> <para>An XPath expression will be applied to the entire collection if the path in href points to a collection and not a single document:</para> <synopsis><xi:include href="/db/shakespeare#xpointer(//SPEECH[near(LINE, 'cursed spite')])"/></synopsis> + <xml-source> + <xi:include href="/db/shakespeare#xpointer(//SPEECH[near(LINE, 'cursed spite')])"/> + </xml-source> + + <para>Test namespaces: all namespace/prefix mappings declared in + the source document are passed to the query context. + Alternatively, you may declare mappings with xmlns().</para> + <xml-source> + <xi:include + href="disclaimer.xml#xpointer(//comment:comment)xmlns(t=http://nop.com)xmlns(comment=http://test.org)"/> + </xml-source> </section> </chapter> |