You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
(57) |
Apr
(103) |
May
(164) |
Jun
(139) |
Jul
(173) |
Aug
(196) |
Sep
(221) |
Oct
(333) |
Nov
(214) |
Dec
(88) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(163) |
Feb
(165) |
Mar
(98) |
Apr
(93) |
May
(199) |
Jun
(118) |
Jul
(200) |
Aug
(212) |
Sep
(185) |
Oct
(297) |
Nov
(437) |
Dec
(272) |
| 2006 |
Jan
(542) |
Feb
(329) |
Mar
(267) |
Apr
(332) |
May
(267) |
Jun
(130) |
Jul
(161) |
Aug
(348) |
Sep
(166) |
Oct
(305) |
Nov
(173) |
Dec
(173) |
| 2007 |
Jan
(199) |
Feb
(118) |
Mar
(133) |
Apr
(200) |
May
(208) |
Jun
(146) |
Jul
(198) |
Aug
(146) |
Sep
(187) |
Oct
(182) |
Nov
(181) |
Dec
(83) |
| 2008 |
Jan
(252) |
Feb
(124) |
Mar
(124) |
Apr
(101) |
May
(143) |
Jun
(122) |
Jul
(129) |
Aug
(60) |
Sep
(80) |
Oct
(89) |
Nov
(54) |
Dec
(112) |
| 2009 |
Jan
(88) |
Feb
(145) |
Mar
(105) |
Apr
(164) |
May
(123) |
Jun
(154) |
Jul
(374) |
Aug
(341) |
Sep
(219) |
Oct
(137) |
Nov
(373) |
Dec
(240) |
| 2010 |
Jan
(197) |
Feb
(270) |
Mar
(253) |
Apr
(150) |
May
(102) |
Jun
(51) |
Jul
(300) |
Aug
(512) |
Sep
(254) |
Oct
(258) |
Nov
(288) |
Dec
(143) |
| 2011 |
Jan
(238) |
Feb
(179) |
Mar
(253) |
Apr
(332) |
May
(248) |
Jun
(255) |
Jul
(216) |
Aug
(282) |
Sep
(146) |
Oct
(77) |
Nov
(86) |
Dec
(69) |
| 2012 |
Jan
(172) |
Feb
(234) |
Mar
(229) |
Apr
(101) |
May
(212) |
Jun
(267) |
Jul
(129) |
Aug
(210) |
Sep
(239) |
Oct
(271) |
Nov
(368) |
Dec
(220) |
| 2013 |
Jan
(179) |
Feb
(155) |
Mar
(59) |
Apr
(47) |
May
(99) |
Jun
(158) |
Jul
(185) |
Aug
(16) |
Sep
(16) |
Oct
(7) |
Nov
(20) |
Dec
(12) |
| 2014 |
Jan
(21) |
Feb
(17) |
Mar
(18) |
Apr
(13) |
May
(27) |
Jun
(15) |
Jul
(19) |
Aug
(22) |
Sep
(30) |
Oct
(16) |
Nov
(19) |
Dec
(16) |
| 2015 |
Jan
(14) |
Feb
(24) |
Mar
(33) |
Apr
(41) |
May
(14) |
Jun
(80) |
Jul
(53) |
Aug
(8) |
Sep
(7) |
Oct
(15) |
Nov
(13) |
Dec
(2) |
| 2016 |
Jan
(22) |
Feb
(12) |
Mar
(30) |
Apr
(6) |
May
(33) |
Jun
(16) |
Jul
(8) |
Aug
(20) |
Sep
(12) |
Oct
(18) |
Nov
(12) |
Dec
(11) |
| 2017 |
Jan
(24) |
Feb
(26) |
Mar
(47) |
Apr
(23) |
May
(19) |
Jun
(14) |
Jul
(28) |
Aug
(30) |
Sep
(17) |
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
(73) |
Mar
(90) |
Apr
(42) |
May
(116) |
Jun
(90) |
Jul
(127) |
Aug
(103) |
Sep
(56) |
Oct
(42) |
Nov
(95) |
Dec
(58) |
| 2020 |
Jan
(102) |
Feb
(31) |
Mar
(93) |
Apr
(60) |
May
(57) |
Jun
(45) |
Jul
(29) |
Aug
(32) |
Sep
(44) |
Oct
(86) |
Nov
(51) |
Dec
(71) |
| 2021 |
Jan
(44) |
Feb
(25) |
Mar
(78) |
Apr
(130) |
May
(64) |
Jun
(74) |
Jul
(21) |
Aug
(64) |
Sep
(40) |
Oct
(43) |
Nov
(21) |
Dec
(99) |
| 2022 |
Jan
(154) |
Feb
(64) |
Mar
(45) |
Apr
(95) |
May
(62) |
Jun
(48) |
Jul
(73) |
Aug
(37) |
Sep
(71) |
Oct
(27) |
Nov
(40) |
Dec
(65) |
| 2023 |
Jan
(89) |
Feb
(130) |
Mar
(124) |
Apr
(50) |
May
(93) |
Jun
(46) |
Jul
(45) |
Aug
(68) |
Sep
(62) |
Oct
(71) |
Nov
(108) |
Dec
(82) |
| 2024 |
Jan
(53) |
Feb
(76) |
Mar
(64) |
Apr
(75) |
May
(36) |
Jun
(54) |
Jul
(98) |
Aug
(137) |
Sep
(58) |
Oct
(177) |
Nov
(84) |
Dec
(52) |
| 2025 |
Jan
(70) |
Feb
(53) |
Mar
(72) |
Apr
(47) |
May
(88) |
Jun
(49) |
Jul
(86) |
Aug
(51) |
Sep
(65) |
Oct
(91) |
Nov
(18) |
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
(3) |
2
(2) |
3
|
|
4
|
5
|
6
|
7
(1) |
8
(1) |
9
(3) |
10
(1) |
|
11
(6) |
12
|
13
(1) |
14
|
15
(3) |
16
(2) |
17
(1) |
|
18
(1) |
19
(3) |
20
|
21
(1) |
22
(1) |
23
(5) |
24
|
|
25
|
26
(1) |
27
|
28
(10) |
29
(11) |
30
(5) |
31
(7) |
|
From: <dmc...@us...> - 2011-12-31 22:01:52
|
Revision: 15630
http://exist.svn.sourceforge.net/exist/?rev=15630&view=rev
Author: dmccreary
Date: 2011-12-31 22:01:46 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
Fixed the context bug in the style module.
Modified Paths:
--------------
apps/docs/modules/style.xqm
Modified: apps/docs/modules/style.xqm
===================================================================
--- apps/docs/modules/style.xqm 2011-12-31 19:24:36 UTC (rev 15629)
+++ apps/docs/modules/style.xqm 2011-12-31 22:01:46 UTC (rev 15630)
@@ -66,10 +66,10 @@
:)
declare variable $style:db-path-to-site := '/db';
-declare variable $style:web-path-to-site := '/rest/db';
+declare variable $style:web-path-to-site := concat(request:get-context-path(), '/rest/db');
declare variable $style:db-path-to-app := $style:db-base;
-declare variable $style:web-path-to-app := concat('/rest', $style:db-base);
+declare variable $style:web-path-to-app := concat(request:get-context-path(), '/rest', $style:db-base);
declare variable $style:db-path-to-app-data := concat($style:db-path-to-app, '/data');
declare variable $style:web-path-to-resources := concat($style:web-path-to-app, '/resources');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dmc...@us...> - 2011-12-31 19:24:45
|
Revision: 15629
http://exist.svn.sourceforge.net/exist/?rev=15629&view=rev
Author: dmccreary
Date: 2011-12-31 19:24:36 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
Added more data and fixed some problems with page styling. Also added sample documents and images for testing external image references in the DocBook to HTML transforms.
Modified Paths:
--------------
apps/docs/data/typeswitch-tutorial/typeswitch-transforms.xml
apps/docs/modules/style.xqm
apps/docs/views/view-doc.xq
Added Paths:
-----------
apps/docs/app-info.xml
apps/docs/data/beginners-guide-to-xrx/
apps/docs/data/beginners-guide-to-xrx/beginners-guide-to-xrx-v4.xml
apps/docs/data/beginners-guide-to-xrx/images/
apps/docs/data/beginners-guide-to-xrx/images/Thumbs.db
apps/docs/data/beginners-guide-to-xrx/images/empty-form.png
apps/docs/data/beginners-guide-to-xrx/images/form-with-data.png
apps/docs/data/beginners-guide-to-xrx/images/index.png
apps/docs/data/beginners-guide-to-xrx/images/list-items-links.png
apps/docs/data/beginners-guide-to-xrx/images/list-items-no-links.png
apps/docs/data/beginners-guide-to-xrx/images/model-view-bindings.png
apps/docs/data/beginners-guide-to-xrx/images/reindex-result.png
apps/docs/data/beginners-guide-to-xrx/images/search-results.png
apps/docs/data/beginners-guide-to-xrx/images/search.png
apps/docs/data/beginners-guide-to-xrx/images/view-item.png
apps/docs/exist-docs-config.xml
apps/docs/index.xq
apps/docs/resources/css/blueprint/
apps/docs/resources/css/blueprint/ie.css
apps/docs/resources/css/blueprint/plugins/
apps/docs/resources/css/blueprint/plugins/buttons/
apps/docs/resources/css/blueprint/plugins/buttons/icons/
apps/docs/resources/css/blueprint/plugins/buttons/icons/cross.png
apps/docs/resources/css/blueprint/plugins/buttons/icons/key.png
apps/docs/resources/css/blueprint/plugins/buttons/icons/tick.png
apps/docs/resources/css/blueprint/plugins/buttons/readme.txt
apps/docs/resources/css/blueprint/plugins/buttons/screen.css
apps/docs/resources/css/blueprint/plugins/fancy-type/
apps/docs/resources/css/blueprint/plugins/fancy-type/readme.txt
apps/docs/resources/css/blueprint/plugins/fancy-type/screen.css
apps/docs/resources/css/blueprint/plugins/link-icons/
apps/docs/resources/css/blueprint/plugins/link-icons/icons/
apps/docs/resources/css/blueprint/plugins/link-icons/icons/doc.png
apps/docs/resources/css/blueprint/plugins/link-icons/icons/email.png
apps/docs/resources/css/blueprint/plugins/link-icons/icons/external.png
apps/docs/resources/css/blueprint/plugins/link-icons/icons/feed.png
apps/docs/resources/css/blueprint/plugins/link-icons/icons/im.png
apps/docs/resources/css/blueprint/plugins/link-icons/icons/lock.png
apps/docs/resources/css/blueprint/plugins/link-icons/icons/pdf.png
apps/docs/resources/css/blueprint/plugins/link-icons/icons/visited.png
apps/docs/resources/css/blueprint/plugins/link-icons/icons/xls.png
apps/docs/resources/css/blueprint/plugins/link-icons/readme.txt
apps/docs/resources/css/blueprint/plugins/link-icons/screen.css
apps/docs/resources/css/blueprint/plugins/rtl/
apps/docs/resources/css/blueprint/plugins/rtl/readme.txt
apps/docs/resources/css/blueprint/plugins/rtl/screen.css
apps/docs/resources/css/blueprint/print.css
apps/docs/resources/css/blueprint/screen.css
apps/docs/resources/css/blueprint/src/
apps/docs/resources/css/blueprint/src/forms.css
apps/docs/resources/css/blueprint/src/grid.css
apps/docs/resources/css/blueprint/src/grid.png
apps/docs/resources/css/blueprint/src/ie.css
apps/docs/resources/css/blueprint/src/print.css
apps/docs/resources/css/blueprint/src/reset.css
apps/docs/resources/css/blueprint/src/typography.css
apps/docs/resources/images/exist-logo.png
apps/docs/search/search-form.xq
apps/docs/search/search.xq
apps/docs/unit-tests/conf-file-test.xq
apps/docs/unit-tests/distinct-docbook-element-names.xq
apps/docs/unit-tests/fo-install-test.xq
apps/docs/views/list-documents-detailed.xq
Added: apps/docs/app-info.xml
===================================================================
--- apps/docs/app-info.xml (rev 0)
+++ apps/docs/app-info.xml 2011-12-31 19:24:36 UTC (rev 15629)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<app-info xmlns="" rel="nofollow">http://code.google.com/p/xrx">
+ <app-id>exist-docs</app-id>
+ <app-name>eXist Documentation</app-name>
+ <app-version-id>1.0</app-version-id>
+ <app-subversion-revision-number/>
+ <app-description-text>Application that allows users to transform and search DocBook5 documents and uses eXist documentation
+ as a sample.</app-description-text>
+ <app-creator-text>Dan McCreary</app-creator-text>
+ <app-creator-text>Loren Cahlander</app-creator-text>
+ <app-license-type-code>apache-2.0</app-license-type-code>
+ <app-license-uri/>
+ <breadcrumb-label>eXist Documentation</breadcrumb-label>
+ <data-collection>data</data-collection>
+ <app-icon-path>resources/images/exist-logo.png</app-icon-path>
+ <main-menu-order>12</main-menu-order>
+ <include-in-search-indicator>true</include-in-search-indicator>
+ <doc-root-namespace>" rel="nofollow">http://docbook.org/ns/docbook</doc-root-namespace>
+ <doc-root-path>section</doc-root-path>
+ <doc-id-path>@xml:id/string()</doc-id-path>
+ <doc-title-path>title/text()</doc-title-path>
+ <list-items-uri>views/list-documents.xq</list-items-uri>
+ <doc-viewer-path>views/view-doc.xq?type=xhtml&id=</doc-viewer-path>
+ <search-order-weight>5</search-order-weight>
+ <app-notes-text>In development</app-notes-text>
+ <app-help-uri>help/index.xq</app-help-uri>
+ <include-in-new-indicator>true</include-in-new-indicator>
+ <classifiers>
+ <classifier>documentation</classifier>
+ <classifier>system documentation</classifier>
+ <classifier>tutorials</classifier>
+ </classifiers>
+ <permissions>
+ <!-- Note: by default, admin will have all permissions -->
+ <permission>
+ <role>developer</role>
+ <action>edit</action>
+ </permission>
+ <permission>
+ <role>editor</role>
+ <action>edit</action>
+ </permission>
+ <permission>
+ <role>content-approver</role>
+ <action>publish</action>
+ </permission>
+ <permission>
+ <role>auditor</role>
+ <action>view</action>
+ </permission>
+ </permissions>
+</app-info>
\ No newline at end of file
Added: apps/docs/data/beginners-guide-to-xrx/beginners-guide-to-xrx-v4.xml
===================================================================
--- apps/docs/data/beginners-guide-to-xrx/beginners-guide-to-xrx-v4.xml (rev 0)
+++ apps/docs/data/beginners-guide-to-xrx/beginners-guide-to-xrx-v4.xml 2011-12-31 19:24:36 UTC (rev 15629)
@@ -0,0 +1,1375 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="http://www.oasis-open.org/docbook/xml/5.0/rng/docbook.rng" type="xml"?>
+<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="beginners-guide-to-xrx" version="5.0">
+ <info>
+ <title>A Beginners Guide to XRX with eXist</title>
+ <subtitle>A step-by-step guide for beginners to creating your first XRX application.</subtitle>
+ <author>
+ <personname>
+ <firstname>Dan</firstname>
+ <surname>McCreary</surname>
+ </personname>
+ <email>da...@sy...</email>
+ </author>
+ <author>
+ <personname>
+ <firstname>Joe</firstname>
+ <surname>Wicentowski</surname>
+ </personname>
+ <email>jo...@gm...</email>
+ </author>
+ <revhistory>
+ <revision>
+ <revnumber>1</revnumber>
+ <date>2010-03-23</date>
+ <author>
+ <personname>
+ <firstname>Dan</firstname>
+ <surname>McCreary</surname>
+ </personname>
+ </author>
+ <revdescription>
+ <para>Initial Draft</para>
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>2</revnumber>
+ <date>2010-03-30</date>
+ <author>
+ <personname>
+ <firstname>Dan</firstname>
+ <surname>McCreary</surname>
+ </personname>
+ </author>
+ <revdescription>
+ <para>Cleaned up spelling and added more detail. Added a figure for edit
+ bindings.</para>
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>3</revnumber>
+ <date>2010-03-30</date>
+ <author>
+ <personname>
+ <firstname>Joe</firstname>
+ <surname>Wicentowski</surname>
+ </personname>
+ </author>
+ <revdescription>
+ <para>Edited for clarity and style.</para>
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>4</revnumber>
+ <date>2010-04-1</date>
+ <author>
+ <personname>
+ <firstname>Dan</firstname>
+ <surname>McCreary</surname>
+ </personname>
+ </author>
+ <revdescription>
+ <para>Fixed typos and modified sections for clairity.</para>
+ </revdescription>
+ </revision>
+ </revhistory>
+ </info>
+ <section>
+ <title>Introduction</title>
+ <para>The following is a Beginner's Guide for creating a new XRX application with the
+ eXist application server. It is intended for people who are new to eXist and are
+ interested in building their first web applications. This guide demonstrates the minimal
+ code necessary to create applications that perform "CRUDS" operations. These operations
+ are: <emphasis role="bold">C</emphasis>reate, <emphasis role="bold">R</emphasis>ead (or
+ view), <emphasis role="bold">U</emphasis>pdate, <emphasis role="bold">D</emphasis>elete
+ and <emphasis role="bold">S</emphasis>earch. Creating your first XRX application can be
+ somewhat tricky since there are several structures that need to be "wired" together
+ correctly for the CRUDS components to work correctly. This example tries to use as
+ little code as possible and yet still cover many of the key components of a fully
+ functional XRX web application.</para>
+ <section>
+ <title>Intended Audience</title>
+ <para>Creating a new web application from scratch is a core skill that is necessary to
+ understand the power of the XRX web application architecture. Our experience has
+ shown that once users get an understanding of how XRX applications are constructed
+ they can quickly become productive building new web applications. They also have a
+ much better understanding of the complex portions of the XRX application and why
+ these portions are usually automated in XRX frameworks.</para>
+ <para>This document is designed for new eXist users who would like to create their first
+ XRX application. For this process we assume that you have a basic understanding of
+ XML and understand concepts such as XML elements and XPath expressions. The user
+ should also be somewhat familiar with very basic HTML markup including the structure
+ of an XHTML file and use of HTML lists and HTML tables. We will also be describing
+ how XQuery is used to create a listing of items and viewing an individual item. Users
+ should review the basic structure of an XQuery FLOWR expression (for, let, order by,
+ where, and return) and basic XQuery syntax. Familiarity with the fundamentals of
+ XForms is helpful but this guide will explain each of the XForms elements used in
+ the example.</para>
+ <para>Please note that there are several easy-to-use drag-and-drop GUI tools available
+ that can create XForms, and there are systems that can also automatically create a
+ fully functional XRX application directly from an XML Schema. But using these tools
+ and frameworks hide much of the inner workings of an XRX application. So this
+ tutorial is for those that want to have a clear understanding of how XRX systems
+ work.</para>
+ </section>
+ <section>
+ <title>Getting Started</title>
+ <para>To use this guide you will need to have following tools in place: <orderedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">eXist</emphasis> You will need to have a version
+ of the <ulink url="http://exist-db.org">eXist</ulink> XML application server running on your local
+ system. By default eXist runs on port 8080 so that when you set your web
+ browser to http://localhost:8080/exist/ you should see the eXist
+ homepage come up. You can also run this tutorial on any remote eXist
+ server. If you are doing this you must replace the word "localhost" with
+ the name of your remote server. Make sure that you take into account the
+ port number; it might not be 8080, or it may be missing, which implies
+ that the port number is the default port 80.</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">XML and XQuery Editor</emphasis> You will need
+ some tool to edit XML and XQuery files. We strongly encourage you to use
+ a tool, such as the oXygen XML Editor, since this tool has special
+ additions to make editing XML and XQuery files easy. Simple text editors
+ such as Microsoft Notepad will work but will not give you immediate
+ feedback when there are syntax errors in your files. The XML and XQuery
+ syntax highlighting feature of editors like oXygen is very useful when
+ you are first learning an new programming system. Since there are 30-day
+ free trials of many tools we strongly encourage new users to use good
+ XML editors.</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">File Uploader</emphasis> You will need some tool
+ to transfer your files directly to eXist. Tools like oXygen can save
+ directly to the eXist database, or you can also use a WebDAV client to
+ copy the files. There are also web uploader tools in the eXist admin
+ area and there are custom versions that also allow you to upload and
+ expand an entire ZIP file within the database. As a final option, you
+ can also use the eXist Java console to upload files.</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">XForms</emphasis> You will need some XForms client
+ libraries. This example will use the XSLTForms client which is usually
+ installed in /db/xforms/xsltforms. You do not have to use libraries that
+ are in the eXist database but this is sometimes preferable.</para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </section>
+ <section>
+ <title>Terms and Concepts Used</title>
+ <para>This example will use the following terms and concepts:</para>
+ <para>
+ <termdef>
+ <emphasis role="bold">XRX</emphasis>
+ </termdef>XRX is the name of the web application architecture that we are
+ introducing in this guide. The term XRX comes from the combination of XForms, REST,
+ and XQuery. XForms are used in the client (web browser), REST is the interface
+ between the client and the server, and XQuery is the server language. Two of the
+ most significant advantages of XRX over other architectures are: (1) it does not
+ require users to translate data into Java or .Net objects, and (2) it does not
+ require users to "shred" documents into rows of a relational database.</para>
+ <para>
+ <termdef>
+ <emphasis role="bold">XForms</emphasis>
+ </termdef> is a W3C standard consisting of set of around 25 XML tags that are used
+ to define the structure of a web from. XForms is much more advanced than traditional
+ HTML forms, but can appear intimidating to the first time user. However, most simple
+ forms need only a few control types, and these can be quickly learned. XForms bind
+ user interface controls to each leaf element in an XML instance. XForms stores the
+ data in a model element in the HTML HEAD tag and then binds the leaf elements in the
+ model to web input controls. </para>
+ <para>
+ <termdef>
+ <emphasis role="bold">XQuery</emphasis>
+ </termdef> is a W3C standard query language for selecting and transforming XML
+ structures. If you don't have programming experience, XQuery is not hard to pick up.
+ If you do have programming experience, XQuery is a little different than other
+ languages you may have used in the past. It is a "functional" programming language
+ that makes it very easy to create robust server-side programs -- programs that do
+ not have many of the "side-effects" of other languages. It is similar to the SQL
+ language in some ways, but it is specifically designed for XML structures. Paired
+ with an XML database like eXist, XQuery is an ideal language for creating web
+ applications. eXist's highly efficient indexing abilities make full text searches
+ and other queries very fast, even when working with gigabytes of XML data. </para>
+ <sidebar>
+ <para>
+ <emphasis role="bold">Note for New XQuery Users</emphasis>. There are some
+ things that are very different in XQuery that you should be aware of. In
+ general, all XQuery variables are <emphasis role="italic">immutable</emphasis>,
+ meaning that they are designed to be set once but never changed. So functions
+ like let $x := $x + 1 within loops will not increment like in procedural
+ languges. There are also restrictions on what can be done inside FLOWR
+ statements. We will illustrate these in examples in future Beginner's
+ Guides.</para>
+ </sidebar>
+ <para>
+ <termdef>
+ <emphasis role="bold">REST</emphasis>
+ </termdef> is at the heart of the architecture of the World Wide Web. We use this
+ "RESTful" approach to passing information around in our XRX application by simply
+ placing parameters at the end of a URL. For example, to pass a query keyword to a
+ our XRX application search service, our form appends the parameter q=myword to the
+ URL: search.xq?q=myword. If you have ever used a SOAP architecture, REST is a breath
+ of fresh air. No complex SOAP interface testing tools are required. All you need to
+ test your web services is a web browser. For example the home page of the test
+ application under the default configuration will be
+ http://localhost:8080/exist/<emphasis role="bold">rest</emphasis>/db/apps/term/index.html. Note that the word "rest" comes after the
+ /exist/ and before the /db/.</para>
+ <para>Several additional terms and concepts are helpful in understanding the XRX
+ approach:</para>
+ <para>
+ <termdef>
+ <emphasis role="bold">WebDAV</emphasis>
+ </termdef> is a protocol for transfering files, and we use eXist's WebDAV interface
+ to move files to and from eXist and to list files in eXist collections. If you want
+ to add a folder to eXist you can do this through the WebDAV interface. When you use
+ oXygen or other editors you will also use the WebDAV interface. To open a file
+ through the WebDAV interface you might open http://localhost:8080/exist/<emphasis role="bold">webdav</emphasis>/db/apps/term/</para>
+ <para>
+ <termdef>
+ <emphasis role="bold">Model-View Bindings</emphasis>
+ </termdef> is the term we use to describe how user interface elements (controls)
+ within a form are associated with leaf-level elements within the XForms model. This
+ is similar to the Model-View-Controller (MVC) architecture in other systems, but in
+ the case of XForms event controls are part of the views. By using XPath statements
+ in the <emphasis role="bold">ref</emphasis> attributes for user interface controls,
+ the browser constructs a dependency graph to keep the model and views in sync. This
+ makes forms development much easier since the form developer never needs to manually
+ move data between the model and the views.</para>
+ <para>
+ <termdef>
+ <emphasis role="bold">Convention over Configuration</emphasis>
+ </termdef> is a common practice among modern web application frameworks like XRX of
+ using conventions such as standardized collection and file names, to reduce the
+ amount of configuration and thereby reduce the complexity and time required to
+ prototype and complete applications. Of course, users have the ability to change
+ these conventions, but they then take responsiblity for maintaining their own
+ adaptations or separate frameworks. </para>
+ </section>
+ </section>
+ <section>
+ <title>Collection and File Conventions</title>
+ <para>The first convention of XRX applications involves the data collections and files that
+ will structure our application. Although you do not have to use the collection
+ conventions used in this example, you will find that many frameworks that use this
+ convention will be much easier to build and maintain. </para>
+ <para>Here are the standards we strongly recommend you use for your first
+ application:</para>
+ <orderedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Apps</emphasis> All XRX applications should be grouped in
+ a single collection. For example <emphasis role="bold">/db/apps</emphasis> or
+ <emphasis role="bold">/db/org/mycompany/apps</emphasis>. The exact location
+ of the apps collection in the databases is not relevant, but all apps should be
+ stored together in a collection called apps.</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">App</emphasis> Each XRX application should be grouped in a
+ collection. This collection name should reflect the function of the application.
+ For example our business term application might be stored in the <emphasis role="bold">/db/apps/terms</emphasis> collection. The convention is to use
+ the plural ("terms" rather than "term") for the primary kind of content being
+ stored in the app.</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Data</emphasis> Each XRX application should store its data
+ in a separate data collection. For example our term manager application will
+ store all the data in /db/apps/terms/data. In this example the first term will
+ be stored in the file <emphasis role="bold">1.xml</emphasis> and the second in
+ the file <emphasis role="bold">2.xml</emphasis> etc. When the user saves new
+ terms we can increment a counter to add a new term.</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Views</emphasis> Each XRX application should store
+ read-only views of the data in a <emphasis role="bold">views</emphasis>
+ collection. In our example our term manager will store read-only views of the
+ data in the <emphasis role="bold">/db/term/apps/terms/views</emphasis>
+ collection. Note that views are all functions that transform but do not alter
+ the original XML data. Views collectons are usually visible to all users that
+ have read (not edit) access to data. Views do not need to worry about locking
+ records to prevent missing updates. Tools that do change or edit the data can be
+ stored in another collection such as <emphasis role="bold">edit</emphasis>. This
+ allows access control systems to limit who changes or deletes data.</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Edit</emphasis> Each XRX application should store its edit
+ functions in a collection called edit. For our term manager application this
+ would be <emphasis role="bold">/db/apps/term/edit</emphasis>. Edit function
+ include saving new terms, updating terms and deleting terms. By grouping all
+ edit functions together it is easy to deny access to users that do not have
+ permission to change items and to create consistent logging functions for audit
+ trails.</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Search</emphasis> Each XRX application should store its
+ search functions in a collection called <emphasis role="bold">search</emphasis>.
+ For our term manager application this would be <emphasis role="bold">/db/apps/term/search</emphasis>. There are two functions stored here. A
+ simple HTML search form (search.html) and a RESTful search (service.xq).
+ Advanced applications sometimes combine these functions into a single XQuery
+ that generates HTML. (In addition to these two search functions, an additional
+ configuration file must be stored in the <emphasis role="bold">/db/system/config/db/apps/terms/data</emphasis> collection that describes
+ how the files are indexed for search.)</para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">AppInfo</emphasis> Each XRX application should store
+ information that pertains to the application in an XML file within the main
+ application collection. By convention this file is called the app-info.xml file.
+ Information such as the application name, description, author, version, license,
+ dependencies, etc. should be stored in this file. This tutorial will not cover
+ this file's structure, but you may see it in many of the sample programs. This
+ will be covered in other XRX Beginners Guides.</para>
+ </listitem>
+ </orderedlist>
+ <para>You are always free to change the names of the collection or the queries, but as
+ mentioned above, you will have to take responsibility for your own frameworks, and you
+ may lose some of the benefit of using the common conventions. The reason for using a
+ generic file name such as <emphasis role="bold">list-items.xq</emphasis> instead of a
+ filename that reflects the data, such as <emphasis role="bold">list-terms.xq</emphasis>,
+ may not be clear to you at first, but as you will see later, this more general file
+ naming convention has it merits when many applications are being managed. </para>
+ </section>
+ <section>
+ <title>Example Data: Business Terms</title>
+ <para>In this example we will use a simple registry of business terms that might be used in
+ a glossary of terms on a web site. Each term will have (1) a numeric ID, (2) a term
+ name, (3) a definition, and (4) a publish-status code of "draft," "under-review," or
+ "published."</para>
+ <para>To illustrate this structure, the following is a sample XML file for one of our terms:
+ <programlisting><term>
+ <id>1</id>
+ <term-name>Declarative Programming</term-name>
+ <definition>A style of programming that allows users to declare their requirements (what they
+ want done) and leave out the details of how the function should be performed.</definition>
+ <publish-status-code>published</publish-status-code>
+</term></programlisting>
+ </para>
+ <para> We will create an application that will allow users to edit these terms on a simple
+ form that will use a simple input field for the name, a text area for the definition,
+ and a selection list for the status codes.</para>
+ </section>
+ <section>
+ <title>Views</title>
+ <para>We will create two XQuery services for our initial XRX application. The first is a
+ simple XQuery that will list all the terms in our data collection that have the root
+ element, "term." The second is an XQuery function that shows an individual term. The
+ second requires a single parameter which is the ID of the term. We will allow the user
+ to drill down to see an individual term by first viewing a list of all the term in a
+ collection.</para>
+ <section>
+ <title>Listing Items</title>
+ <para>Our first task will be to create a simple XQuery program that will list all the
+ terms in our collection in an HTML file. To do this we will us a simple XQuery FLOWR
+ loop that gets each of there terms in the collection in succession and then converts
+ the XML into a HTML list item using the <li></li> tags. The convention
+ to use in this example is the file name list-items.xq.</para>
+ <para>
+ <emphasis role="bold">/db/apps/terms/views/list-items.xq:</emphasis>
+ </para>
+ <para>
+ <programlisting>xquery version "1.0";
+
+declare option exist:serialize "method=xhtml media-type=text/html indent=yes";
+
+<html>
+ <head>
+ <title>Glossary of Terms</title>
+ </head>
+ <body>
+ <h1>Terms</h1>
+ <ol>{
+ for $term in collection('/db/apps/terms/data')/term
+ let $term-name := $term/term-name/text()
+ order by $term-name
+ return
+ <li>{$term-name}</li>
+ }</ol>
+ </body>
+</html></programlisting>
+ </para>
+ <para>This produces the following output:</para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/list-items-no-links.png" contentwidth="200"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>There are few items to note. First note that we use the collection function to
+ specify what data is being listed. We also return only items in the data collection
+ that have term as their root element. This allows us to put other data types within
+ the data collection without disrupting this report.</para>
+ <para>Our next step is to change each of the items listed into HTML links so that we can
+ view each individual item on a separate HTML page. To do this we change the
+ <li>{$term-name}</li> to be the following code:</para>
+ <para>
+ <programlisting><li><a href="view-item.xq?id={$term/id/text()}">{$term-name}</a></li></programlisting>
+ </para>
+ <para>This produces the following output:</para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/list-items-links.png" contentwidth="200"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>This has the effect of taking each term's ID and using it as a RESTful parameter,
+ so that when a user selects this link, the link to the view-item.xq query will
+ include the ID, and the query will know which term to display. We will use this same
+ technique many times. Note that this uses a relative path to the view-item.xq
+ program. So it is important to keep both the list items and the view items in the
+ same collection for this to work correctly.</para>
+ <para>Note that this list items works fine as long as we have just a few hundred terms.
+ But as your collections get longer (usually above a few hundred items) you will want
+ to create a list items query that only lists the first 30 or so items and then has a
+ "next" button to get more items. This will be covered in another section (see
+ "Pagination in XQuery").</para>
+ </section>
+ <section>
+ <title>Viewing an Individual Item</title>
+ <para>Now that we have a list of all the items in a collection we are ready to drill
+ down to a specific item and see all of the information about a single item. By
+ convention this is done by an XQuery file called "view-item.xq". The item viewer
+ takes a single parameter that is the ID of the item. It has to perform a query on
+ all the items in the data collection to find only the item you are looking for. This
+ is done by adding a "predicate" or "where clause" to the query. In general we prefer
+ predicates because they are faster for eXist to process. The predicate that selects
+ our desired term appears in the square brackets in the following expression:</para>
+ <para>
+ <programlisting>let $term := collection('/db/apps/terms/data')/term[id='5']</programlisting>
+ </para>
+ <para>Note that the predicate [id='5'] indicates to the system that only a term with an
+ ID of 5 should be returned. (Also note the quotes surrounding '5', which indicate
+ that we are doing simple string comparison, and not treating the ids as
+ integers.)</para>
+ <para>Our next step is to get the parameter from the URL to select the correct item.
+ This is done by using the function request:get-parameter(). We then display all the
+ elements of the term using one element per line. Here is what the source of the
+ list-item.xq file looks like: </para>
+ <para>
+ <emphasis role="bold">/db/apps/terms/views/view-item.xq</emphasis>
+ <programlisting>xquery version "1.0";
+
+declare option exist:serialize "method=xhtml media-type=text/html indent=yes";
+
+let $id := request:get-parameter("id", "")
+let $term := collection('/db/apps/terms/data')/term[id=$id]
+
+return
+<html>
+ <head>
+ <title>Term {$term/id/text()}</title>
+ </head>
+ <body>
+ <h1>Term {$term/id/text()}</h1>
+ <b>Term ID: </b> {$term/id/text()}<br/>
+ <b>Term Name: </b> {$term/term-name/text()}<br/>
+ <b>Term Definition: </b> {$term/definition/text()}<br/>
+ <b>Term Status: </b> {$term/publish-status-code/text()}<br/>
+ </body>
+</html></programlisting>
+ </para>
+ <para>This produces the following output:</para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/view-item.png" contentwidth="400"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ </section>
+ <section>
+ <title>Searching Items</title>
+ <para>There are three items that we create to support search functions. These items are
+ the:<orderedlist>
+ <listitem>
+ <para>An HTML search form</para>
+ </listitem>
+ <listitem>
+ <para>A RESTful search service</para>
+ </listitem>
+ <listitem>
+ <para>A configuration file for defining the indexes</para>
+ </listitem>
+ </orderedlist>
+ There are two types of indexes we will create. Structural indexes
+ are configured to work with specific XML structures such as IDs. Fulltext indexes are used by
+ eXist to make keyword searches very fast. These both work by indexing new content and optimizing the indexes
+ for fast retrieval. Queries can run quickly and efficiently against the indexex rather
+ than iterating through the files in the collection. In addition to these three files we
+ also have a script that reindexes the collection of terms.</para>
+ <section>
+ <title>Search Configuration File</title>
+ <para>The following is a search configuration file that we store in the collection
+ <emphasis role="bold">/db/system/config/db/apps/term/data</emphasis>.</para>
+ <para>
+ <emphasis role="bold">/db/system/config/db/apps/term/data/collection.xconf</emphasis>
+ </para>
+ <para>
+ <programlisting><collection xmlns="http://exist-db.org/collection-config/1.0">
+ <index>
+ <!-- Disable the standard full text index -->
+ <fulltext default="none" attributes="no"/>
+
+ <!-- Range index configuration on the id attribute -->
+ <!-- Most ids are integers but we will keep this general <create qname="id" type="xs:int"/> -->
+ <create qname="id" type="xs:string"/>
+
+ <!-- Lucene index configuration -->
+
+ <lucene>
+ <!-- Use the standard analyzer will ignore stopwords like 'the', 'and' -->
+ <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
+
+ <!-- an index boost can be used to give matches in the
+ name a higher score. This means a name match will have higher rank then
+ an match in the definition. -->
+ <text match="//term/term-name" boost="2"/>
+ <text match="//term/definition"/>
+ <text match="//term/publish-status-code"/>
+ </lucene>
+ </index>
+</collection></programlisting>
+ </para>
+ <para>This configuration file creates an index for the term ID for fast searching. It
+ also creates a Lucene fulltext index for all elements in the term.</para>
+ </section>
+ <section>
+ <title>Reindexing</title>
+ <para>After you have created or modified your configuration file you must reindex any
+ data that you have. This can be done by pasting the following two lines into the
+ XQuery sandbox:</para>
+ <para>
+ <emphasis role="bold">Paste the following lines into the XQuery Sandbox, replacing
+ 'myadminpassword' with your eXist admin password, to reindex the
+ collection:</emphasis>
+ </para>
+ <para>
+ <programlisting>xmldb:login('/db/apps/terms/data', 'admin', 'myadminpassword'),
+xmldb:reindex('/db/apps/terms/data')</programlisting>
+ </para>
+ <para>If you are not familiar with the eXist sandbox you can also run the following
+ XQuery script. It is stored in the app's admin collection. The script will login as
+ the administrator and then run the reindex function on the collection. It also
+ returns the time it took to reindex the collection. For collections that are under
+ 1,000 medium sized 10K byte documents, this script usually runs in a few seconds.
+ Tools are available for larger collections to schedule indexing during off hours
+ with the eXist job scheduler.</para>
+ <para>
+ <emphasis role="bold">/db/apps/terms/admin/reindex.xq</emphasis>
+ </para>
+ <para>
+ <programlisting>xquery version "1.0";
+
+declare option exist:serialize "method=xhtml media-type=text/html indent=yes";
+
+let $data-collection := '/db/apps/terms/data'
+
+let $login := xmldb:login($data-collection, 'admin', 'myadminpassword')
+let $start-time := util:system-time()
+let $reindex := xmldb:reindex($data-collection)
+let $runtime-ms := ((util:system-time() - $start-time)
+ div xs:dayTimeDuration('PT1S')) * 1000
+
+return
+<html>
+ <head>
+ <title>Reindex</title>
+ </head>
+ <body>
+ <h1>Reindex</h1>
+ <p>The index for {$data-collection} was updated in
+ {$runtime-ms} milliseconds.</p>
+ <a href="../index.html">App Home</a>
+ </body>
+</html></programlisting>
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reindex-result.png" contentwidth="400"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section>
+ <title>The Search Form</title>
+ <para>The search form is a simple HTML form with one text field input and one submit
+ button. The action of this form will use the value in the input field and send the
+ field in the q parameter to the search service.</para>
+ <para>
+ <emphasis role="bold">/db/apps/terms/tsearch/search-form.html</emphasis>
+ </para>
+ <para>
+ <programlisting><html>
+ <head>
+ <title>Search Terms</title>
+ </head>
+ <body>
+ <h2>Search Terms</h2>
+ <form method="GET" action="search.xq">
+ <b>Search:</b>
+ <input name="q" type="text" value="" size="30"/>
+ <input type="submit" value="Search"/>
+ </form>
+ </body>
+</html></programlisting>
+ </para>
+ <para>The following image shows a blank search screen form. To perform a search, the
+ user simply enters one or more keywords into the search form and selects the search
+ button (or enter key).</para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/search.png" contentwidth="300"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>If you put a keyword in the input field the following URL will get
+ generated:</para>
+ <para>
+ <programlisting>/db/apps/terms/search/search.xq?q=mykeyword</programlisting>
+ </para>
+ </section>
+ <section>
+ <title>The Search Service</title>
+ <para>The search service is an XQuery script that calls the fulltext search
+ function.</para>
+ <para>
+ <emphasis role="bold">/db/apps/terms/search/search.xq</emphasis>
+ </para>
+ <para>
+ <programlisting>xquery version "1.0";
+
+declare option exist:serialize "method=xhtml media-type=text/html indent=yes";
+
+let $data-collection := '/db/apps/terms/data'
+let $q := request:get-parameter('q', "")
+
+(: put the search results into memory using the eXist any keyword ampersand equals comparison :)
+let $search-results := collection($data-collection)/term[ft:query(*, $q)]
+let $count := count($search-results)
+
+return
+<html>
+ <head>
+ <title>Term Search Results</title>
+ </head>
+ <body>
+ <h3>Term Search Results</h3>
+ <p><b>Search results for:</b>&quot;{$q}&quot; <b> In Collection: </b>{$data-collection}</p>
+ <p><b>Terms Found: </b>{$count}</p>
+ <ol>{
+ for $term in $search-results
+ let $id := $term/id
+ let $term-name := $term/term-name/text()
+ order by upper-case($term-name)
+ return
+ <li>
+ <a href="../views/view-item.xq?id={$id}">{$term-name}</a>
+ </li>
+ }</ol>
+ <a href="search-form.html">New Search</a>
+ <a href="../index.html">App Home</a>
+ </body>
+</html></programlisting>
+ </para>
+ </section>
+ <section>
+ <title>Search Results</title>
+ <para>The form will then pass the search keyword(s) to the search service. The search
+ service will return a series of search results, with one result per hit. Each result
+ is also a link to the item-viewer service.</para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/search-results.png" contentwidth="300"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ </section>
+ <!-- end of search section -->
+ <section>
+ <title>Editing</title>
+ <para>Editing data is the most complex portion of building an XRX application. We must
+ create a form for users to edit the data, and create queries that take the form data and
+ write it to the database. Because of the complexity of creating these interfaces,
+ advanced XRX frameworks attempt to automate this process by generating all of the
+ required files. However, this sample "business terms" app is simple enough for the
+ purposes of this tutorial.</para>
+ </section>
+ <section>
+ <title>The Edit Query</title>
+ <para>The Edit query is the most complex file in this application. It must perform saves for
+ new items as well as update operations. The following source code should be studied
+ carefully since many of the techniques used in the form will be used in more complex
+ forms. </para>
+ <section>
+ <title>Model-View-Binding</title>
+ <para>To understand how the edit.xq script works it is first important to understand how
+ the XForms standard uses Model-View-Binding to associate a user interface control
+ with an XML instance inside the model. This is illustrated in the figure
+ below.</para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/model-view-bindings.png" contentwidth="400"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para> In the form the XML data that the form modifies is loaded into an <emphasis role="bold"><xs:instance></emphasis> element within the <emphasis role="bold"><xf:model></emphasis>. This is specified using the <emphasis role="bold">src</emphasis> attribute. Inside the body of the form each of the user
+ interface controls (an output, input, textarea and select1 control) each have a
+ <emphasis role="bold">ref</emphasis> attribute. This attribute contains the
+ XPath expression of the element it corresponds to within the model.</para>
+ <para>
+ <emphasis role="bold">/db/apps/terms/edit/edit.xq</emphasis>
+ </para>
+ <para>
+ <programlisting>xquery version "1.0";
+
+declare option exist:serialize "method=xhtml media-type=text/xml indent=yes process-xsl-pi=no";
+
+let $new := request:get-parameter('new', '')
+let $id := request:get-parameter('id', '')
+let $data-collection := '/db/apps/terms/data'
+
+(: Put in the appropriate file name. Use new-instance.xml for new forms and get the data
+ from the data collection all updates. :)
+let $file := if ($new) then
+ 'new-instance.xml'
+ else
+ concat('../data/', $id, '.xml')
+
+let $form :=
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xf="http://www.w3.org/2002/xforms"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:ev="http://www.w3.org/2001/xml-events" >
+ <head>
+ <title>Edit Item</title>
+ <style type="text/css">
+ <![CDATA[
+ @namespace xf url("http://www.w3.org/2002/xforms");
+
+ body {
+ font-family: Helvetica, Ariel, Verdana, sans-serif;
+ }
+
+ .term-name .xforms-value {width: 50ex;}
+ .definition .xforms-value {
+ height: 5em;
+ width: 600px;
+ }
+
+ /* align the labels but not the save label */
+ xf|output xf|label, xf|input xf|label, xf|textarea xf|label, xf|select1 xf|label {
+ display: inline-block;
+ width: 14ex;
+ text-align: right;
+ vertical-align: top;
+ margin-right: 1ex;
+ font-weight: bold;
+ }
+
+ xf|input, xf|select1, xf|textarea, xf|ouptut {
+ display: block;
+ margin: 1ex;
+ }
+ ]]>
+ </style>
+ <xf:model>
+ <xf:instance xmlns="" src="{$file}" id="save-data"/>
+ <xf:submission id="save" method="post" action="{if ($new='true') then ('save-new.xq') else ('update.xq')}" instance="my-task" replace="all"/>
+ </xf:model>
+ </head>
+ <body>
+ <h1>Edit Term</h1>
+
+ {if ($id) then
+ <xf:output ref="id" class="id">
+ <xf:label>ID:</xf:label>
+ </xf:output>
+ else ()}
+
+ <xf:input ref="term-name" class="term-name">
+ <xf:label>Term Name:</xf:label>
+ </xf:input>
+
+ <xf:textarea ref="definition" class="definition">
+ <xf:label>Definition:</xf:label>
+ </xf:textarea>
+
+ <xf:select1 ref="publish-status-code">
+ <xf:label>Status:</xf:label>
+ <xf:item>
+ <xf:label>Draft</xf:label>
+ <xf:value>draft</xf:value>
+ </xf:item>
+ <xf:item>
+ <xf:label>Under Review</xf:label>
+ <xf:value>review</xf:value>
+ </xf:item>
+ <xf:item>
+ <xf:label>Published</xf:label>
+ <xf:value>published</xf:value>
+ </xf:item>
+ </xf:select1>
+
+ <xf:submit submission="save">
+ <xf:label>Save</xf:label>
+ </xf:submit>
+ </body>
+</html>
+
+let $xslt-pi := processing-instruction xml-stylesheet {'type="text/xsl" href="/exist/rest/db/xforms/xsltforms/xsltforms.xsl"'}
+
+return ($xslt-pi, $form)</programlisting>
+ </para>
+ <para>Note that this form does "double duty" as both a form for new items as well as a form
+ for updating existing items. The <emphasis role="bold">new=true</emphasis> parameter
+ must always be passed to the form when creating a new item. Production systems check for
+ these parameters and return error codes if one or the other is not passed to the
+ form.</para>
+ <para>All XForms hold the form data in the <emphasis role="bold"><xf:model></emphasis>
+ element. This form uses a single <emphasis role="bold"><xf:instance></emphasis>
+ within the model to store the data that will saved when the users selects the "Save"
+ button. The save button in XForms is called the <emphasis role="bold"><xf:submit></emphasis> element. It has a single attribute called the
+ submission attribute that is associated with an <emphasis role="bold"><xf:submission></emphasis> element within the model. In our example above the
+ name of the submission element (its id) is <emphasis role="bold">save</emphasis>. The
+ save submission element is responsible for sending the data from the XForms client to a
+ specific service on the server. In the example above there are two slightly different
+ XQuery services, one for saving new items and one for updating existing items. We will
+ be covering the save-new and the update queries later in this tutorial.</para>
+ <para>The query that is used is wrapped inside of the action attribute of the save
+ submission. Here is that code: </para>
+ <para>
+ <programlisting>action="{if ($new='true') then
+ 'save-new.xq'
+else
+ 'update.xq'
+}"</programlisting>
+ </para>
+ <para>You can see that if the user is creating a new item the data is sent via an HTTP POST
+ to the save-new.xq script. If the user does not have a new item the POST data is sent to
+ the update.xq script.</para>
+ <para>Although we could have used a single save.xq script this structure allows you to
+ trigger different behavior for different functions you may want. For example the
+ save-new.xq might also trigger an e-mail notification when new records are saved for the
+ first time, or a versioning routine might be triggeed only when the file is updated.
+ Advanced user guides will have examples of both of these functions.</para>
+ <para>The next section of code to notice is that the ID element is only displayed using a
+ read-only <emphasis role="bold"><xf:output></emphasis> element if the form is in
+ update mode.</para>
+ <para>
+ <programlisting>if ($id) then
+ <xf:output ref="id" class="id">
+ <xf:label>ID:</xf:label>
+ </xf:output>
+else ()</programlisting>
+ </para>
+ <para>This shows some of the power of combining XQuery and XForms. In this case we are using
+ logic on the server to conditionally include portions of the form based on the context.
+ The process of using context such as mode, user, group, role, and project is central to
+ understanding how forms can be dynamically created to precisely meet the needs of your
+ users. No more "one size fits all." No more forcing users to fill out field of forms
+ that are not relevant to their situation. XRX forms can all be dynamically created
+ directly as they are needed. We can use both client and server logic to determine what
+ features of the form are enabled. XForms includes a function called <emphasis role="bold"><xf:bind></emphasis> that also uses XPath expressions to determine
+ if fields should be displayed. This will also be covered in advanced tutorials.</para>
+ <para>The next item to note is that there are four different user interface controls in this
+ form. The first one is a read-only output. The second is the <emphasis role="bold"><xf:input></emphasis> control that gathers input in a single line. The third
+ is a <emphasis role="bold"><xf:textarea></emphasis> control that allows users to
+ enter multi-line descriptions for definitions of terms. The last control is the
+ <emphasis role="bold"><xf:select1></emphasis> control that allows the user to
+ select one value from a list of values. (For a complete discussion of the XForms
+ controls we suggest you use the XForms Wikibook at <link xlink:href="http://en.wikibooks.org/wiki/XForms." rel="nofollow">http://en.wikibooks.org/wiki/XForms">http://en.wikibooks.org/wiki/XForms</link>. The Input Form Controls section goes
+ through each of the controls in the XForms specification. In addition to the standard
+ controls there are other controls that can also be integrated directly into XForms such
+ as rich-text editors.)</para>
+ <para>Each of the input controls has a <emphasis role="bold">ref</emphasis> attribute that
+ indicates what element in the instance it is bound to. If you have multiple instances
+ and m...
[truncated message content] |
|
From: <dmc...@us...> - 2011-12-31 16:16:52
|
Revision: 15628
http://exist.svn.sourceforge.net/exist/?rev=15628&view=rev
Author: dmccreary
Date: 2011-12-31 16:16:44 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
Added more data and did some cleanup on the main style sheet. Moved the template index.xml into the unit-test collection.
Modified Paths:
--------------
apps/docs/data/authors.xml
apps/docs/data/style.xml
apps/docs/modules/style.xqm
Added Paths:
-----------
apps/docs/admin/
apps/docs/data/external-image-ref-test/
apps/docs/data/external-image-ref-test/external-image-reference-test.xml
apps/docs/data/external-image-ref-test/images/
apps/docs/data/external-image-ref-test/images/three-circles.svg
apps/docs/data/typeswitch-tutorial/
apps/docs/data/typeswitch-tutorial/images/
apps/docs/data/typeswitch-tutorial/images/dispatch-pattern.png
apps/docs/data/typeswitch-tutorial/typeswitch-transforms.xml
apps/docs/modules/util2.xqm
apps/docs/resources/images/Thumbs.db
apps/docs/resources/images/glyphish-icons/Thumbs.db
apps/docs/unit-tests/
apps/docs/unit-tests/index.xq
apps/docs/unit-tests/james-hambley-page-design-template.html
Modified: apps/docs/data/authors.xml
===================================================================
--- apps/docs/data/authors.xml 2011-12-31 16:14:46 UTC (rev 15627)
+++ apps/docs/data/authors.xml 2011-12-31 16:16:44 UTC (rev 15628)
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.oxygenxml.com/docbook/xml/5.0/rng/dbsvg.rng" type="xml"?>
-<section xmlns="http://docbook.org/ns/docbook" version="5.0">
+<section xmlns="http://docbook.org/ns/docbook" xml:id="person-ids" version="5.0" status="draft">
+ <title>Authors Index</title>
+ <subtitle>A list of authors of these documents.</subtitle>
<info>
- <title>Authors</title>
<authorgroup>
<editor xml:id="person-id.loren.cahlander">
<personname>
@@ -22,5 +23,6 @@
</editor>
</authorgroup>
</info>
- <simpara/>
+ <para>Use to associate an author information with a person ID. All documents can reference
+ the person ID and will not have to be updated if the e-mail changes.</para>
</section>
\ No newline at end of file
Added: apps/docs/data/external-image-ref-test/external-image-reference-test.xml
===================================================================
--- apps/docs/data/external-image-ref-test/external-image-reference-test.xml (rev 0)
+++ apps/docs/data/external-image-ref-test/external-image-reference-test.xml 2011-12-31 16:16:44 UTC (rev 15628)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="http://www.oxygenxml.com/docbook/xml/5.0/rng/dbsvg.rng" type="xml"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="external-image-reference-test">
+ <title>Image References</title>
+ <section>
+ <title>Section1 Title</title>
+ <para>An figure with an SVG graphic:</para>
+ <figure>
+ <title>Sample Title</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata>
+ <svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="3cm" height="3cm" viewBox="0 0 400 400">
+ <svg:g style="fill-opacity:0.7; stroke:black; stroke-width:0.1cm;">
+ <svg:circle cx="6cm" cy="2cm" r="100" style="fill:red;" transform="translate(0,50)"/>
+ <svg:circle cx="6cm" cy="2cm" r="100" style="fill:blue;" transform="translate(70,150)"/>
+ <svg:circle cx="6cm" cy="2cm" r="100" style="fill:green;" transform="translate(-70,150)"/>
+ </svg:g>
+ </svg:svg>
+ </imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section>
+ <title>Section1 Title</title>
+ <para>An figure with an SVG graphic:</para>
+ <figure>
+ <title>Sample Title</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata>
+ <svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="3cm" height="3cm" viewBox="0 0 400 400">
+ <svg:g style="fill-opacity:0.7; stroke:black; stroke-width:0.1cm;">
+ <svg:circle cx="6cm" cy="2cm" r="100" style="fill:red;" transform="translate(0,50)"/>
+ <svg:circle cx="6cm" cy="2cm" r="100" style="fill:blue;" transform="translate(70,150)"/>
+ <svg:circle cx="6cm" cy="2cm" r="100" style="fill:green;" transform="translate(-70,150)"/>
+ </svg:g>
+ </svg:svg>
+ </imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para> Image reference<inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="../../../../../../tmp/images/dispatch-pattern.png"/>
+ </imageobject>
+ </inlinemediaobject>
+ </para>
+ </section>
+</section>
\ No newline at end of file
Added: apps/docs/data/external-image-ref-test/images/three-circles.svg
===================================================================
--- apps/docs/data/external-image-ref-test/images/three-circles.svg (rev 0)
+++ apps/docs/data/external-image-ref-test/images/three-circles.svg 2011-12-31 16:16:44 UTC (rev 15628)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="3cm" height="3cm" viewBox="0 0 400 400">
+ <desc/>
+ <g style="fill-opacity:0.7; stroke:black; stroke-width:0.1cm;">
+ <circle cx="6cm" cy="2cm" r="100" style="fill:red;" transform="translate(0,50)"/>
+ <circle cx="6cm" cy="2cm" r="100" style="fill:blue;" transform="translate(70,150)"/>
+ <circle cx="6cm" cy="2cm" r="100" style="fill:green;" transform="translate(-70,150)"/>
+ </g>
+</svg>
\ No newline at end of file
Modified: apps/docs/data/style.xml
===================================================================
--- apps/docs/data/style.xml 2011-12-31 16:14:46 UTC (rev 15627)
+++ apps/docs/data/style.xml 2011-12-31 16:16:44 UTC (rev 15628)
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen SCHSchema="../resources/schemas/docbook.xsd" type="xml"?>
-<section xmlns="http://docbook.org/ns/docbook" xml:id="style" version="5.0">
+<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="style-guide" version="5.0" status="draft">
<info>
<revhistory>
<revision>
<date/>
- <author xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/docs/author.xq?p=loren.cahlander"/>
+ <author xlink:href="/docs/author.xq?p=loren.cahlander"/>
<revdescription/>
</revision>
</revhistory>
@@ -15,6 +15,7 @@
</keywordset>
</info>
<title>eXist DocBook Style Guide</title>
+ <subtitle>An guide to what elements should be used in eXist documentation.</subtitle>
<para/>
<section>
<title>Revision History and Keywords</title>
Added: apps/docs/data/typeswitch-tutorial/images/dispatch-pattern.png
===================================================================
(Binary files differ)
Property changes on: apps/docs/data/typeswitch-tutorial/images/dispatch-pattern.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: apps/docs/data/typeswitch-tutorial/typeswitch-transforms.xml
===================================================================
--- apps/docs/data/typeswitch-tutorial/typeswitch-transforms.xml (rev 0)
+++ apps/docs/data/typeswitch-tutorial/typeswitch-transforms.xml 2011-12-31 16:16:44 UTC (rev 15628)
@@ -0,0 +1,506 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="http://www.oxygenxml.com/docbook/xml/5.0/rng/dbsvg.rng" type="xml"?>
+<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="typeswitch-transforms" version="5.0" status="draft">
+ <title>Typeswitch Transforms</title>
+ <subtitle>Transforming Complex XML Documents with XQuery Typeswitch</subtitle>
+ <info>
+ <revhistory>
+ <revision>
+ <date/>
+ <author xlink:href="/docs/author.xq?p=dan.mccreary">
+ <personname/>
+ </author>
+ <revdescription/>
+ </revision>
+ </revhistory>
+ <keywordset>
+ <keyword>typeswitch</keyword>
+ <keyword>transform</keyword>
+ <keyword>xquery</keyword>
+ </keywordset>
+ </info>
+ <section>
+ <title>Summary</title>
+ <para> This document considers the need to perform transforms on complex XML documents.
+ These complex document include all of the "document-oriented" data formats that have
+ complex nested structures such as DocBook, TEI, Office Open XML and OpenOffice XML
+ formats. Traditionally these documents have been transformed using the XSLT language.
+ The authors feel that using XQuery typeswitch-based transforms are equal if not superior
+ to XSLT transforms for small documents and when combined with native XML systems
+ typeswitch transforms are dramatically superior for large documents or document
+ collections. </para>
+ <para> This document assumes that the reader is somewhat familiar with XML and the XQuery
+ language. Familiarity with recursion is also very helpful, although not required. </para>
+ <para> Part 1 is an introduction to the problem space and describes the need to allow
+ non-programmers the ability to build and maintain these transform and discrete
+ transformation rules. </para>
+ <para> We identify key business requirements that indicate the migration away from XSLT
+ toward XQuery typeswitch transforms: 1. transforms that span multiple documents and
+ document collections 2. the need to allow non-programmers to maintain complex
+ transformations 3. the presence of large documents 4. the need to dynamically transform
+ documents in real time based on context and business rules </para>
+ <para> We also introduce the terminology used in the rest of the article. </para>
+ <para>Part 2, the dispatch pattern, introduces the dispatch pattern and how dispatch functions written with the
+ typeswitch function can dramatically simplify the structure of complex transformations
+ and lower maintenance costs. </para>
+ <para>Part 3, migrating from XSTL to Typeswitch, compares XQuery typeswitch transforms with traditional XSLT template style
+ transforms and considers some of the pros and cons of each systems. </para>
+ <para>Part 4, Typeswitch Patters, takes a look at commaon patterns used within typesswitch transforms.</para>
+ <para>Part 5 considers the support and maintenance costs of systems that use both XQuery
+ and XSLT vs. the costs of systems written entirely in XQuery. Of primary concern is the
+ ability to train non-programmers to maintain the transformation rules using a single
+ language. </para>
+ <para>Part 6, the future of tranformation, concludes that for many organizations involved in processing complex
+ documents, the combination of native XML systems with XQuery alone (no XSLT) may be the
+ most cost effective architecture. We also look at how future tools may make the process
+ of updating rules easier for non-programmers.</para>
+ </section>
+ <section>
+ <title> Introduction</title>
+ <para> Intended Audience This document is intended for anyone that has a business need to
+ transform complex XML documents from one form to another. This document makes some
+ assumptions about the knowledge of XML in publishing systems and the relative merits of
+ static vs. dynamic publishing systems. Needs of Electronic Publishing Industry The world
+ of XML transformation is large in scope. This paper will only focus on one segment - the
+ on-line publishing industry. Today much of the publishing industry is going through a
+ great upheaval from print-only to electronic formats. In the past publishers only needed
+ to provide PostScript or PDF files to a printer to turn content into revenue. But today
+ even simple textbooks need to be viewable on the web in HTML format, in a format useful
+ for electronic book readers (such as epub formats) as well as formats optimized for
+ search and search engine optimization (SEO). The standard process of going from Word
+ format to PDF is not sufficient for most publishing business models today. Publishers
+ need a simple way that a single document format such as DocBook or TEI can be quickly
+ transformed into many formats. </para>
+ <para> Several of us have found that the XQuery language to be ideal for this problem.
+ Although many systems in the past have relied on the XSLT language to transform XML
+ documents from one form to another, our experience has proven that XQuery is more than
+ capable of filling this need by using a style of transformation we call typeswich-style
+ transforms. Although XSLT-transforms still have some advantages, in general we find we
+ strongly prefer XQuery to XSLT for many reasons. Background on XSLT and XQuery </para>
+ <para> Document-centric transforms have traditionally been performed using the XSLT
+ language. XSLT is a very mature and stable language that became popular in the early
+ 2000s and has remained mostly unchanged since version 2.0. The ability of the XSLT
+ language to define individual highly modular “template” rules allowed software
+ developers the ability to build and maintain flexible transformation rules that are easy
+ to maintain and easy to modify. In the last few years, XQuery has become dramatically
+ more popular and additional interest is being fueled by the migration to non-XML
+ functional languages. And when coupled with a native XML database and large library of
+ XQuery modules XQuery has become a very popular web application development platform for
+ building entire web applications. </para>
+ <para> Using XQuery and the comparative merits of this architecture when compared with
+ XSLT-based template-style transforms. It specifically addresses the ability to create
+ highly modular and maintainable libraries that use a centralized dispatcher pattern. In
+ part one of this paper we address the main architecture of using the typeswich-style
+ transforms and its strengths and weaknesses. In part two we consider the ability for
+ non-programmers to maintain these systems and we conclude that their maintenance costs
+ are very similar if the developer are already familiar with the language. In summary we
+ conclude the costs of teaching staff both the XQuery and XSLT does justify the benefits
+ or maintaining XSLT transform.</para>
+ </section>
+ <section>
+ <title>The Dispatch Pattern</title>
+ <para> The technical name for some of these transforms are called “dispatch” systems. In
+ these systems the user passes the root element to a centralized dispatch function. This
+ function then analyzes the node it was passed and routes the control to one of many
+ “performer” functions that are specifically designed to process that node type. In most
+ cases the performer then places new output elements in the output tree. In the case of
+ recursive XML structures, these performers usually then return control to the main
+ dispatcher if they find complex content. The overall structure of the dispatcher is
+ described in figure 1. </para>
+ <figure>
+ <title>Figure #1: The Dispatcher Pattern</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/dispatch-pattern.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para> See http://www.eaipatterns.com/MessageDispatcher.html for further details on the
+ message dispatcher. Not that in our case this pattern is being applied to individual
+ nodes, not messages. But the structures are similar. </para>
+ <para> The central function is usually called the “dispatcher” or sometimes the “main” and
+ each function it calls is called a “performer”. The function we call “recurse” is also
+ often called “apply-templates” in XSLT. </para>
+ <para> There are also two variations of dispatchers: the sequence dispatcher and the child
+ dispatchers. The sequence dispatcher works on a simple linear list of nodes and child
+ dispatcher specifically processes all child nodes of the input. </para>
+ <para> It is interesting to note that the first DocBook to HTML with Typeswitch was done
+ almost 8 years ago. </para>
+ <para> Definitions In this document we consider two styles of transforms. Sequence-style
+ transforms use a traditional XQuery FLOWR structure and iterate of data elements that
+ are usually stored in a sequence of items. These items usually are linear list of items.
+ We contrast this with document-style transformations that use hierarchical
+ tree-structures as inputs. </para>
+ <para> We believe that 75% of the effort in building web applications in the electronic
+ publishing industry involves the creation of sequence-style transforms to list books or
+ search results, list chapters in a book or list sections in a chapter. These are very
+ efficiently performed, even on large document collections of 100,000+ documents by using
+ XQuery and native XML databases such as MarkLogic(TM) or eXist. These databases all
+ create indexes based on XML element names and attributes and do not require any logical
+ data modeling before data is imported into the database. Therefore we believe that most
+ electronic publishers either have or soon will be migrating to native XML architectures
+ to support the needs of on-line electronic publishing.</para>
+ </section>
+ <section>
+ <title>Part 3: Typeswitch Transforms</title>
+ <para> We first will take a look at the how we have implemented typeswitch transforms to
+ transform documents. The Identity Transform To begin, lets find a simple way to copy a
+ simple input XML document to the output without any changes. Le start out with the
+ following simple XML document. Note that we are going to use the “root” element name for
+ the root element. </para>
+ <para> Sample Input File</para>
+ <programlisting language="xml"><![CDATA[
+<root>
+ <aaa>AAA</aaa>
+ <bbb>BBB</bbb>
+ <ccc>
+ <ddd>DDD</ddd>
+ <eee>
+ <fff>FFF</fff>
+ </eee>
+ </ccc>
+</root>
+]]></programlisting>
+ <para>Sample Identity Transform (no namespace or attributes) </para>
+ <para> Our fist step is to create a very simple XQuery functions that copy the input to the
+ output without change. </para>
+ <programlisting language="xquery"><![CDATA[
+declare function local:copy($in-seq as item()*) as item()* {
+for $node in $in-seq
+ return
+ typeswitch($node)
+ case element()
+ return element {name($node)} {local:copy($node/node())}
+ default
+ return $node
+};
+]]></programlisting>
+ <para>This function uses the computed element constructor function of XQuery to create
+ elements of the form:</para>
+ <programlisting>element {name} {content}</programlisting>
+ <para>This function will dynamically create elements when the element case returns true.
+ Note that this function is recursive. When creating elements it calls itself to put the
+ content inside the constructed element. </para>
+ <para> This can be compared with the equivalent element only (no attribute) identity
+ transform with XSLT:</para>
+ <programlisting language="xml"><![CDATA[
+<xsl:stylesheet version="1.0">
+ <xsl:template match="*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>
+]]></programlisting>
+ <para>In the case of XSLT, the recursion happens within the apply-templates construct. This
+ function effectively calls the main template that performs the copy. We can now create a
+ separate function to handle the recursion. </para>
+ <para> file name: identity-transform.xqm</para>
+ <programlisting language="xquery"><![CDATA[
+module namespace ident = "ident";
+(: the main dispatcher :)
+declare function ident:main($content as node()*) as item()* {
+for $node in $content
+ return
+ typeswitch($node)
+ case element()
+ return element {name($node)} {ident:recurse($node)}
+ case text()
+ return $node
+ default
+ return ident:recurse($node)
+};
+
+(: the call back to the main :)
+declare function ident:recurse($node as node()) as item()* {
+ ident:main($node/node())
+};
+]]></programlisting>
+ <para>Note that this algorithm is slightly different from some implementations. Other
+ examples, such as those provided by MarkLogic, place the for loop within their version
+ of the recurse function. </para>
+ <para> Sample Test Driver for the Identity Transform </para>
+ <para> DocBook Transform Simple DocBook Input File </para>
+ <programlisting language="xml"><![CDATA[
+<article xmlns="http://docbook.org/ns/docbook" version="5.0">
+ <title>Sample DocBook 5 Article</title>
+ <section>
+ <title>Section 1 Title</title>
+ <para>Section 1 paragraph.</para>
+ </section>
+ <section>
+ <title>Section 2 Title</title>
+ <para>Section 2 paragraph.</para>
+ <section>
+ <title>Section 2.1 Title</title>
+ <para>Section 2.1 paragraph.</para>
+ <section>
+ <title>Section 2.1.1 Title</title>
+ <para>Section 2.1.1 paragraph.</para>
+ </section>
+ </section>
+ <section>
+ <title>Section 2.2 Title</title>
+ <para>Section 2.2 paragraph.</para>
+ </section>
+ </section>
+ <section>
+ <title>Section 3 Title</title>
+ <para>Section 3 paragraph.</para>
+ </section>
+</article>
+]]></programlisting>
+ <para> Sample XQuery Module </para>
+ <programlisting language="xquery"><![CDATA[
+module namespace docbook-to-html = "http://www.example.com/docbook-to-html";
+
+declare namespace docbook ="http://docbook.org/ns/docbook";
+declare default element namespace "http://docbook.org/ns/docbook";
+
+declare function docbook-to-html:main($content as node()*) as item()* {
+for $node in $content/node()
+ return
+ typeswitch($node)
+ case element(article)
+ return <div class="article">{docbook-to-html:recurse($node)}</div>
+ case element(section)
+ return <div class="section">{docbook-to-html:recurse($node)}</div>
+ case element(title)
+ return <div class="title"><b>{$node/text()}</b></div>
+ case element(para) return <p>{$node/text()}</p>
+ default
+ return docbook-to-html:recurse($node)
+};
+
+declare function docbook-to-html:recurse($node as node()) as item()* {
+ docbook-to-html:main($node)
+};
+]]></programlisting>
+ <para> Sample Test Driver </para>
+ <para> The following is a sample XQuery driver for the transformation module. </para>
+ <programlisting language="xquery"><![CDATA[
+xquery version "1.0";
+
+import module namespace docbook-to-html = "http://www.example.com/docbook-to-html" at "/db/apps/docbook/modules/docbook-to-html.xqm";
+
+declare namespace docbook ="http://docbook.org/ns/docbook";
+declare default element namespace "http://docbook.org/ns/docbook";
+declare option exist:serialize "method=xhtml media-type=text/html omit-xml-declaration=yes indent=yes";
+
+let $input := doc('/db/apps/docbook/data/01-simple-article.xml')/docbook:article
+
+return
+<html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <head>
+ <title>{$input/title/text()}</title>
+ </head>
+ <body>
+ {docbook-to-html:main($input)}
+ </body>
+</html>
+
+Sample Output
+
+<html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <div class="title">
+ <b>Sample DocBook 5 Article</b>
+ </div>
+ <div class="section">
+ <div class="title">
+ <b>Section 1 Title</b>
+ </div>
+ <p>Section 1 paragraph.</p>
+ </div>
+ <div class="section">
+ <div class="title">
+ <b>Section 2 Title</b>
+ </div>
+ <p>Section 2 paragraph.</p>
+ <div class="section">
+ <div class="title">
+ <b>Section 2.1 Title</b>
+ </div>
+ <p>Section 2.1 paragraph.</p>
+ </div>
+ <div class="section">
+ <div class="title">
+ <b>Section 2.2 Title</b>
+ </div>
+ <p>Section 2.2 paragraph.</p>
+ </div>
+ </div>
+ <div class="section">
+ <div class="title">
+ <b>Section 3 Title</b>
+ </div>
+ <p>Section 3 paragraph.</p>
+ </div>
+ </body>
+</html>
+]]></programlisting>
+ <para> Dispatching Control to Element-specific Functions </para>
+ <para> It is frequently conveniet to dispatch control of the transform to an XQuery function
+ that specifically has responsibility for processing an element. This keeps the length of
+ the main dispatcher small and easy to maintain. Adding Comments and Processor
+ Instruction </para>
+ <para> Our typeswitch function works with elements Note that you can also pass through
+ comments and processing instruction by adding the following to your typeswitch:</para>
+ <programlisting language="xquery"><![CDATA[
+ case comment()
+
+ return $node
+
+ case processor-instruction()
+
+ return $node
+ ]]></programlisting>
+ <para> Note that you MUST add the processor-instruction() cast so that you can style your
+ HTML. Also that you can style all XML elements with a simple PI in your XML file. Unless
+ you are changing order or the output, an actual transform may not be needed. </para>
+ <programlisting language="xml"><![CDATA[
+<?xml-stylesheet href="style.css" type="text/css"?>
+<root>
+ <aaa xmlns="aaa">AAA</aaa>
+ <bbb>BBB</bbb>
+ <!-- this is a comment -->
+ <ccc>
+ <ddd>DDD</ddd>
+ <eee>
+ <fff>FFF</fff>
+ </eee>
+ <ggg></ggg>
+ </ccc>
+</root>
+]]></programlisting>
+ <para>Here is the CSS file:</para>
+ <programlisting language="css"><![CDATA[
+sample style.css file
+/* note that these properties apply to all subelements of root */
+root {display: block; font-family: arial, helvetica, sans-serif; font-weight: bold;}
+aaa {color: red;}
+bbb {color: orange;}
+ddd {color: green;}
+fff {color: blue;}
+ggg {color: purple;}
+]]></programlisting>
+ <para> Namespaces </para>
+ <para> Namespace are automatically created in the output using the function provided. One
+ should also note that you can crate identify transforms that move element from one
+ namespace into another namespace. Qualifying Element Based on Context With XSLT, you
+ have the ability to specify an entire context in a XPath expression of a template match.
+ For example</para>
+ <programlisting language="xml"><![CDATA[
+<xsl:template match=”info/title”/>
+]]></programlisting>
+ <para> will only match titles that are direct child elements of the info element.
+ Similarly:</para>
+ <programlisting language="xml"><![CDATA[
+<xsl:template match=”section[para[4]]”/>
+]]></programlisting>
+ <para> will only match any sections that have a 4th paragraph. </para>
+ <para> With typeswitch transforms you can only specify the element name in the case
+ statement. To process the contents you will need to move the conditional statements
+ directly into the function that is called by the dispatcher (the main). </para>
+ <para> Examples: TBD </para>
+ <para> Transformations with Attributes </para>
+ <para> There are many XML standards today that use XML elements for most content. For
+ example in US federal data exchange standards, XML attributes are strongly discouraged
+ since they limit the ability to create future sub-elements. But most document standards
+ are rich in attributes. If your input documents do contain attributes they must also be
+ passed to the output. In this case the element case must also include a query for all
+ attributes using the “@*” notation. </para>
+ <para> Here is an example of the element constructor that includes attribute construction
+ using the following attribute constructor. Like the element constructor, the attribute
+ constructor takes the following form: </para>
+ <para> attribute {attribute-name} {attribute-value} </para>
+ <para> So the element constructor simply has to add attributes to the element before the
+ element content is created. </para>
+ <para> element {name($node)} {for $att in $node/@* return attribute {name($att)} {$att} ,
+ local:main($node) } </para>
+ <para> You can read this as saying “if you encounter an element, then create a new element
+ with the element name of name($node) and then put in both the element attributes and the
+ content via the recursive call to main(). Note that the name($att) is used to create the
+ attribute name and the $att variable is the value of the attribute. </para>
+ <para> Converting Transforms with Modes </para>
+ <para> The concept of modes has also come up in my discussions with Michael Kay on the
+ LinkedIn group. The general approach is to add a “config” element as a parameter to the
+ centralized dispatcher. This allows the use to use different behavior based on the
+ configuration passed to the function. </para>
+ <para> So the declaration of the dispatch function might be the following: </para>
+ <para> declare function local:dispatch($node as node()*, $config as node())
+ </para>
+ </section>
+ <section>
+ <title>Part 4: Maintenance costs by Non-Programmers </title>
+ <para>Of primary concern is the total-cost-of-ownership of any transformation system for
+ document publishing. Total cost of ownership formulas consider the entire cost of a
+ publishing solution over the typical lifetime of a system. Most of the
+ total-cost-of-ownership calculations include the hardware cost, software costs, hosting
+ costs, training costs, installation, setup, customization and training of staff. When we
+ consider these costs we find that the percentage of the total for hardware and software
+ continues to fall relative to the total but the need for customization to the changing
+ business climate continues to rise. We have therefore found that allowing publishing
+ staff to understand and customize the transforms to be highly cost effective for many
+ publishing organizations. </para>
+ <para> The following is a typical breakdown of costs for an organization with 10 staff
+ members publishing 10,000 electronic documents using an open source native XML database: </para>
+ <para> hardware: $5,000 installation: $10,000 customization: $30,000 software: eXist (free)
+ with $3,000 for oXygen client licenses training: $30,000 per language </para>
+ <para> The training line item is therefore sill a significant portion of the total cost of
+ the system. We find that teaching a single language, XQuery to be sufficient for all the
+ needs of most organizations. Adding a second language such as XSLT moves the total from
+ around $70,000 to over $100,000. Clearly this does not justify the additional benefits
+ of the using both XQuery and XSLT. </para>
+ <para> Note that this analysis is specifically focused in the area of digital publishing and
+ may not apply to other business domains. There are two exceptions that should be
+ addressed. These systems are characterized by the fact that the documents being
+ published are somewhat static, such as works of literature or scientific articles. </para>
+ <para> The first use case to continue using XSLT is where there is a large body of XSLT that
+ can be used “out of the box” with no customization needed by the support staff. A good
+ example of this is the large body of DocBook to HTML and DocBook to PDF transformations
+ freely available in XSLT. </para>
+ <para> A second use case is if your support staff only has training in XSLT and your
+ organization does not have a budget to retrain this staff using XQuery. </para>
+ <para> A third use case is where it is not efficient to create document indexes using native
+ XML databases. This is very common when the documents are very large and the system only
+ holds the documents in memory for short time periods. For example content routing is a
+ typical use case where XSLT might still be used to make a decision on where to route an
+ incoming message based on its content. </para>
+ <para> A fourth use case for the continued use of XSLT is if the transform must run within a
+ web browser without the need for an additional download. </para>
+ <para> Part 5: Conclusion, Future Work and References </para>
+ <para> Conclusion We conclude with an analysis of some of the additional costs and
+ development environments that include multiple languages. </para>
+ <para> One of the nice factors about both XQuery and XSLT is that both of them are highly
+ dependant on the XPath language to select nodes from an XML dataset. It is clear that
+ anyone that knows one of the two languages can more-quickly pick up the other. </para>
+ <para> But there are substantial differences. Most importantly the use of XML to store
+ programmatic code is somewhat controversial. In general, designers of new languages tend
+ to favor a syntax that is closer to XQuery than to XSLT. </para>
+ </section>
+ <section>
+ <title>Future Work</title>
+ <para>For all the benefits of typeswitch tranforms there are a few known limitations.</para>
+ <para>Todo: Discussion of how to override a function without changing the main module.
+ Must use introspection in the main module to see if an "override" function exists. This
+ would be part of XQuery 3.0.</para>
+ <para>Todo: Discussion of the use of functional programming to manage document transformation.
+ Can the ability to pass a function as a parameter to another function make transforms
+ easier?</para>
+ </section>
+ <section>
+ <title>References </title>
+ <para> The following Wikibook article is a good overview of using XQuery typeswitch
+ transforms: </para>
+ <para> [Bothner 2002] The concept of using XQuery to transform document using the typeswitch
+ transform is not new. The following article with a complete transform was written almost
+ eight years ago! Generating XML and HTML using XQuery by Per Bothner December 23, 2002
+ on XML.com http://www.xml.com/pub/a/2002/12/23/xquery.html Wikibook Article on XQuery
+ Typeswitch Transforms http://en.wikibooks.org/wiki/XQuery/Typeswitch_Transformations The
+ following is a Wikbook article comparing various forms of document transforms. </para>
+ </section>
+</section>
\ No newline at end of file
Modified: apps/docs/modules/style.xqm
===================================================================
--- apps/docs/modules/style.xqm 2011-12-31 16:14:46 UTC (rev 15627)
+++ apps/docs/modules/style.xqm 2011-12-31 16:16:44 UTC (rev 15628)
@@ -40,6 +40,8 @@
module namespace style = "http://exist-db.org/docs";
+import module namespace util2 = "http://danmccreary.com/util2" at "../modules/util2.xqm";
+
(: Default function and element declarations :)
declare default function namespace "http://www.w3.org/2005/xpath-functions";
declare default element namespace "http://www.w3.org/1999/xhtml";
@@ -136,7 +138,11 @@
{ $style }
</head>
<body>
- <div class="container">
+ <div id="grey-top">
+ <div id="grey-bot">
+ <div id="container">
+ <div id="main">
+ <div id="content">
{ style:header() }
{ $breadcrumbs }
<div class="inner">
@@ -144,7 +150,11 @@
{ $content }
</div>
{ style:footer() }
- </div>
+ </div> <!-- content -->
+ </div> <!-- main -->
+ </div> <!-- container -->
+ </div> <!-- gray-bot -->
+ </div> <!-- gray-top -->
</body>
</html>
)
@@ -1085,4 +1095,53 @@
(: site-wide dateTime formatting without the strict error checking of the format-dateTime. :)
declare function style:site-date($in as xs:anyAtomicType) as xs:string {
xsl:format-dateTime(xs:dateTime($in), "h:m:s P 'on' F MMMM DD, YYYY")
+};
+
+(: to use this just add an XML file call test-status.xml with the following structure:
+
+:)
+declare function style:test-status() as node() {
+let $rest-path-to-tests := util2:substring-before-last-slash(request:get-uri())
+let $collection := substring-after($rest-path-to-tests, '/rest')
+let $tests := collection($collection)//test
+let $sorted-files :=
+ for $file in xmldb:get-child-resources( $collection )
+ order by xs:dateTime(xmldb:last-modified($collection, $file)) descending
+ return
+ if (not($file='index.xq') and ends-with($file, '.xq') or ends-with($file, '.html'))
+ then $file
+ else ()
+
+return
+<div class="content">
+ <p>Unit Tests Sorted By Last Update</p>
+ <table class="datatable span-24">
+ <thead>
+ <tr>
+ <th class="span-5 row1">File</th>
+ <th class="span-10 row1">Description</th>
+ <th class="span-1 row1">Status</th>
+ <th class="span-2 row1">Modified</th>
+ </tr>
+ </thead>
+ {for $file at $count in $sorted-files
+ let $test := $tests[file=$file]
+ return
+ if (not($file='index.xq') and ends-with($file, '.xq') or ends-with($file, '.html'))
+ then
+ <tr>
+ {if ($count mod 2)
+ then attribute class {'odd'}
+ else attribute class {'even'}
+ }
+ <td style="text-align:left;"><a href="{$file}">{$file}</a></td>
+ <td style="text-align:left;">{$test/desc/text()}</td>
+ <td style="text-align:center;">{$test/status/text()}</td>
+ <td style="text-align:left;">{xmldb:last-modified($collection, $file)}</td>
+ </tr>
+ else ()
+ }
+ </table>
+ Test Status at <a href="{$rest-path-to-tests}">{$collection}</a>
+</div>
};
\ No newline at end of file
Added: apps/docs/modules/util2.xqm
===================================================================
--- apps/docs/modules/util2.xqm (rev 0)
+++ apps/docs/modules/util2.xqm 2011-12-31 16:16:44 UTC (rev 15628)
@@ -0,0 +1,75 @@
+xquery version "1.0";
+
+(: general utilities functions - not to be included by other modules
+import module namespace util2 = "http://danmccreary.com/util2" at "../modules/util2.xqm";
+:)
+
+module namespace util2 = "http://danmccreary.com/util2";
+
+declare function util2:substring-before-last-slash($in as xs:string?) as xs:string {
+ if (matches($in, '/'))
+ then replace ($in, '^(.*)/.*', '$1')
+ else ()
+};
+
+declare function util2:substring-after-last-slash($in as xs:string?) as xs:string {
+ replace ($in, '^.*/', '')
+};
+
+declare function util2:substring-before-last($in as xs:string?, $delim as xs:string) as xs:string {
+ if (matches($in, $delim))
+ then replace($in,
+ concat('^(.*)', $delim,'.*'),
+ '$1')
+ else ''
+};
+
+declare function util2:substring-after-last($in as xs:string?, $delim as xs:string) as xs:string {
+ replace ($in,concat('^.*',$delim),'')
+ } ;
+
+(: create all the collections in a path if they do not exist and report results :)
+(: this must be run aa an admin user :)
+declare function util2:mkdirs-r($done as xs:string?, $todo as xs:string?) as node()* {
+(: create a sequence of tokens between the slashes. $step[1] is null since the first char is '/' :)
+let $steps := tokenize($todo, '/')
+return
+if (count($steps) ge 2)
+ then
+ (let $first := $steps[2]
+ let $rest := substring-after($todo, '/')
+ let $path := concat($done, '/', $first)
+ let $check-path :=
+ if (xmldb:collection-available($path))
+ then false()
+ else (
+ xmldb:login(util2:substring-before-last-slash($path), 'admin', 'admin123'),
+ xmldb:create-collection(util2:substring-before-last-slash($path), util2:substring-after-last-slash($path))
+ )
+ return
+ (
+ <check>
+ <path>{$path}</path>
+ <status>{if ($check-path = true()) then 'new collection created' else 'collection ok' }</status>
+ </check>,
+ util2:mkdirs-r($path, $rest)
+ )
+ )
+ else ()
+};
+
+declare function util2:mkdirs($collection-path as xs:string) as node()* {
+<checks>
+ {util2:mkdirs-r((), $collection-path)}
+</checks>
+};
+
+(: returns true if the current user is in the dba group :)
+declare function util2:is-dba() as xs:boolean {
+ let $current-user := xmldb:get-current-user()
+ let $list-of-groups := xmldb:get-user-groups($current-user)
+ return
+ if ($list-of-groups = 'dba')
+ then true()
+ else false()
+};
\ No newline at end of file
Added: apps/docs/resources/images/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: apps/docs/resources/images/Thumbs.db
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: apps/docs/resources/images/glyphish-icons/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: apps/docs/resources/images/glyphish-icons/Thumbs.db
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: apps/docs/unit-tests/index.xq
===================================================================
--- apps/docs/unit-tests/index.xq (rev 0)
+++ apps/docs/unit-tests/index.xq 2011-12-31 16:16:44 UTC (rev 15628)
@@ -0,0 +1,12 @@
+xquery version "1.0";
+import module namespace style='http://exist-db.org/docs' at '../modules/style.xqm';
+
+let $title := 'eXist Documentation Project'
+
+let $content :=
+<div id="content">
+ <p>The following are unit tests sorted by the last updated frst.</p>
+ {style:test-status()}
+</div>
+
+return style:assemble-page($title, $content)
\ No newline at end of file
Added: apps/docs/unit-tests/james-hambley-page-design-template.html
===================================================================
--- apps/docs/unit-tests/james-hambley-page-design-template.html (rev 0)
+++ apps/docs/unit-tests/james-hambley-page-design-template.html 2011-12-31 16:16:44 UTC (rev 15628)
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <title>eXistDB</title>
+ <link rel="shortcut icon" href="../resources/images/favicon.ico"/>
+ <link rel="stylesheet" type="text/css" href="../resources/css/exist.css"/>
+
+<!--[if IE 6]>
+ <link rel="stylesheet" type="text/css" href="../resources/css/ie6.css" />
+<![endif]-->
+
+<!--[if IE 7]>
+ <link rel="stylesheet" type="text/css" href="../resources/css/ie7.css" />
+<![endif]-->
+
+<!--[if IE 8]>
+ <link rel="stylesheet" type="text/css" href="../resources/css/ie8.css" />
+<![endif]-->
+
+<!--[if lte IE 7]>
+<script type="text/javascript" src="" rel="nofollow">http://code.jquery.com/jquery-1.4.2.min.js"></script>
+<script type="text/javascript" src="../resources/menus/jquery.helper.js"></script>
+<![endif]-->
+ </head>
+ <body>
+ <div id="grey-top">
+ <div id="grey-bot">
+ <div id="container">
+ <div id="header">
+ <a href="../index.html" id="logo">eXistDB</a>
+ </div><!--/header-->
+ <div id="navigation">
+ <ul id="nav" class="dropdown dropdown-horizontal">
+ <li class="dir" id="documentation">Documentation
+ <ul>
+ <li>
+ <a href="../quickstart.html">Quick Start</a>
+ </li>
+ <li>
+ <a href="Function" rel="nofollow">http://demo.exist-db.org/exist/xquery/functions.xql">Function Library</a>
+ </li>
+ <li>
+ <a href="../extensions.html">Extension Modules</a>
+ </li>
+ <li>
+ <a href="../documentation.html">Main Documentation</a>
+ </li>
+ <li>
+ <a href="../facts.html">Feature Sheet</a>
+ </li>
+ <li>
+ <a href="XQuery" rel="nofollow">http://en.wikibooks.org/wiki/XQuery">XQuery Wikibook</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </div><!--/navigation-->
+ <div id="main">
+ <div id="content">
+ <h1>The title of this section</h1>
+ <h2>1. Introduction</h2>
+ <p>This guide offers the quickest way to install and begin using the eXist XML Database system. Although this guide assumes users have a basic knowledge of <a href="#">XQuery</a> and <a href="#">XML</a>, eXist can be used as a tool for learning these technologies. However, it is recommended that users consult other reference and tutorial resources. Some useful resources are suggested at the end of this document.</p>
+ <h2>2. Installing eXist</h2>
+ <p>To begin, <a href="#">download the latest standard distribution of eXist</a>. This package is recommended for new eXist users and includes a graphical installer that guides you through the installation process. This standard distribution comes as an executable .jar (Java Archive) file, which automatically determines the correct system settings (i.e. paths and environment variables) for eXist. On Windows and Linux Operating Systems, the installer can also create desktop shortcuts.</p>
+ <p>Once the download has completed, start the eXist installation by doing ONE of the following:</p>
+ <ul>
+ <li> For Windows and Mac users, double-click on the installer file: eXist-[version]-build-XXXX.jar</li>
+ <li> OR enter the following Java command in a Unix shell or Windows command prompt using the -jar option: java -jar eXist-[version]-build-XXXX.jar</li>
+ </ul>
+ <p>This will launch the installer. Simply follow the steps to complete the installation process.</p>
+ <blockquote>
+ <h3>Note</h3>
+ <p> If you are on the mac platform the admin password asked for during the install procedure is not the mac-osx-admin pasword but for the eXist admin user alone.</p>
+ </blockquote>
+ <blockquote>
+ <h3>Note</h3>
+ <p> NB! You are strongly encouraged to set the admin password on all installations, even those without internet access, otherwise the eXist security manager will be disabled.</p>
+ </blockquote>
+ <blockquote>
+ <h3>Note</h3>
+ <p> The eXist installer requires a graphical desktop in order to launch. However, If you wish to install eXist on a headless system, use the -p parameter when following Option Two above. This will automatically start the installation. Option -p expects a single parameter: the path to the directory where you would like to install eXist. For example:</p>
+ <p class="code">java -jar eXist-{version}.jar -p /usr/local/exist</p>
+ </blockquote>
+ </div><!--/content-->
+ <div id="sub-right">
+ <div id="bluebox">
+ <h2>Download eXistdb</h2>
+ <p class="download">
+ <a href="#" title="XQuery 1.4">XQuery 1.4</a>
+ </p>
+ <p>
+ <a href="#">Release information</a> | <a href="#">mirrors</a>
+ </p>
+ </div><!--/bluebox-->
+ <div id="right">
+ <div id="r-top">
+ <div id="r-bot">
+ <h2>In this section</h2>
+ <ol>
+ <li>
+ <a href="">Introduction</a>
+ </li>
+ <li>
+ <a href="">Installing eXist </a>
+ </li>
+ <li>
+ <a href="">Getting Started </a>
+ </li>
+ <li>
+ <a href="">Accessing the Server </a>
+ </li>
+ <li>
+ <a href="">Using the Admin Database Interface </a>
+ </li>
+ <li>
+ <a href="">Using the Java Admin Client </a>
+ </li>
+ <li>
+ <a href="">Shutting Down the Database </a>
+ </li>
+ <li>
+ <a href="">Starting eXist as a service </a>
+ </li>
+ <li>
+ <a href="">If Something Goes Wrong </a>
+ </li>
+ <li>
+ <a href="">Running Executable Files</a>
+ </li>
+ </ol>
+ </div>
+ </div>
+ </div><!--/right-->
+ <div id="darkblue">
+ <div id="darkblue-top">
+ <div id="darkblue-bot">
+ <a href="#" title="Sourceforge" id="sourceforge">Sourceforge</a>
+ </div>
+ </div>
+ </div><!--/darkblue-->
+ </div><!--sub-right-->
+ </div><!--/main-->
+ </div><!--/container-->
+ </div><!--/grey-top-->
+ </div><!--/grey-bot-->
+ <div id="footer">
+ <ul>
+ <li>
+ <a href="#">Documentation</a>
+ </li>
+ </ul>
+ <div id="copyright">
+ <p> Copyright eXist 2011</p>
+ <p>
+ <a href="http://www.jameshambly.com"> Designed by JamesHambly.com</a>
+ </p>
+ </div><!--/copyright-->
+ </div><!--/footer-->
+ </body>
+</html>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jen...@us...> - 2011-12-31 16:14:55
|
Revision: 15627
http://exist.svn.sourceforge.net/exist/?rev=15627&view=rev
Author: jenspetersen
Date: 2011-12-31 16:14:46 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
[matumi] Display of images, move of images collection, code by Gesa and Kaja. Pruning of sample texts.
Modified Paths:
--------------
apps/TEIXLingual/data/EncycBritannica.xml
apps/TEIXLingual/data/RiyongBaikeQuanshu.xml
apps/TEIXLingual/data/RiyongBaikeQuanshuBubian-annotations.xml
apps/TEIXLingual/data/persons.xml
apps/TEIXLingual/data/xwhcs.xml
apps/TEIXLingual/modules/dict2html.xql
apps/TEIXLingual/themes/default/css/style.css
Added Paths:
-----------
apps/TEIXLingual/data/EncycDesGensDuMonde1833.xml
apps/TEIXLingual/data/GSE1.xml
apps/TEIXLingual/data/GSE3-eng.xml
apps/TEIXLingual/data/daihyakka1951.xml
apps/TEIXLingual/images/
Removed Paths:
-------------
apps/TEIXLingual/data/Annuaire_encyc_1859.xml
apps/TEIXLingual/data/BianyiPutongJiaoyuBaikeQuanshu-annotations.xml
apps/TEIXLingual/data/BianyiPutongJiaoyuBaikeQuanshu.xml
apps/TEIXLingual/data/Brokgauz-annotations.xml
apps/TEIXLingual/data/Brokgauz.xml
apps/TEIXLingual/data/CefuTongzong-annotations.xml
apps/TEIXLingual/data/CefuTongzong.xml
apps/TEIXLingual/data/EDNS.xml
apps/TEIXLingual/data/PutongBaikeXinDaCidian-annotations.xml
apps/TEIXLingual/data/PutongBaikeXinDaCidian.xml
apps/TEIXLingual/data/RiyongBaikeQuanshu-annotations.xml
apps/TEIXLingual/data/RiyongBaikeQuanshuBubian.xml
apps/TEIXLingual/data/XishiGangmu-annotations.xml
apps/TEIXLingual/data/XishiGangmu.xml
apps/TEIXLingual/data/desk.xml
apps/TEIXLingual/data/gensDuMonde.xml
apps/TEIXLingual/data/kodansha.xml
apps/TEIXLingual/data/oju.xml
apps/TEIXLingual/data/penny.xml
apps/TEIXLingual/data/standardlibrarycyc.xml
apps/TEIXLingual/data/xixue-tanyuan-annotations.xml
apps/TEIXLingual/data/xixue-tanyuan.xml
Deleted: apps/TEIXLingual/data/Annuaire_encyc_1859.xml
===================================================================
--- apps/TEIXLingual/data/Annuaire_encyc_1859.xml 2011-12-31 03:32:55 UTC (rev 15626)
+++ apps/TEIXLingual/data/Annuaire_encyc_1859.xml 2011-12-31 16:14:46 UTC (rev 15627)
@@ -1,1601 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?oxygen RNGSchema="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="xml"?>
-<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:svg="" rel="nofollow">http://www.w3.org/2000/svg">
- <teiHeader>
- <fileDesc>
- <titleStmt>
- <title>Annuaire encyclopédique 1859</title>
- </titleStmt>
- <publicationStmt>
- <p>Publication information: publié par les directeurs de l'Encyclopédie du XIXe siècle,
- 1859-1860.</p>
- </publicationStmt>
- <sourceDesc>
- <p>Source: Gallica Bibliothéque numérique</p>
- </sourceDesc>
- </fileDesc>
- </teiHeader>
- <text>
- <body>
- <div type="entry" subtype="asia">
- <head>
- <term xml:id="asia">ASIE</term>
- </head>
- <div type="article">
- <p> Ces derniers temps ont été signalés par des événements d'une haute importance en <name type="place" key="Asie:" rel="nofollow">http://dbpedia.org/resource/Asia">Asie</name>: notre pavillon a
- flotté victorieusement dans les mers de la <name type="place" key="Cochinchine;" rel="nofollow">http://dbpedia.org/resource/Cochinchina">Cochinchine</name>; on a obtenu, pour le
- commerce européen, l'ouverture des ports de la <name type="place" key="Chine," rel="nofollow">http://dbpedia.org/resource/People's_Republic_of_China">Chine</name>, par le
- traité de <name type="place">Tbien-Tsin</name>, malheureusement si mal observé par les
- <name type="people">Chinois</name>. Le <name type="place" key="Japon," rel="nofollow">http://dbpedia.org/resource/Japan">Japon</name>, demeuré jusqu'ici fermé a notre
- commerce, s'est enfin décidé à nous ouvrir plusieurs de ses ports; l'<name type="place" key="Inde" rel="nofollow">http://dbpedia.org/resource/India">Inde</name> anglaise, naguère encore en
- convulsion, parait se pacifier à peu près, domptée plus par la persévérance que par la
- puissance matérielle du gouvernement britannique. La <name type="place" key="Russie," rel="nofollow">http://dbpedia.org/resource/Russia">Russie</name>, renonçant en apparence a ses
- projets ambitieux en <name type="place" key="Europe," rel="nofollow">http://dbpedia.org/resource/Europe">Europe</name>, s'est insensiblement agrandie en <name type="place" key="Asie;" rel="nofollow">http://dbpedia.org/resource/Europe">Asie</name>; le pays des <name type="people">Kirghiz</name> et une partie du <name type="place" key="Turkestan" rel="nofollow">http://dbpedia.org/resource/Turkestan">Turkestan</name> lui appartiennent; elle
- s'avance hardiment vers le midi, et se propose peut-être de menacer un jour l'<name type="place" key="Inde." rel="nofollow">http://dbpedia.org/resource/India">Inde</name>. Du côte de l'extrême
- orient, les rives du fleuve <name type="place">Amour</name> ne sont plus, sur un certain
- espace, qu'une faible barrière qui la sépare du <name type="place" key="Céleste-" rel="nofollow">http://dbpedia.org/resource/Tianxia">Céleste- Empire</name> sur un autre, ces
- rives sont mémo franchies. L'<name type="place" key="Europe," rel="nofollow">http://dbpedia.org/resource/Europe">Europe</name>, en un mot, serre l'<name type="place" key="Asie" rel="nofollow">http://dbpedia.org/resource/Asia">Asie</name> par le nord et par le sud, et
- s'efforce de la faire sortir de sa longue atonie et de la vivifier par la civilisation. </p>
- <p> Retraçons maintenant le tableau rapide des événements qui intéressent la géographie,
- sur ce vaste continent qui fut le berceau du genre humain. </p>
- <p> Dans la <name type="place">Turquie d'Asie</name>, des tremblements de terre ont
- continué à troubler la sécurité des habitants terre ont continué à troubler la sécurité
- des habitants les épouvantables désastres de <name type="place" key="Rhodes" rel="nofollow">http://dbpedia.org/resource/Rhodes">Rhodes</name> et de <name type="place" key="Brousse," rel="nofollow">http://dbpedia.org/resource/Bursa">Brousse</name>, en 1856, ont trouvé leur
- pendant, en 1859, dans le sinistre qui a frappé la ville d'<name type="place" key="Erzeroum:" rel="nofollow">http://dbpedia.org/resource/Erzurum">Erzeroum</name>: le 2 juin, plusieurs
- milliers de maisons se sont écroulées, en écrasant dans leur chute un grand nombre
- d´individus. </p>
- <p> La<name type="place" key="France," rel="nofollow">http://dbpedia.org/resource/France">France</name>, à peu
- prés à la même époque, a vu s'inaugurer, sous son haut patronage, la route qui relie
- aujourd'hui <name type="place" key="Beyrouth" rel="nofollow">http://dbpedia.org/resource/Beirut">Beyrouth</name>
- à <name type="place" key="Damas:" rel="nofollow">http://dbpedia.org/resource/Damascus">Damas</name>: une de nos
- compagnies prit l'initiative de cette importante communication, et, grâce à son
- activité, les travaux furent menés rapidement et avec un plein succès, la route franchit
- le <name type="place" key="Liban," rel="nofollow">http://dbpedia.org/resource/Lebanon">Liban</name>, passe à
- travers, la plaine de <name type="place">Bk'aa</name>, et nous ne doutons pas qu'avant
- peu des diligences ne sillonnent cette magnifique voie, emportant avec elles le progrès,
- dont les habitants de la <name type="place" key="Turquie" rel="nofollow">http://dbpedia.org/resource/Turkey">Turquie</name> semblent malheureusement encore peu soucieux.</p>
- <p> L'affaire de <name type="place" key="Djeddah," rel="nofollow">http://dbpedia.org/resource/Jeddah">Djeddah</name>, déjà loin de nous, a laissé dans les esprits une triste impression;
- la justice a sévèrement puni les assassins de notre malheureux consul <name type="person">M. Éveillard</name>. <name type="place" key="L'Arabie," rel="nofollow">http://dbpedia.org/resource/Arabian_Peninsula">L'Arabie</name>, ou se trouve ce
- port, nous invite tout naturellement à dire que les <name type="language" key="Anglais" rel="nofollow">http://dbpedia.org/resource/English_language">Anglais</name> n'ont pas cessé de
- tourner leurs regards inquiets du côté de la <name type="place">mer Rouge</name>, qui
- pourrait devenir un jour ou l'autre, grâce au <name type="place" key="canal" rel="nofollow">http://dbpedia.org/resource/Suez_Canal">canal de Suez</name>, la route la plus
- directe pour aller aux <name type="place" key="Indes." rel="nofollow">http://dbpedia.org/resource/Indies">Indes</name>. Jalouse des tentatives de la compagnie dirigée par <name type="person" key="M." rel="nofollow">http://dbpedia.org/resource/Ferdinand_de_Lesseps">M. de Lesseps</name>, <name type="place" key="l'Angleterre" rel="nofollow">http://dbpedia.org/resource/England">l'Angleterre</name> a cherché
- depuis longtemps à entraver l'entreprise de la canalisation de <name type="place" key="Suez" rel="nofollow">http://dbpedia.org/resource/Suez">Suez</name> et à lui susciter des difficultés
- de tous genres, elle-même paraissait avoir le projet d'établir une communication entre
- <name type="place">l'Aasi</name> ou <name type="place">Oronte</name>, tributaire de la
- <name type="place" key="Méditerranée," rel="nofollow">http://dbpedia.org/resource/Mediterranean_Sea">Méditerranée</name>, et l'<name type="place">Euphrate</name>, tributaire du <name type="place">golfe Persique</name>; mais aujourd'hui les ingénieurs ont suspendu leurs
- travaux. La <name type="place" key="Grande-Bretagne," rel="nofollow">http://dbpedia.org/resource/Great_Britain">Grande-Bretagne</name>, du moins, a voulu rester maîtresse absolue du détroit de
- <name type="place" key="Bab-el-Mandeb," rel="nofollow">http://dbpedia.org/resource/Bab-el-Mandeb">Bab-el-Mandeb</name>, en prenant possession des petites <name type="place">Iles de
- Périm</name> et de <name type="place">Camaran</name>. (V, ces mots.) Au mois de juin
- 1859, la pose du fil électrique à travers la <name type="place">mer Rouge</name> fut
- terminée d'une manière satisfaisante. L'<name type="place">Ile de Perim</name> est
- maintenant le siége de la principale station télégraphique. </p>
- <p> Des découvertes archéologiques ont été faites au <name type="place" key="Sinaï." rel="nofollow">http://dbpedia.org/resource/Sinai_Peninsula">Sinaï</name>. Les inscriptions qu'on
- y a trouvées ont été envoyées à Londres, et appartiennent aujourd'hui au Musée
- britannique.</p>
- <p> Transportons-nous au centre de l'<name type="place" key="Asie." rel="nofollow">http://dbpedia.org/resource/Asia">Asie</name>. Les frères <name type="person">Schlagintweit</name> (<name type="person" key="Herrmann," rel="nofollow">http://dbpedia.org/resource/Hermann_Schlagintweit">Herrmann</name>, <name type="person" key="Adolphe" rel="nofollow">http://dbpedia.org/resource/Adolf_Schlagintweit">Adolphe</name> et
- <name type="person" key="Robert)," rel="nofollow">http://dbpedia.org/resource/Robert_Schlagintweit">Robert</name>), voyageurs et naturalistes bavarois qui out accompli des missions si
- périlleuses dans l'<name type="place" key="Inde," rel="nofollow">http://dbpedia.org/resource/India">Inde</name>, l'<name type="place" key="Himalaya," rel="nofollow">http://dbpedia.org/resource/Himalayas">Himalaya</name>, le <name type="place" key="" rel="nofollow">http://dbpedia.org/resource/Tibet">
- Thibet</name>, le <name type="place" key="Turkestan," rel="nofollow">http://dbpedia.org/resource/Turkestan">Turkestan</name>, se sont attiré un juste tribut d'éloges et une réputation bien
- méritée de savoir et d'audace. La, réussite de leur oeuvre est incontestable: on leur
- doit des descriptions orthographiques très-précieuses, et particulièrement des données
- toutes nouvelles sur les monts <name type="place">Karakoroum</name> et <name type="place">Kouen-lun</name>; ils ont établi que ces montagnes formaient deux chaînes
- bien distinctes, ce qui n'avait jamais été compris avant eux. (Voir, pour la biographie
- de ces voyageurs, l'article Schlagintweit.)</p>
- <pb n="1"/>
- <p> L'orographie de l'<name type="place" key="Asie" rel="nofollow">http://dbpedia.org/resource/Asia">Asie</name> centrale s'est encore enrichie d'une observation bien importante: le
- colonel <name type="person">Waugh</name>, en 1856, a fait connaître que le pic le plus
- élevé de l'<name type="place" key="Himalaya" rel="nofollow">http://dbpedia.org/resource/Himalayas">Himalaya</name> est, non le <name type="place">Kitchitchinga</name>, comme on l'avait
- pensé quelque temps, ni le <name type="place">Dhaoulagiri</name>, qui avait passé
- longtemps pour le point culminant du monde, mais le pic <name type="place">Everest</name>, qu'on a ainsi appelé en l'honneur d'un savant géographe anglais, et
- qui atteint 8,840 mètres.</p>
- <p> A peu de distance de l'<name type="place" key="Indo-Chine," rel="nofollow">http://dbpedia.org/resource/Indochina">Indo-Chine</name>, les <name type="place">îles Andaman</name>, qui sont devenues
- récemment une possession anglaise, ont été le lieu d'exil du <name type="person">roi de
- Delhy</name>. Le gouvernement britannique y envoie un grand nombre de prisonniers, qui
- sont principalement relégués dans quelques petites îles voisines de la <name type="place">Grande Andaman</name>. Il y a quelques années, plusieurs déportés
- hindous, qui avaient vécu constamment à fond de cale durant la traversée, et qui, par
- conséquent, n'en avaient pas pu apprécier l'étendue, crurent, en apercevant les rives de
- la <name type="place">Grande Andaman</name>, n'être qu'à quelques milles de leur
- mère-patrie; ils conçurent le dessein de s'évader, et mirent à exécution leur projet;
- mais ils furent reçus à coups de poignard par les habitants, très-farouches, et qui sont
- même, dit-on, cannibales; ils se virent dans la nécessité , s'ils voulaient échapper à
- la mort, de reprendre humblement leurs fers.</p>
- <p>Si les <name type="people" key="Anglais" rel="nofollow">http://dbpedia.org/resource/English_people">Anglais</name> s'étendent au sud, les <name type="people" key="Russes" rel="nofollow">http://dbpedia.org/resource/Russians">Russes</name> menacent encore plus
- sérieusement le nord, où ils s'avancent à grands pas aux dépens du vaste empire <name type="people">Chinois</name>. Grâce au fleuve <name type="place">Amour</name>,
- aujourd'hui la moitié de la <name type="place" key="Mandchourie" rel="nofollow">http://dbpedia.org/resource/Manchuria_(region)">Mandchourie</name> se trouve
- enclavée dans les possessions des <name type="people" key="Russes;" rel="nofollow">http://dbpedia.org/resource/Russians">Russes</name>; des forteresses et des
- stations de <name type="people">Cosaques</name> ont été établies le long des rives du
- même fleuve, et des ingénieurs s'occupent du tracé de routes stratégiques destinées à
- les relier entre elles. Enfin les <name type="people" key="Russes" rel="nofollow">http://dbpedia.org/resource/Russians">Russes</name> s'avancent déjà dans la <name type="place">Dzoungarie</name> jusqu'au lac <name type="place">Issik-Koul</name>, qui
- est compris tout entier dans leur territoire. Dans le <name type="place">Turkestan
- occidental</name>, la <name type="place">mer d'Aral</name> leur appartient; ils
- tiennent le <name type="place">Khanat de Khiva</name> sous leur suzeraineté, et ils ont
- obtenu le droit exclusif de faire remonter le <name type="place">Djihoun</name> par
- leurs bâtiments. D'un autre côté, ils sont maîtres presque entièrement de la grande
- <name type="place">île de Sakhalien</name>. (Nous renvoyons, pour d'autres détails
- concernant l'<name type="place" key="Asie," rel="nofollow">http://dbpedia.org/resource/Asia">Asie</name>, aux
- articles <name type="place">Chine</name>, <name type="place" key="Japon," rel="nofollow">http://dbpedia.org/resource/Japan">Japon</name>, <name type="place" key="Inde," rel="nofollow">http://dbpedia.org/resource/India">Inde</name>, <name type="place">Siam</name>,
- <name type="place">Barmananie</name>, <name type="place">Perse</name>, <name type="place" key="Sibérie," rel="nofollow">http://dbpedia.org/resource/Siberia">Sibérie</name>, <name type="place">Anour</name>, <name type="place">Caucase</name>, <name type="place">Kirgitz</name>.)</p>
- <byline>Richard Cortambert</byline>
- </div>
- </div>
- <div type="entry" subtype="europe">
- <head>
- <term xml:id="europe">EUROPE</term>
- </head>
- <div type="article">
- <p> Nous n'avons pas à mentionner pour cette partie du monde des découvertes géographiques
- telles que celles que nous offrent les autres régions du globe; tout y est á peu près
- connu géographiquement; mais la topographie est encore l'objet de nombreuses
- améliorations: les cartes topographiques ne sont pas complètes ne beaucoup près. La
- <name type="place" key="France" rel="nofollow">http://dbpedia.org/resource/France">France</name> a terminé le
- levé, mais non la publication de cette grande et belle carte en 258 feuilles, dite de
- l'étal-major; plusieurs pays <name type="place" key="d'Allemagne" rel="nofollow">http://dbpedia.org/resource/Germany">d'Allemagne</name> ont leurs cartes
- topographiques achevées ou fort avancées; parmi les plus importantes, sont celle du
- <name type="place" key="Hanovre," rel="nofollow">http://dbpedia.org/resource/Hanover">Hanovre</name>, oeuvre du
- savant <name type="person">Papen</name>, dont la science déplore la perte récente; celle
- de la <name type="place" key="Bavière," rel="nofollow">http://dbpedia.org/resource/Bavaria">Bavière</name>, en
- 112 feuilles, qui n'est pas tout à fait complète; celles du grand-duché de <name type="place" key="Hesse," rel="nofollow">http://dbpedia.org/resource/Hesse">Hesse</name>, du <name type="place" key="Würtemberg," rel="nofollow">http://dbpedia.org/resource/Württemberg">Würtemberg</name>, du
- grand-duché de <name type="place" key="Bade," rel="nofollow">http://dbpedia.org/resource/Baden">Bade</name>,
- entièrement terminées; celles de la <name type="place" key="Hesse-Électorale," rel="nofollow">http://dbpedia.org/resource/Hesse-Kassel">Hesse-Électorale</name>, du royaume de
- <name type="place" key="Saxe," rel="nofollow">http://dbpedia.org/resource/Saxony">Saxe</name>, qui le sont à
- peu près. La <name type="place" key="Prusse" rel="nofollow">http://dbpedia.org/resource/Prussia">Prusse</name>
- avance beaucoup la carte de son état-major, et a même achevé toutes ses provinces
- occidentales (<name type="place">Rhin</name> et <name type="place" key="Westphalie)." rel="nofollow">http://dbpedia.org/resource/Westphalia">Westphalie</name>). <name type="place" key="L'Autriche" rel="nofollow">http://dbpedia.org/resource/Austria">L'Autriche</name> possède les cartes de
- presque toutes ses provinces, par les soins de son <name type="institut">Institut
- militaire géographique</name>; elle a même fait lever par lui <name type="place" key="l'Italie" rel="nofollow">http://dbpedia.org/resource/Italy">l'Italie</name> septentrionale et centrale
- (<name type="place" key="Lombardie," rel="nofollow">http://dbpedia.org/resource/Lombardy">Lombardie</name>, <name type="place" key="Vénetie," rel="nofollow">http://dbpedia.org/resource/Veneto">Vénetie</name>, <name type="place" key="États" rel="nofollow">http://dbpedia.org/resource/Papal_States">États de l'Église</name>,
- <name type="place">Toscane</name>, <name type="place">Parme</name> et <name type="place">Modène</name>). Le royaume de <name type="place">Sardaigne</name> a donné
- une grande partie de sa belle carte en 91 feuilles. <name type="place" key="Les" rel="nofollow">http://dbpedia.org/resource/Netherlands">Les Pays-Bas</name> avancent leur
- admirable monument topographique en 62 feuilles. La <name type="place" key="Belgique" rel="nofollow">http://dbpedia.org/resource/Belgium">Belgique</name> a sa grande carte de <name type="person">Van der Maelen</name>, en 250 feuilles, oeuvre énorme et gouvernemental,
- qu'a pu faire un simple particulier. La carte de la <name type="place" key="Suisse," rel="nofollow">http://dbpedia.org/resource/Switzerland">Suisse</name>, sous la direction du
- général <name type="person">Dufour</name>, est près d'être terminée; le canton de <name type="place" key="Genève," rel="nofollow">http://dbpedia.org/resource/Canton_of_Geneva">Genève</name>, publié
- sur une plus grande échelle que le reste, est un des plus charmants dessins
- topographiques dont s'enorgueillisse notre époque. </p>
- <p>Les <name type="place" key="Iles" rel="nofollow">http://dbpedia.org/resource/British_Isles">Iles
- britanniques</name> sont représentées dans le plus grand détail par <hi rend="italic">
- l'Ordnance Map</hi>. <name type="place">L'Irlande</name>, en 1,907 feuilles, est
- terminée: <name type="place" key="l'Angleterre" rel="nofollow">http://dbpedia.org/resource/England">l'Angleterre</name> et <name type="place" key="l'Écosse," rel="nofollow">http://dbpedia.org/resource/Scotland">l'Écosse</name>, publiées sur une échelle moins considérable, ne sont pas tout à fait
- achevées. La carte topographique du <name type="place">Danemark</name>, par l'état-major
- de ce pays, ne compte encore qu'un petit nombre de feuilles. <name type="place" key="La" rel="nofollow">http://dbpedia.org/resource/Sweden">La Suède</name> a commencé une carte
- topographique par loen (préfectures), qui remplacera avec avantage les anciennes cartes
- provinciales <name type="person">d'Hermelin</name>. La <name type="place" key="Norwége" rel="nofollow">http://dbpedia.org/resource/Norway">Norwége</name> en aura une par <hi rend="italic">amt</hi> (bailliages), plus détaillée que la carte, bonne cependant, de
- <name type="person">Munch</name>. On ne saurait croire combien les cartes les plus
- estimées, celles, par exemple, des meilleurs géographes allemands, sont encore fautive
- pour une foule de positions, pour une quantité de détails, de fleuves, de lacs, de
- fiords, dans une grande partie de la <name type="place" key="péninsule" rel="nofollow">http://dbpedia.org/resource/Scandinavian_Peninsula">péninsule scandinave</name>:
- les cartes topographiques qui se préparent seront donc de la plus grande utilité pour
- l'amélioration de la géographique générale de <name type="place" key="l'Europe." rel="nofollow">http://dbpedia.org/resource/Europe">l'Europe</name>. <name type="place" key="L'Espagne" rel="nofollow">http://dbpedia.org/resource/Spain">L'Espagne</name> et <name type="place" key="le" rel="nofollow">http://dbpedia.org/resource/Portugal">le Portugal</name> n'ont pas encore de
- travail propre à remplacer la carte trèsdéfectueuse de <name type="person">Thomas
- Lopez</name>; cependant l'état-major espagnol a commencé en 1856 sa triangulation pour
- l'exécution d'une grande carte topographique qui doit s'étendre à toute la <name type="place" key="Péninsule;" rel="nofollow">http://dbpedia.org/resource/Scandinavian_Peninsula">Péninsule</name>; don <name type="person">Francisco Coello</name> a donné plusieurs
- bonnes cartes de provinces, et il continue avec succès son estimable oeuvre de
- topographie, qui fera attendre avec patience le grand travail dont nous venons de
- parler. </p>
- <p>La <name type="place">Russie d'Europe</name> a besoin d'une topographie plus complète
- et plus exacte que celle des généraux <name type="person">Souchtelen</name> et <name type="person">Opermann</name> (1812) et du général <name type="person">Schubert</name>
- (1837). La <name type="institute">Société géographique de Russie</name> s'occupe avec
- activité de tout ce qui peut amener la connaissance complète du pays: elle a donné des
- cartes détaillées de plusieurs parties, entre autres, du gouvernement de <name type="place" key="Tver;" rel="nofollow">http://dbpedia.org/resource/Tver">Tver</name>; elle a décidé, en
- 1857, l'exécution d'une carte topographique de tout le territoire russe européen et du
- <name type="place" key="Caucase," rel="nofollow">http://dbpedia.org/resource/Caucasus">Caucase</name>, à
- l'échelle de 1/1680000; le docteur <name type="person">Hoffmann</name> vient de publier
- ses observations d'altitude sur une grande partie des monts <name type="place" key="Ourals;" rel="nofollow">http://dbpedia.org/resource/Ural_Mountains">Ourals</name>; les altitudes de la
- <name type="place">Finlande</name> ont été l'object de travaux récents de <name type="person">MM. Gylden</name> et <name type="person">Struve</name>. Des
- reconnaissances topographiques encore plus récentes, par <name type="person">MM.
- Popiel</name>, <name type="person">Ivanov</name> et <name type="person">Nasarov</name>, ont fait voir que le <name type="person">Manitch</name>, qu'on croyait
- tributaire seulement du Don, a un autre écoulement vers la mer <name type="place">Caspienne</name>, à laquelle il arrive par une traînée de lacs près de l'embouchure
- de la <name type="place">Kouma</name>.</p>
- <p> La <name type="place" key="Turquie" rel="nofollow">http://dbpedia.org/resource/Turkey">Turquie</name> est le
- pays <name type="place" key="d'Europe" rel="nofollow">http://dbpedia.org/resource/Europe">d'Europe</name> dont la
- topographie est le moins connue; la géographie générale el1e-méme y offre de grandes
- lacunes: les voyages de <name type="person">MM. Boué</name> et <name type="person">Viquesnel</name> ont avancé cependant, dans ces dernières années, la connaissance des
- parties centrales, spécialement de la <pb n="1"/>
- <name type="place" key="Thrace," rel="nofollow">http://dbpedia.org/resource/Thrace">Thrace</name>, de la <name type="place">Macédoine</name> et de <name type="place" key="l'Albanie;" rel="nofollow">http://dbpedia.org/resource/Albania">l'Albanie</name>; l'orographie et la
- géologie leur doivent surtout beaucoup; plus récemment, <name type="person">M.
- Lejean</name> a éclairé quelques points de la géographie de la <name type="place" key="Bulgarie" rel="nofollow">http://dbpedia.org/resource/Bulgaria">Bulgarie</name> et du <name type="place" key="Montenegro;" rel="nofollow">http://dbpedia.org/resource/Montenegro">Montenegro</name>; <name type="person">M.
- Hecquard</name> a donné sur la haute <name type="place" key="Albanie" rel="nofollow">http://dbpedia.org/resource/Albania">Albanie</name> des renseignements tout à
- fait neufs; M. le docteur <name type="person">Poyet</name> a décrit le territoire <name type="place">d'Islimnia</name> et d'autres parties encore peu connues du voisinage du
- <name type="place" key="Balkan." rel="nofollow">http://dbpedia.org/resource/Balkans">Balkan</name>. Des
- commissions françaises, topographiques et sanitaires: envoyées dans la <name type="place" key="Dobroudja" rel="nofollow">http://dbpedia.org/resource/Dobruja">Dobroudja</name> à la suite de
- l'expédition militaire de 1854-1855, et dont faisaient partie <name type="person">MM.
- Lalanne</name>, <name type="person">Michel</name>, <name type="person">Allard</name>,
- etc., ont rectifié bien des idées erronées sur cette presqu'île remarquable, <name type="place">le delta du Danube</name> a été étudié avec plus de soin par les
- ingénieurs européens; beaucoup de renseignement nouveaux ont été donnés sur la <name type="place">Moldavie</name> et la <name type="place" key="Malachie," rel="nofollow">http://dbpedia.org/resource/Wallachia">Malachie</name>, devenues des principautés
- unies et les <name type="people" key="Autrichiens" rel="nofollow">http://dbpedia.org/resource/Austrians">Autrichiens</name> ont levé la carte de la <name type="place" key="Malachie." rel="nofollow">http://dbpedia.org/resource/Wallachia">Malachie</name>. Les <name type="people">Serbes</name> s'occupent de faire celle de leur principauté.</p>
- <p>
- <name type="person">M. Basile Nicolaïdy</name>, Grec plein d'enthousiasme pour son
- pays, a fait, dans ces derniers temps, un excellent voyage en <name type="place">Macédoine</name> et en <name type="place" key="Thessalie," rel="nofollow">http://dbpedia.org/resource/Thessaly">Thessalie</name>, et en a publié la relation en français sous le titre de <q>Les
- Turcs et la Turquie contemporaine</q>. <name type="institut">l'école française
- d'Athènes</name> continue à nous éclairer sur les points les moins connus de la <name type="place" key="Grèce:" rel="nofollow">http://dbpedia.org/resource/Greece">Grèce</name>: parmi les plus
- importants de ses derniers travaux géographiques, on peut remarquer la description de
- <name type="place" key="l'Acarnanie" rel="nofollow">http://dbpedia.org/resource/Acarnania">l'Acarnanie</name> et
- de la <name type="place" key="Thessalie." rel="nofollow">http://dbpedia.org/resource/Thessaly">Thessalie</name>.</p>
- <p>En dépit des vastes plans de remaniements que nous présentaient naguère certaines
- publications cartographiques, entourées d'un moment de vogue, le commencement de cette
- année 1860, qui devait voir tant de changements dans la carte d' <name type="place" key="l'Europe," rel="nofollow">http://dbpedia.org/resource/Europe">l'Europe</name>, ne trouve pas cette partie
- du monde très différente de ce qu'elle était en 1856, avant le traité de <name type="place" key="Paris." rel="nofollow">http://dbpedia.org/resource/Paris">Paris</name>. Les seules
- modifications dans la carte politique sont: la cession du territoire entre le <name type="place">Danube</name> et le <name type="place">Val de Trajan</name>, faite par la
- <name type="place" key="Russie" rel="nofollow">http://dbpedia.org/resource/Russia">Russie</name> à la
- principauté de <name type="place" key="Moldavie;" rel="nofollow">http://dbpedia.org/resource/Moldova">Moldavie</name>; le <name type="place">delta du Danube</name> remis tout entier à la
- <name type="place" key="Turquie;" rel="nofollow">http://dbpedia.org/resource/Turkey">Turquie</name>; <name type="place" key="Lombardie," rel="nofollow">http://dbpedia.org/resource/Lombardy">Lombardie</name>, enfin,
- enlevée à <name type="place" key="l'Autriche" rel="nofollow">http://dbpedia.org/resource/Austria">l'Autriche</name>
- par les préliminaires de <name type="place">Villafranca</name> et le traité de <name type="place">Zurich</name>, et transférée au royaume de <name type="place">Sardaigne</name>.</p>
- <p>Nous résumons dans le tableau suivant la situation politique et statistique de <name type="place" key="l'Europe" rel="nofollow">http://dbpedia.org/resource/Europe">l'Europe</name> au commencement
- de 1860.</p>
- <byline>E.Cortambert</byline>
- </div>
- </div>
- <div type="entry" subtype="asia">
- <head>
- <term xml:id="orientalisme">ORIENTALISME</term>
- </head>
- <div type="article">
- <p>Nous avons expose sous ce litre, dans le Supplément de l'Encyclopédie, l'état actuel
- des études orientales. Nous allons donner ici un aperçu des publications de mémé nature
- qui ont été faites en <name type="place" key="Europe" rel="nofollow">http://dbpedia.org/resource/Europe">Europe</name> dans le courant de l'année 1859, en y comprenant celles qui, à notre
- connaissance, ont été faite dans certaines parties de l'<name type="place" key="Orient." rel="nofollow">http://dbpedia.org/resource/Orient">Orient</name>.</p>
- </div>
- <div type="sub">
- <head> Langues sémitiques</head>
- <p>Les langues sémitiques continuent à être l'objet de la prédilection de la plupart des
- orientalistes. L'un des plus infatigables éditeurs de textes arabes est <name type="person">M. Wüstenfeld</name>, de <name type="place">Goettingue</name>, qui a
- publié <hi rend="italic">l'Histoire de la vie de Mahomet</hi> en <name type="language" key="arabe," rel="nofollow">http://dbpedia.org/resource/Arabic_language">arabe</name>, par <name type="person">Jbn Is'hak</name>, composée dans la première moitié du ne siècle de
- l'hègyre. Il a aussi donné un ouvrage sur <hi rend="italic">la Mecque</hi>, par Azraki,
- aux frais de la <name type="institution">Société orientale de l'Allemagne</name>, dont
- le siége est à <name type="place" key="Leipzig." rel="nofollow">http://dbpedia.org/resource/Leipzig">Leipzig</name>. <name type="person">MM. Dozy</name>, <name type="person">Dugat</name>, <name type="person">Krehl</name> et <name type="person">Wright</name> ont
- continué la publication de leurs textes arabes relatifs à <hi rend="italic">l'Histoire
- et à la littérature des Arabes d' Espagne</hi>. En <name type="place" key="France" rel="nofollow">http://dbpedia.org/resource/France">France</name>
- <name type="person">M. Barbier de Meynard</name> fait imprimer un frag-<pb n="1"/>ment,
- relatif à la Perse, de la grande <hi rend="italic">Géographie</hi> de <name type="person" key="Yakout," rel="nofollow">http://dbpedia.org/resource/Yaqut_al-Hamawi">Yakout</name>, qui
- vivait au commencement du <name type="period" key="XIIIe" rel="nofollow">http://dbpedia.org/resource/13th_century">XIIIe siècle</name> de notre ère. Si
- l'histoire arabe est toujours très-cultivée, la poésie n'est pas négligée. <name type="person">M. Engelmann</name> a publié à <name type="place">Leyde</name>, en <name type="language" key="arabe," rel="nofollow">http://dbpedia.org/resource/Arabic_language">arabe</name>, avec
- une version <name type="language" key="latine" rel="nofollow">http://dbpedia.org/resource/Latin">latine</name>
- et des notes, le <hi rend="italic">Divan</hi> de <name type="person">Hadirah</name>,
- poète contemporain de <name type="person" key="Mahomet." rel="nofollow">http://dbpedia.org/resource/Muhammad">Mahomet</name>. <name type="person">M. Dieterici</name>, à <name type="place">Berlin</name>, a continué la publication des poésies de <name type="person">Motenabbi</name>, avec le commentaire de <name type="person">Wàhidi</name>. <name type="person">M. W. Wright</name>, professeur d'arabe à <name type="place">Dublin</name>, a publié à <name type="place">Leyde</name> quelques opuscules arabes
- curieux, relatifs à la métrique et à la poésie. Le même savant a aussi fait paraître la
- première partie d'une traduction <name type="language" key="anglaise" rel="nofollow">http://dbpedia.org/resource/English_language">anglaise</name> de la grammaire
- <name type="language" key="arabe" rel="nofollow">http://dbpedia.org/resource/Arabic_language">arabe</name>
- de <name type="person">Caspari</name>, publiée originairement en <name type="language" key="latin," rel="nofollow">http://dbpedia.org/resource/Latin">latin</name>, et dont une traduction <name type="language" key="allemande" rel="nofollow">http://dbpedia.org/resource/German_language">allemande</name>
- complète vient aussi de paraître à <name type="place">Leipzig</name>. <name type="person">M. Wright</name> y a ajouté d'excellentes notes et de nombreux
- rapprochements avec les formes similaires de <name type="language" key="l'hébreu," rel="nofollow">http://dbpedia.org/resource/Hebrew_language">l'hébreu</name>, du <name type="language" key="" rel="nofollow">http://dbpedia.org/resource/Syriac_language"> syriaque</name> et
- de <name type="language">l'éthiopien</name>. <name type="person">M. G. Flüegel</name> a
- livré au public son septième et dernier volume (in-4°) du grand <hi rend="italic">Dictionnaire bibliographique et encyclopédique de Hadji-Khalfa</hi>, dont le <hi rend="italic">
- <name type="institution">Comité des traductions</name>
- </hi> de <name type="place">Londres</name> a fait les frais. Enfin, <name type="person">M.
- Munk</name> a donné un volume intitulé <hi rend="italic">Mélanges de philosophie juive
- et arabe</hi>, qui comprend les différents articles qu'il avait publiés auparavant
- dans le <hi rend="italic"> Dictionnaire des sciences philosophiques</hi>, mais complétés
- et enrichis de nombreux documents qui donnent à cette publication une valeur toute
- scientifique.</p>
- <p>La langue <name type="language" key="syriaque" rel="nofollow">http://dbpedia.org/resource/Syriac_language">syriaque</name> a donné lieu encore à de nombreux travaux. <name type="person">M.
- Lagarde</name> a publié à <name type="place">Leipzig</name> des <hi rend="italic">Analecta syriaca</hi>; <name type="person">MM. W. Cureton</name> et <name type="person">Payne-Smith</name> ont fait paraître en <name type="place" key="Angleterre" rel="nofollow">http://dbpedia.org/resource/England">Angleterre</name> plusieurs nouveaux
- fragments de traductions <name type="language">syriaques
- key="" rel="nofollow">http://dbpedia.org/resource/Syriac_language"</name> du Nouveau Testament.</p>
- <p>Les tentatives de déchiffrement des inscriptions assyriennes continuent aussi avec plus
- ou moins de succès. <name type="person">M. Ménant</name> a fait paraître à <name type="place">Caen</name> deux <hi rend="italic">Mémoires</hi> sur les inscriptions
- assyriennes et les briques de <name type="place">Babylone</name>. <name type="person">M.
- Jules Oppert</name> a achevé la publication (à l'imprimerie impériale) du deuxième
- volume de <hi rend="italic">l'Expédition scientifique de la Mésopotamie</hi>, exécutée
- par ordre du gouvernement français. Ce second volume comprend le <hi rend="italic">Déchiffrement des inscriptions cunéiformes</hi> recueillies pendant l'expédition ou
- tirées d'autres sources. Si la publication de <name type="person">M. Oppert</name> n'est
- pas la première en date, c'est au moins le premier traité systématique sur cette partie
- nouvelle et très-hardie de la linguistique orientale; et si un certain nombre des
- importants résultats auxquels l'auteur croit être arrivé ne sont pas confirmés par les
- travaux ultérieurs, les bases de la science du déchiffrement des inscriptions
- cunéiformes, assyriennes et babyloniennes, nous paraissent reposer désormais sur de
- solides fondements.</p>
- <p>L'étude des hiéroglyphes égyptiens, cultivée par un petit nombre d'adeptes, confirme de
- plus en plus le système d'interprétation fondé par Champollion, mort à la peine. <name type="person">M. Bunsen</name> a fait paraître le 3e volume de son édition <name type="language" key="anglaise" rel="nofollow">http://dbpedia.org/resource/English_language">anglaise</name> de
- <hi rend="italic">La place de l'Égypte dans l'histoire universelle</hi>. <name type="person">M. Brugsch</name> a publié en <name type="language" key="français" rel="nofollow">http://dbpedia.org/resource/French_language">français</name> le premier volume de
- <hi rend="italic">l'Histoire de l'Égypte ancienne</hi>, que lui a commandé le <name type="person">pacha d'Égypte</name>; <name type="person">M. Mariette</name> continue,
- au nom du même pacha, l'exploration des antiquités pharaoniques qui couvrent encore le
- sol de <name type="place">http://dbpedia.org/resource/Ancient_Égypte">l'antique
- Égypte</name>, et chaque jour de nouvelles découvertes viennent enrichir les trésors
- de la science. Enfin, <name type="person">M. Lepsius</name> à <name type="place">Berlin</name>, <name type="place">M. Birch</name> à <name type="place">Londres</name>, et <name type="person">M. le vicomte de Rougé</name> à <name type="place">Paris</name>, continuent avec un succès bien démontré l'interprétation de
- ces mystérieux caractères dont on ne croyait jamais pouvoir dérober les secrets à la
- tombe. La traduction annoncée du grand <hi rend="italic">Rituel funéraire</hi>, par
- <name type="person">M. Birch</name>, et l'exposition de la religion et de la
- philosophie des <name type="people">Égyptiens</name>, 600 ans avant <name type="person" key="Moïse," rel="nofollow">http://dbpedia.org/resource/Moses">Moïse</name>, par <name type="person">M. de
- Rougé</name>, viendront bientôt confirmer d'une manière définitive toutes les
- promesses de la science.</p>
- </div>
- <div type="sub">
- <head>Langues Arie</head>
- <p>La littérature sanskrite semble vouloir se ranimer en <name type="place" key="France." rel="nofollow">http://dbpedia.org/resource/France">France</name>. <name type="person">MM.
- Oppert</name>, <name type="person">Emile Burnouf</name> et <name type="person">Rodet</name> ont publié chacun des <hi rend="italic">Grammaires sanskrites</hi>
- élémentaires destinées à faciliter l'étude de cette langue savante aux commençants. Un
- <hi rend="italic">Dictionnaire sanskrit-français</hi>, dont nous manquons encore, est
- aussi annoncé en caractères européens. Un glossaire sanskrit de mots spéciaux a été
- édité à <name type="place">Bonn</name> par <name type="person">M. Aufrecht</name> (<hi rend="italic">Udjdjvuladatta's commentary on the unâdisâtras</hi>). Le même indianiste
- a fait paraître à <name type="place">Oxford</name> la première partie de son Catalogue
- des ouvrages sanskrits de la Bibliothèque bodléienne. <name type="person">M.
- Kosegarten</name> poursuit ses travaux indiens; il a publié la première partie du <hi rend="italic">Pantchatantra</hi>, rédaction moderne du plus ancien recueil de fables
- indiennes, dont il avait déjà publié la rédaction ancienne. <name type="person">M.
- Sadous</name> a donné au public une traduction <name type="language" key="français" rel="nofollow">http://dbpedia.org/resource/French_language">français</name> des <hi rend="italic">Lectures sur la littérature indienne</hi> de <name type="person">A.
- Weber</name>; il est à regretter que le traducteur ait conservé presque partout, dans
- sa traduction, l'orthographe <name type="language" key="allemande" rel="nofollow">http://dbpedia.org/resource/German_language">allemande</name> des noms sanskrits,
- rendus souvent ainsi méconnaissables. <name type="person">M. Max Muller</name> a aussi
- fait paraître, à <name type="place">Londres</name>, une <hi rend="italic">Histoire de
- l'ancienne littérature sanskrite</hi>, dans laquelle on retrouve le profond savoir de
- l'éditeur du <hi rend="italic">Rig-veda</hi>. <name type="person">M. James R.
- Ballantyne</name>, de retour de <name type="place">l'Inde</name>, où il était
- principal du collège de <name type="place" key="Bénarès," rel="nofollow">http://dbpedia.org/resource/Varanasi">Bénarès</name>, a mis à profit ses longues études: nous lui devons un <hi rend="italic">Essai</hi>, en quatre livres, sanskrit et <name type="language" key="anglaise," rel="nofollow">http://dbpedia.org/resource/English_language">anglaise</name>, sur le <hi rend="italic">Christianisme comparé à la philosophie indienne</hi>, dont il a édité,
- dans <name type="place">l'Inde</name>, la plupart des systèmes. Cet essai prouve chez
- <name type="person">M. Ballantyne</name> une grande connaissance de ces systèmes et de
- la langue dans laquelle ils ont été exposés. A <name type="place">Londres</name> aussi
- on a accueilli très-favorablement le premier volume des <hi rend="italic">Textes
- originaux sanskrits, sur l'origine et le <pb n="2"/> développement de la religion et
- des institutions de <name type="place">l'Inde</name>
- </hi>, recueillis par <name type="person">M. Muir</name>; il est à souhaiter qu'il en donne bientôt la suite. Ces
- textes, toujours accompagnés d'une traduction <name type="language" key="anglaise," rel="nofollow">http://dbpedia.org/resource/English_language">anglaise</name>, sont d'une haute
- importance pour les études sanskrites.</p>
- <p> La langue de <name type="person" key="Zoroastre" rel="nofollow">http://dbpedia.org/resource/Zoroaster">Zoroastre</name> n'est pas négligée en <name type="place" key="Allemagne:" rel="nofollow">http://dbpedia.org/resource/Germany">Allemagne</name>: <name type="person">M.
- Spiegel</name> a publié à <name type="place">Vienne</name> le deuxième volume du texte
- de l'<hi rend="italic">Avesta</hi>, comprenant le <hi rend="italic">Vispered</hi> et le
- <hi rend="italic">Yaçna</hi>, accompagné de la traduction <hi rend="italic">huzvaresch</hi>; et, à <name type="place">Leipzig</name>, le second volume de sa
- traduction allemande du texte <hi rend="italic">Zend</hi>, plus littérale et plus exacte
- que celle d'<name type="person">Anquetil Duperron</name>, laquelle, cependant, restera
- toujours un monument glorieux de dévouement à la science. <name type="person">M. Martin
- Haug</name> a inséré dans les <hi rend="italic">Mémoires pour la science de
- l'Orient</hi>, édités à <name type="place">Leipzig</name> par la <name type="insituion">Société orientale allemande</name> (n° 3), la première partie des <hi rend="italic">Gâthâs</hi> ou <hi rend="italic">Hymnes</hi> de <name type="person" key="Zoroastre," rel="nofollow">http://dbpedia.org/resource/Zoroaster">Zoroastre</name>, avec une traduction
- <name type="language" key="latine" rel="nofollow">http://dbpedia.org/resource/Latin">latine</name> et un
- commentaire. Enfin, on attend toujours le grand travail de <name type="person">M.
- Westergaard</name> sur les livres de <name type="person" key="Zoroastre," rel="nofollow">http://dbpedia.org/resource/Zoroaster">Zoroastre</name>, lequel travail doit
- comprendre une traduction <name type="language" key="anglaise," rel="nofollow">http://dbpedia.org/resource/English_language">anglaise</name>, une grammaire et
- un dictionnaire zends comparés.</p>
- <p> Il n'est venu à notre connaissance, en fait de publications persanes, qu'un volume
- publié à <name type="place">Calcutta</name> par <name type="person">M.
- Nassau-Lees</name> et intitulé <hi rend="italic">Les vies des Soufis</hi>, par <name type="person">Djami</name> (en <name type="language" key="persan)," rel="nofollow">http://dbpedia.org/resource/Persian_language">persan</name>), et une traduction
- <name type="language" key="anglaise" rel="nofollow">http://dbpedia.org/resource/English_language">anglaise</name> des <hi rend="italic">Mémoires</hi> de <name type="person">Mahmoud le
- Ghaznévide</name>, par <name type="person">M. Reynolds</name>, publiée à <name type="place">Londres</name>. En <name type="place" key="Allemagne," rel="nofollow">http://dbpedia.org/resource/Germany">Allemagne</name>, <name type="person">M.
- Hermann Brockhaus</name> continue sa belle édition des <hi rend="italic">Poésies de
- Hafiz</hi>, avec le <hi rend="italic">Commentaire</hi>
- <name type="language" key="persan)" rel="nofollow">http://dbpedia.org/resource/Persian_language">persan</name>)
- de Soudi, et <name type="person">M. Vullers</name> le second volume de son <hi rend="italic">Dictionnaire</hi>
- <name type="language" key="persan- |
|
From: <dmc...@us...> - 2011-12-31 03:33:02
|
Revision: 15626
http://exist.svn.sourceforge.net/exist/?rev=15626&view=rev
Author: dmccreary
Date: 2011-12-31 03:32:55 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
Worked on trying to integrate the CSS into the documentation style module.
Modified Paths:
--------------
apps/docs/modules/style.xqm
Added Paths:
-----------
apps/docs/data/article-template.xml
Added: apps/docs/data/article-template.xml
===================================================================
--- apps/docs/data/article-template.xml (rev 0)
+++ apps/docs/data/article-template.xml 2011-12-31 03:32:55 UTC (rev 15626)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen SCHSchema="../resources/schemas/docbook.xsd" type="xml"?>
+<section xmlns="http://docbook.org/ns/docbook" xml:id="article-template" version="5.0" status="draft">
+ <info>
+ <revhistory>
+ <revision>
+ <date/>
+ <author xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/docs/author.xq?p=dan.mccreary"/>
+ <revdescription/>
+ </revision>
+ </revhistory>
+ <keywordset>
+ <keyword>style</keyword>
+ <keyword>formatting</keyword>
+ </keywordset>
+ </info>
+ <title>Technical Topic Template</title>
+ <subtitle>Template file used to create a new topic section.</subtitle>
+ <para/>
+ <section>
+ <title>Section 1 Title</title>
+ <para>Para 1</para>
+ <programlisting language="xml"><![CDATA[<root>
+<message>Hello World</message>
+</root>]]></programlisting>
+ <para>Para</para>
+ </section>
+ <section>
+ <title>Section 1 Title</title>
+ <para>
+ <note>
+ <simpara>
+ Hello world
+ </simpara>
+ </note>
+ <programlisting language="xml"><![CDATA[<note>
+ <simpara>
+ Hello world
+ </simpara>
+</note>]]></programlisting>
+ </para>
+ </section>
+</section>
\ No newline at end of file
Modified: apps/docs/modules/style.xqm
===================================================================
--- apps/docs/modules/style.xqm 2011-12-31 02:44:38 UTC (rev 15625)
+++ apps/docs/modules/style.xqm 2011-12-31 03:32:55 UTC (rev 15626)
@@ -59,12 +59,25 @@
declare variable $style:db-path-to-app-data := request:get-parameter('db-path-to-app-data', '');
:)
+(: the config file must be somewhere in the /db collection system for this style module to work :)
+declare variable $style:config-file := collection('/db')/exist-docs-config;
+
+declare variable $style:db-base := '/db/apps/exist-docs';
+(: we should read this in from a config file....
+declare variable $style:db-base := $style:config-file//base-db-path/text();
+:)
+
+declare variable $style:db-path-to-site := '/db';
declare variable $style:web-path-to-site := '/rest/db';
-declare variable $style:web-path-to-app := '/rest/db/apps/exist-docs';
-declare variable $style:db-path-to-site := '/db';
-declare variable $style:db-path-to-app := '/db/apps/exist-docs';
-declare variable $style:db-path-to-app-data := '/db/apps/exist-docs/data';
+declare variable $style:db-path-to-app := $style:db-base;
+declare variable $style:web-path-to-app := concat('/rest', $style:db-base);
+
+declare variable $style:db-path-to-app-data := concat($style:db-path-to-app, '/data');
+declare variable $style:web-path-to-resources := concat($style:web-path-to-app, '/resources');
+declare variable $style:web-path-to-images := concat($style:web-path-to-resources, '/images');
+declare variable $style:web-path-to-css := concat($style:web-path-to-resources, '/css');
+
(: Returns an integer between 1-4, reflecting the hierarchical depth of the current request, e.g.
/cms/ = 1, /cms/apps/ = 2, /cms/apps/template/ = 3, /cms/apps/template/views/view-item = 4 :)
declare variable $style:web-depth-in-site := xs:integer(request:get-parameter('web-depth-in-site', '1'));
@@ -81,6 +94,7 @@
style:assemble-page(style:title(), style:breadcrumbs(), (), $content)
};
+(: this is the main two parameter page assembler :)
declare function style:assemble-page($title as xs:string, $content as node()+) as element() {
style:assemble-page($title, style:breadcrumbs(), (), $content)
};
@@ -245,10 +259,10 @@
(
<script type="text/javascript" src="{$style:web-path-to-site}/resources/js/jquery.js"></script>,
<script src="http://static.simile.mit.edu/timeline/api-2.3.0/timeline-api.js?bundle=true" type="text/javascript"></script>,
- <link rel="stylesheet" href="{$style:web-path-to-site}/resources/css/blueprint/screen.css" type="text/css" media="screen, projection" />,
- <link rel="stylesheet" href="{$style:web-path-to-site}/resources/css/blueprint/print.css" type="text/css" media="print" />,<!--[if IE ]><link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->,
- <link rel="stylesheet" href="{$style:web-path-to-site}/resources/css/styles.css" type="text/css" media="screen, projection" />,
- <link rel="stylesheet" href="{$style:web-path-to-site}/resources/css/print.css" type="text/css" media="print" />
+ <link rel="stylesheet" href="{$style:web-path-to-css}/blueprint/screen.css" type="text/css" media="screen, projection" />,
+ <link rel="stylesheet" href="{$style:web-path-to-css}/blueprint/print.css" type="text/css" media="print" />,<!--[if IE ]><link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->,
+ <link rel="stylesheet" href="{$style:web-path-to-css}/exist.css" type="text/css" media="screen, projection" />,
+ <link rel="stylesheet" href="{$style:web-path-to-css}/resources/css/print.css" type="text/css" media="print" />
)
else if ($page-type eq 'xforms') then
(
@@ -282,7 +296,7 @@
:)
declare function style:header()
as node()+ {
- let $banner-image := $style:site-info//xrx:site-header-banner-image/text()
+ let $banner-image := 'header.gif'
let $banner-alt-text := $style:site-info//xrx:site-header-banner-image-alt-text/text()
let $user-id := xmldb:get-current-user()
let $user-name := $user-id
@@ -294,7 +308,7 @@
<div class="banner span-17">
<div class="inner-left">
<a href="{$style:web-path-to-site}/">
- <img src="{concat($style:web-path-to-site, $banner-image)}" alt="{$banner-alt-text}"/>
+ <img src="{concat($style:web-path-to-images, '/', $banner-image)}" alt="{$banner-alt-text}"/>
</a>
</div>
</div>
@@ -318,10 +332,7 @@
<input type="hidden" name="logout" value="1"/>
}
<input type="submit" class="actionbox" value="{$login-action}"/>
-
- { if ($user-id = "guest") then () else (<br/>,
- <a href="{$style:web-path-to-site}/apps/user/edit/edit-self">Account Info</a>)
- }
+
</form>
</div>
</div>
@@ -329,11 +340,13 @@
</div>
</div>,
<div id="site-message" class="span-24 last">{$style:site-info//xrx:site-message/text()}</div>,
+ (:
<div id="idletimeout" class="span-24 last">
You will be logged off in <span><!-- countdown place holder --></span> seconds due to inactivity.
<a id="idletimeout-resume" href="#">Click here to continue using this web page</a>.
- </div>
- ,
+ </div> ,
+ :)
+
<hr class="banner-foot"/>
(: use the following for a site-wide menu system :)
(:
@@ -356,12 +369,7 @@
return
<div class="span-24 last">
<div class="inner">
- <div class="footer">
- {$footer-message}
- <p class="svn-info">
- Working Copy Revision: {$style:site-info//xrx:site-subversion-revision-number/text()}
- </p>
- </div>
+ <div id="footer">eXist Documentation Project {$style:db-path-to-app-data}</div>
</div>
</div>
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dmc...@us...> - 2011-12-31 02:44:46
|
Revision: 15625
http://exist.svn.sourceforge.net/exist/?rev=15625&view=rev
Author: dmccreary
Date: 2011-12-31 02:44:38 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
Added initial document to XHTML. Need more test data.
Modified Paths:
--------------
apps/docs/modules/docbook5-to-xhtml.xqm
Added Paths:
-----------
apps/docs/modules/docbook-to-epub.xqm
apps/docs/modules/docbook-to-fo.xqm
apps/docs/modules/exist-admin-style.xqm
apps/docs/search/
apps/docs/views/
apps/docs/views/list-documents.xq
apps/docs/views/view-doc.xq
Added: apps/docs/modules/docbook-to-epub.xqm
===================================================================
--- apps/docs/modules/docbook-to-epub.xqm (rev 0)
+++ apps/docs/modules/docbook-to-epub.xqm 2011-12-31 02:44:38 UTC (rev 15625)
@@ -0,0 +1,563 @@
+(:~
+ A module for generating an EPUB file out of a DocBook 5 document with a <book> root element.
+
+ Requires eXist 1.5dev rev. 11085 or later.
+
+ @version 0.1
+
+ @see http://en.wikipedia.org/wiki/EPUB
+ @see http://www.ibm.com/developerworks/edu/x-dw-x-epubtut.html
+ @see http://code.google.com/p/epubcheck/
+
+ To import:
+
+ import module namespace epub = "http://danmccreary.com/xquery/docbook-to-epub" at "xmldb:exist:///db/nosql/modules/docbook-to-epub.xqm";
+
+:)
+
+module namespace epub = "http://danmcreary.com/xquery/docbook-to-epub";
+
+import module namespace compression = "http://exist-db.org/xquery/compression";
+import module namespace render = "http://danmcreary.com/docbook-render" at "xmldb:exist:///db/nosql/modules/docbook-render.xqm";
+import module namespace docbook = "http://danmcreary.com/xquery/docbook" at "xmldb:exist:///db/nosql/modules/docbook.xqm";
+
+declare namespace tei="http://www.tei-c.org/ns/1.0";
+declare namespace ncx ="http://www.daisy.org/z3986/2005/ncx/";
+
+(:~
+ Main function of the EPUB module for assembling EPUB files:
+ Takes the elements required for an EPUB document (wrapped in <entry> elements),
+ and uses the compression:zip() function to returns a complete EPUB document.
+
+ @param $title the dc:title of the EPUB
+ @param $creator the dc:creator of the EPUB
+ @param $text the tei:text element for the file, which contains the divs to be processed into the EPUB
+ @param $urn the urn to use in the NCX file
+ @param $db-path-to-resources the db path to the required static resources (cover.jpg, stylesheet.css)
+ @param $filename the name of the EPUB file, sans file extension
+ @return serialized EPUB file
+
+ @see http://demo.exist-db.org/exist/functions/compression/zip
+:)
+declare function epub:generate-epub($title, $creator, $text, $urn, $db-path-to-resources, $cover, $filename) {
+ let $entries :=
+ (
+ epub:mimetype-entry(),
+ epub:container-entry(),
+ epub:content-opf-entry($title, $creator, $urn, $text),
+ epub:cover-xhtml-entry($title),
+ epub:title-xhtml-entry($filename),
+ epub:table-of-contents-xhtml-entry($title, $text, true()),
+ epub:body-xhtml-entries($text),
+ epub:stylesheet-entry($db-path-to-resources),
+ epub:toc-ncx-entry($urn, $title, $text),
+ epub:cover-entry($cover),
+ epub:graphic-entries($text, $filename)
+ )
+ return
+ (
+ response:set-header("Content-Disposition", concat("attachment; filename=", concat($filename, '.epub')))
+ ,
+ response:stream-binary(
+ compression:zip( $entries, true() ),
+ 'application/epub+zip',
+ concat($filename, '.epub')
+ )
+ )
+};
+
+(:~
+ Helper function, returns the mimetype entry.
+ Note that the EPUB specification requires that the mimetype file be uncompressed.
+ We can ensure the mimetype file is uncompressed by passing compression:zip() an entry element
+ with a method attribute of "store".
+
+ @return the mimetype entry
+:)
+declare function epub:mimetype-entry() {
+ <entry name="mimetype" type="text" method="store">application/epub+zip</entry>
+};
+
+(:~
+ Helper function, returns the META-INF/container.xml entry.
+
+ @return the META-INF/container.xml entry
+:)
+declare function epub:container-entry() {
+ let $container :=
+ <container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
+ <rootfiles>
+ <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
+ </rootfiles>
+ </container>
+ return
+ <entry name="META-INF/container.xml" type="xml">{$container}</entry>
+};
+
+declare function epub:docbook-toc-divs($text as element(tei:text)) {
+ let $front := $text/tei:front/tei:div[not(@xml:id = ('toc'))]
+ let $body := $text/tei:body//tei:div[@xml:id and tei:div/@xml:id]
+ let $back := $text/tei:back/tei:div[@xml:id]
+ return
+ ($front, $body, $back)
+};
+
+declare function epub:docbook-divs($text as element(tei:text)) {
+ $text//tei:div[@xml:id and not(@xml:id = ('toc'))]
+};
+
+(:~
+ Helper function, returns the OEBPS/content.opf entry.
+
+ @param $title the dc:title of the EPUB
+ @param $creator the dc:creator of the EPUB
+ @param $text the tei:text element for the file, which contains the divs to be processed into the EPUB
+ @return the OEBPS/content.opf entry
+:)
+declare function epub:content-opf-entry($title, $creator, $urn, $text) {
+ let $content-opf :=
+ <package xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0" unique-identifier="bookid">
+ <metadata>
+ <dc:title>{$title}</dc:title>
+ <dc:creator>{$creator}</dc:creator>
+ <dc:identifier id="bookid">{$urn}</dc:identifier>
+ <dc:language>en-US</dc:language>
+ <meta name="cover" content="cover-image" />
+ </metadata>
+ <manifest>
+ <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
+ <item id="cover" href="cover.html" media-type="application/xhtml+xml"/>
+ <item id="title" href="title.html" media-type="application/xhtml+xml"/>
+ <item id="table-of-contents" href="table-of-contents.html" media-type="application/xhtml+xml"/>
+ {
+ (: get all divs :)
+ for $div in epub:docbook-divs($text)
+ return
+ <item id="{$div/@xml:id}" href="{$div/@xml:id}.html" media-type="application/xhtml+xml"/>
+ }
+ <item id="cover-image" href="images/cover.jpg" media-type="image/jpg"/>
+ <item id="css" href="stylesheet.css" media-type="text/css"/>
+ {
+ for $image in $text//tei:graphic[@url]
+ return
+ <item id="{$image/@url}" href="images/{$image/@url}.png" media-type="image/png"/>
+ }
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="cover" linear="no"/>
+ <itemref idref="title"/>
+ <itemref idref="table-of-contents"/>
+ {
+ (: get just divs for TOC :)
+ for $div in epub:docbook-divs($text)
+ return
+ <itemref idref="{$div/@xml:id}"/>
+ }
+ </spine>
+ <guide>
+ <reference href="cover.html" type="cover" title="Cover"/>
+ <!-- TODO title.html omitted here - not sure if there's an applicable @type? -->
+ <reference href="table-of-contents.html" type="toc" title="Table of Contents"/>
+ <reference href="preface.html" type="preface" title="Preface"/>
+ {
+ (: first text div :)
+ let $first-text-div := $text/tei:body//tei:div[tei:div/@xml:id and not(tei:div/tei:div/@xml:id)][1]
+ let $id := $first-text-div/@xml:id
+ let $title := $first-text-div/tei:head
+ return
+ <reference href="{$id}.html" type="text" title="{$title}"/>
+ }
+ {
+ (: index div :)
+ if ($text/id('index')) then
+ <reference href="index.html" type="index" title="Index"/>
+ else
+ ()
+ }
+ </guide>
+ </package>
+ return
+ <entry name="OEBPS/content.opf" type="xml">{$content-opf}</entry>
+};
+
+(:~
+ Helper function, contains the basic XHTML shell used by all XHTML files in the EPUB package.
+
+ @param $title the page's title
+ @param $body the body content
+ @return the serialized XHTML element
+:)
+declare function epub:assemble-xhtml($title, $body) {
+ util:declare-option('exist:serialize', 'method=xhtml media-type=text/html indent=no')
+ ,
+ <html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <head>
+ <title>{$title}</title>
+ <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
+ </head>
+ <body>
+ {$body}
+ </body>
+ </html>
+};
+
+(:~
+ Helper function, creates the OEBPS/cover.html file.
+
+ @param $title the page's title
+ @return the entry for the OEBPS/cover.html file
+:)
+declare function epub:cover-xhtml-entry($title) {
+ let $body :=
+ (
+ <h1 xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">{$title}</h1>
+ ,
+ <div xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <img src="images/cover.jpg" alt="Cover image for {$title}"/>
+ </div>
+ )
+ let $cover-xhtml := epub:assemble-xhtml($title, $body)
+ return
+ <entry name="OEBPS/cover.html" type="xml">{$cover-xhtml}</entry>
+};
+
+(:~
+ Helper function, creates the OEBPS/cover.html file.
+
+ @param $volume the volume's ID
+ @return the entry for the OEBPS/cover.html file
+:)
+declare function epub:title-xhtml-entry($volume-id) {
+ let $volumes := collection('/db/cms/apps/volumes/data')
+ let $volume := $volumes//volume[@id eq $volume-id]
+ let $editors := $volume/editor
+ let $published-year := $volume/published-year/text()
+ let $body :=
+ <div xmlns="http://www.w3.org/1999/xhtml" id="title">
+ <h3>{concat(docbook:volume-title($volume-id, 'series'), ', ', docbook:volume-title($volume-id, 'subseries'))}</h3>
+ <hr/>
+ <h3>{docbook:volume-title($volume-id, 'volumenumber')}</h3>
+ <h1>{docbook:volume-title($volume-id, 'volume')}</h1>
+ {
+ if ($editors) then
+ <dl>
+ {
+ if (count($editors[@role="primary"]) gt 1) then
+ <dt>Editors:</dt>
+ else
+ <dt>Editor:</dt>
+ }
+ {
+ for $ed in $editors[@role="primary"] return <dd>{data($ed)}</dd>
+ }
+ <dt>General Editor:</dt>
+ <dd>{$editors[@role="general"]/text()}</dd>
+ </dl>
+ else ()
+ }
+ <hr/>
+ <p>
+ United States Government Printing Office <br/>
+ Washington <br/>
+ {$published-year}
+ </p>
+ <p>
+ U.S. Department of State<br/>
+ Office of the Historian<br/>
+ Bureau of Public Affairs
+ </p>
+ </div>
+ let $title := 'Title page'
+ let $title-xhtml := epub:assemble-xhtml($title, $body)
+ return
+ <entry name="OEBPS/title.html" type="xml">{$title-xhtml}</entry>
+};
+
+(:~
+ Helper function, creates the OEBPS/table-of-contents.html file.
+
+ @param $title the page's title
+ @param $text the tei:text element for the file, which contains the divs to be processed into the EPUB
+ @return the entry for the OEBPS/table-of-contents.html file
+:)
+declare function epub:table-of-contents-xhtml-entry($title, $text, $suppress-documents) {
+ let $body :=
+ <div xmlns="http://www.w3.org/1999/xhtml" id="table-of-contents">
+ <h2>Contents</h2>
+ <ul>{
+ (: Just get top level divs :)
+ epub:docbook-toc-to-li($text, $suppress-documents)
+ }</ul>
+ </div>
+ let $table-of-contents-xhtml := epub:assemble-xhtml($title, $body)
+ return
+ <entry name="OEBPS/table-of-contents.html" type="xml">{$table-of-contents-xhtml}</entry>
+};
+
+(:~
+ Helper function, creates the XHTML files for the body of the EPUB.
+
+ @param $text the tei:text element for the file, which contains the divs to be processed into the EPUB
+ @return the serialized XHTML page, wrapped in an entry element
+:)
+declare function epub:body-xhtml-entries($text) {
+ for $div in epub:docbook-divs($text)
+ let $title := $div/tei:head/text()
+ let $body := epub:process-div($div, $title)
+ let $body-xhtml:= epub:assemble-xhtml($title, $body)
+ return
+ <entry name="{concat('OEBPS/', $div/@xml:id, '.html')}" type="xml">{$body-xhtml}</entry>
+};
+
+declare function epub:process-div($div as element(tei:div), $title) {
+ if ($div/tei:div/tei:div/@xml:id) then
+ (: show compilation TOC:)
+ <div xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <h1>{$title}</h1>
+ <ol>{
+ for $chapter in $div/tei:div
+ return
+ <li><a href="{concat($chapter/@xml:id, '.html')}">{$chapter/tei:head/text()}</a>{
+ if ($chapter[tei:div/@type eq 'document']) then
+ concat(' (Documents ', $chapter/tei:div[1]/@n, '-', $chapter/tei:div[last()]/@n, ')')
+ else
+ ()
+ }</li>
+ }</ol>
+ </div>
+ else if ($div/tei:div/@xml:id) then
+ (: show document list :)
+ <div xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <h1>{$title}: Document List</h1>
+ {
+ for $document in $div/tei:div
+ let $docnumber := docbook:document-number($document)
+ let $docid := docbook:document-id($document)
+ let $doctitle := normalize-space(docbook:document-head-sans-number($document))
+ let $docsource := normalize-space(docbook:source-note($document))
+ let $docdateline := normalize-space(docbook:dateline($document))
+ let $docsummary := normalize-space(docbook:document-summary($document))
+ return
+ (
+ <hr class="list"/>,
+ <h4><a href="{concat($docid, '.html')}">Document {$docnumber}: {$doctitle}</a></h4>,
+ <p>{$docdateline}</p>,
+ <p>{$docsummary}</p>,
+ <p class="sourcenote">{$docsource}</p>
+ )
+ }
+ </div>
+ else
+ (: just render it - i.e. document, section :)
+ let $parameters :=
+ <parameters xmlns="">
+ <param name="abs-site-uri" value="historicaldocuments/"/>
+ <param name="relativeimagepath" value="images/"/>
+ </parameters>
+ return
+ render:render($div, $parameters)
+};
+
+(:~
+ Helper function, creates the CSS entry for the EPUB.
+
+ @param $db-path-to-css the db path to the required static resources (cover.jpg, stylesheet.css)
+ @return the CSS entry
+:)
+declare function epub:stylesheet-entry($db-path-to-css) {
+ <entry name="OEBPS/stylesheet.css" type="binary">{util:binary-doc(concat($db-path-to-css, '/css/epub.css'))}</entry>
+};
+
+
+(:~
+ Helper function, creates the OEBPS/toc.ncx file.
+
+ @param $urn the EPUB's urn
+ @param $text the tei:text element for the file, which contains the divs to be processed into the EPUB
+ @return the NCX element's entry
+:)
+declare function epub:toc-ncx-entry($urn, $title, $text) {
+ let $toc-ncx :=
+ <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
+ <head>
+ <meta name="dtb:uid" content="{$urn}"/>
+ <meta name="dtb:depth" content="2"/>
+ <meta name="dtb:totalPageCount" content="0"/>
+ <meta name="dtb:maxPageNumber" content="0"/>
+ </head>
+ <docTitle>
+ <text>{$title}</text>
+ </docTitle>
+ <navMap>
+ <navPoint id="navpoint-title" playOrder="1">
+ <navLabel>
+ <text>Cover</text>
+ </navLabel>
+ <content src="cover.html"/>
+ </navPoint>
+ <navPoint id="navpoint-title" playOrder="2">
+ <navLabel>
+ <text>Title</text>
+ </navLabel>
+ <content src="title.html"/>
+ </navPoint>
+ <navPoint id="navpoint-table-of-contents" playOrder="3">
+ <navLabel>
+ <text>Table of Contents</text>
+ </navLabel>
+ <content src="table-of-contents.html"/>
+ </navPoint>
+ {
+ epub:docbook-toc-to-ncx($text, 4)
+ }
+ </navMap>
+ </ncx>
+ return
+ <entry name="OEBPS/toc.ncx" type="xml">{$toc-ncx}</entry>
+};
+
+declare function epub:docbook-toc-to-ncx($node, $navpoint-start as xs:integer) {
+ typeswitch($node)
+ case element(tei:div) return epub:docbook-div-to-ncx($node, $navpoint-start)
+ default return epub:recurse-ncx($node, $navpoint-start)
+};
+
+declare function epub:recurse-ncx($node, $navpoint-start) {
+ for $child in $node/node()
+ return epub:docbook-toc-to-ncx($child, $navpoint-start)
+};
+
+declare function epub:docbook-div-to-ncx($div as element(tei:div), $navpoint-start as xs:integer) {
+ let $id := $div/@xml:id
+ let $index := count($div/preceding::tei:div[@xml:id and not(@xml:id eq 'toc')]) + count($div/ancestor::tei:div[@xml:id and not(@xml:id eq 'toc')])
+ return
+ (: just pass through non-@xml:id divs :)
+ if (not($id)) then
+ epub:recurse-ncx($div, $navpoint-start)
+ (: supress original print TOC, since we generate an ePub-specific one :)
+ else if ($id eq 'toc') then
+ ()
+ (: show all divs with @xml:id :)
+ else
+ <navPoint id="navpoint-{$id}" playOrder="{$navpoint-start + $index}" xmlns="" rel="nofollow">http://www.daisy.org/z3986/2005/ncx/">
+ <navLabel>
+ <text>{normalize-space(docbook:head-sans-note($div))}</text>
+ </navLabel>
+ <content src="{$id}.html"/>
+ { epub:recurse-ncx($div, $navpoint-start) }
+ </navPoint>
+};
+
+declare function epub:docbook-toc-to-li($node, $suppress-documents as xs:boolean) {
+ typeswitch($node)
+ case element(tei:div) return epub:docbook-div-to-li($node, $suppress-documents)
+ default return epub:recurse-li($node, $suppress-documents)
+};
+
+declare function epub:recurse-li($node, $suppress-documents) {
+ for $child in $node/node()
+ return epub:docbook-toc-to-li($child, $suppress-documents)
+};
+
+declare function epub:docbook-div-to-li($div as element(tei:div), $suppress-documents as xs:boolean) {
+ let $id := $div/@xml:id
+ return
+ (: just pass through non-@xml:id divs :)
+ if (not($id)) then
+ epub:recurse-li($div, $suppress-documents)
+ (: supress original print TOC, since we generate an ePub-specific one :)
+ else if ($id eq 'toc') then
+ ()
+ else if ($div/@type eq 'document') then
+ if ($suppress-documents) then ()
+ else
+ <li xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <a href="{concat($div/@xml:id, '.html')}">{
+ normalize-space(docbook:head-sans-note($div))
+ }</a>
+ </li>
+ (: show all divs with @xml:id :)
+ else
+ <li xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <a href="{concat($div/@xml:id, '.html')}">{
+ normalize-space(docbook:head-sans-note($div))
+ }</a>
+ {
+ if ($div[tei:div/@type eq 'document']) then
+ if ($suppress-documents) then
+ concat(' (Documents ', $div/tei:div[1]/@n, '-', $div/tei:div[last()]/@n, ')')
+ else ()
+ else
+ ()
+ ,
+ if ($div//tei:div[@xml:id and not(@type eq 'document')] or not($suppress-documents)) then
+ <ul>{ epub:recurse-li($div, $suppress-documents) }</ul>
+ else ()
+ }
+ </li>
+};
+
+(:~
+ Helper function, creates the cover image entry for the EPUB.
+
+ @param $db-path-to-resources the db path to the required static resources (cover.png, stylesheet.css)
+ @return the cover entry
+:)
+declare function epub:cover-entry($cover) {
+ <entry name="OEBPS/images/cover.jpg" type="binary">{$cover}</entry>
+};
+
+declare function epub:graphic-entries($text, $filename) {
+ for $image in $text/(tei:body | tei:back)//tei:graphic[@url]
+ let $image-binary :=
+ let $uri := concat('http://demo.danmccreary.com/rest/db/nosql/resources/images/', $filename, '/', $image/@url, '.png')
+ let $response := httpclient:head(xs:anyURI($uri), false(), ())
+ return
+ if ($response/@statusCode eq '200') then
+ let $store := xmldb:store('/db/cms/apps/tei-content/images/', concat($image/@url, '.png'), xs:anyURI($uri), 'image/png')
+ return
+ util:binary-doc(concat('/db/cms/apps/tei-content/images/', $image/@url, '.png'))
+ else ()
+ return
+ if (exists($image-binary)) then
+ <entry name="{concat('OEBPS/images/', $image/@url, '.png')}" type="binary">{$image-binary}</entry>
+ else ()
+};
+
+declare variable $epub:cache-ncx-collection {
+ '/db/cms/apps/epub/ncx-cache'
+};
+
+declare function epub:cache-ncx($vol-id) {
+ let $ncx := epub:toc-ncx-entry($vol-id, $vol-id, docbook:volume($vol-id))
+ let $store := xmldb:store($epub:cache-ncx-collection, concat($vol-id, '.ncx'), $ncx)
+ return ()
+};
+
+declare function epub:get-ncx($vol-id) {
+ let $vol := docbook:volume($vol-id)
+ let $exists-cache := doc-available(concat($epub:cache-ncx-collection, '/', $vol-id, '.ncx'))
+ return
+ if ($exists-cache and
+ xmldb:last-modified(util:collection-name($vol), util:document-name($vol))
+ le
+ xmldb:last-modified($epub:cache-ncx-collection, concat($vol-id, '.ncx') )
+ ) then
+ doc(concat($epub:cache-ncx-collection, '/', $vol-id, '.ncx'))
+ else (
+ epub:cache-ncx($vol-id),
+ doc(concat($epub:cache-ncx-collection, '/', $vol-id, '.ncx'))
+ )
+};
+
+declare function epub:get-current-navPoint-playOrder($ncx, $id) {
+ xs:integer($ncx//ncx:navPoint[ncx:content/@src eq $id]/@playOrder)
+};
+
+declare function epub:get-previous-navPoint($ncx, $current-playOrder-value as xs:integer) {
+ $ncx//ncx:navPoint[xs:integer(@playOrder) eq $current-playOrder-value - 1]
+};
+
+declare function epub:get-next-navPoint($ncx, $current-playOrder-value as xs:integer) {
+ $ncx//ncx:navPoint[xs:integer(@playOrder) eq $current-playOrder-value + 1]
+};
\ No newline at end of file
Added: apps/docs/modules/docbook-to-fo.xqm
===================================================================
--- apps/docs/modules/docbook-to-fo.xqm (rev 0)
+++ apps/docs/modules/docbook-to-fo.xqm 2011-12-31 02:44:38 UTC (rev 15625)
@@ -0,0 +1,382 @@
+module namespace db2h="http://danmccreary.com/docbook2xhtml";
+import module namespace book = "http://danmccreary.com/book" at "../modules/book-module.xqm";
+
+(: Docbook to XHTML module - Kelly-McCreary & Associates. All rights reserved. :)
+
+declare default element namespace "http://docbook.org/ns/docbook";
+declare namespace db="http://docbook.org/ns/docbook";
+declare namespace html="http://www.w3.org/1999/xhtml";
+declare namespace xmldb="http://exist-db.org/xquery/xmldb";
+declare namespace xf="http://www.w3.org/2002/xforms";
+
+(: A resource collection (css, images, scripts i.e. JavaScript) designed to store resources shared by two or more documents
+ Note that chapter-specific images are stored within the images collection of each chapter. :)
+declare variable $db2h:site-resources := '/db/nosql/resources/';
+
+declare variable $db2h:site-images := concat($db2h:site-resources, 'images/');
+declare variable $db2h:site-css := concat($db2h:site-resources, 'css/');
+declare variable $db2h:site-scripts := concat($db2h:site-resources, 'scripts/');
+
+(: document-specific resources are stored relative to the rendering output location :)
+declare variable $db2h:loc-images := 'images/';
+declare variable $db2h:loc-scripts := 'scripts/';
+declare variable $db2h:loc-css := 'css/';
+
+declare variable $db2h:syntax-highlight := 'yes';
+declare variable $db2h:include-table-of-contents := 'yes';
+
+declare function db2h:main($content as node()*) as item()* {
+ for $node in $content
+ return
+ typeswitch($node)
+ case text() return $node
+
+ (:
+ case element(article) return db2h:article($node)
+ case element(book) return db2h:book($node) :)
+
+
+ case element(chapter) return db2h:chapter($node)
+
+ case element(sect1) return db2h:sect1($node)
+
+ (: front matter :)
+ case element(info) return db2h:info($node)
+ case element(author) return db2h:author($node)
+ case element(revhistory) return db2h:revhistory($node)
+
+ case element(para) return db2h:para($node)
+
+ case element(orderedlist) return db2h:orderedlist($node)
+
+ (: we take this out because the title will be different based on the part, chapter or sect1:)
+ case element(title) return db2h:title($node)
+
+ case element(figure) return db2h:figure($node)
+
+
+ case element(emphasis) return db2h:emphasis($node)
+ case element(glossterm) return db2h:glossterm($node)
+
+ case element(itemizedlist) return db2h:itemizedlist($node)
+ case element(listitem) return db2h:listitem($node)
+
+
+ case element(programlisting) return db2h:programlisting($node)
+ case element(imagedata) return db2h:imagedata($node)
+
+ default return db2h:null()
+};
+
+declare function db2h:recurse($node as node()) as item()* {
+ db2h:main($node/node())
+};
+
+declare function db2h:null() as xs:string {
+''
+};
+
+
+
+declare function db2h:chapter($chapter as element(chapter)) as element() {
+let $chapter-id := $chapter/@xml:id/string()
+let $id-num := substring-after($chapter-id, 'ch')
+let $no-leading-zeros := substring-after($id-num, '0')
+let $chapter-title := $chapter/db:title/text()
+let $display-title := concat('Chapter ', $no-leading-zeros, ': ', $chapter-title)
+return
+<div class="chapter">
+ <div class="chapter-title">{$display-title}</div>
+ <div class="chapter-subtitle">{$chapter/db:subtitle/text()}</div>
+ {for $p in $chapter/db:para
+ return
+ db2h:main($p)
+ }
+ {db2h:main($chapter/db:sect1)}
+</div>
+};
+
+declare function db2h:sect1($sect1 as element(sect1)) as element() {
+ let $section-number := count($sect1/preceding-sibling::sect1) + 1
+ return
+ <div class="sect1">
+ <a name="s-{$section-number}"/>
+ <div class="sect1-title">{$section-number} {' '} {$sect1/db:title/text()}</div>
+ <div class="sect1-subtitle">{$sect1/db:subtitle/text()}</div>
+ {db2h:main($sect1/*)}
+ </div>
+};
+
+declare function db2h:toc($node as element(article)) as element() {
+ <div class="toc">
+ <div class="toc-label">Table of Contents</div>
+ {for $section at $sec-count in $node/section
+ return
+ <div class="toc-line">
+ {$sec-count} {' '} <a href="#s-{$sec-count}">{$section/title/text()}</a>
+ {for $sub-section at $subsec-count in $section/section
+ return
+ <div class="toc-line">
+ {$sec-count}.{$subsec-count} {' '} <a href="#s-{$sec-count}-{$subsec-count}" >{$sub-section/title/text()} </a>
+ </div>
+ }
+ </div>
+ }
+ </div>
+};
+
+(: we are explicitly putting in titles for each para, chapter and section
+<div class="sect1-title">{$node/text()}</div>
+:)
+declare function db2h:title($node as element(title)) as xs:string {
+''
+};
+
+(: we are explicitly putting in subtitles for each para, chapter and section
+<div class="sect1-title">{$node/text()}</div>
+:)
+declare function db2h:subtitle($node as element(title)) as xs:string {
+''
+};
+
+declare function db2h:info($node as element(info)) {
+ ''
+};
+
+declare function db2h:para($node as element(para)) as element() {
+ <p class="para">
+ {db2h:main($node/node())}
+ </p>
+};
+
+declare function db2h:itemizedlist($itemizedlist as element(itemizedlist)) as element() {
+ <ul>
+ {db2h:main($itemizedlist/node())}
+ </ul>
+};
+
+declare function db2h:orderedlist($itemizedlist as element(orderedlist)) as element() {
+ <ol>
+ {db2h:main($itemizedlist/node())}
+ </ol>
+};
+
+declare function db2h:listitem($listitem as element(listitem)) as element() {
+ <li>
+ {db2h:main($listitem/node())}
+ </li>
+};
+
+declare function db2h:emphasis($node as element(emphasis)) as element() {
+if ($node/@role = 'bold')
+ then <b>{db2h:recurse($node)}</b>
+ else <i>{db2h:recurse($node)}</i>
+};
+
+declare function db2h:glossterm($node as element(glossterm)) as element() {
+<a href="view-glossary-term.xq?term={$node/text()}">{$node/text()}</a>
+};
+
+declare function db2h:programlisting($node as element(programlisting)) as element() {
+ <pre class="programlisting">
+ {$node/text()}
+ {db2h:recurse($node)}
+ </pre>
+};
+
+declare function db2h:imagedata($node as element(imagedata)) as element() {
+ <img src="{$db2h:loc-images}{$node/@fileref}" width="{$node/contentwidth}" alt-text="{$node/@alt-text}" title="{$node/@annotations}"/>
+};
+
+declare function db2h:analytics() as element() {
+ <div class="google-analytics">
+ </div>
+};
+
+declare function db2h:front-matter($node) as element() {
+ <div class="front-matter">
+ <div class="article-title">{$node/info/title/text()}</div>
+ <div class="article-subtitle">{$node/info/subtitle/text()}</div>
+ <div class="version">
+ Version: {$node/info/revhistory/revision[last()]/revnumber/text()}
+ Date: {$node/info/revhistory/revision[last()]/date/text()}
+ </div>
+ {db2h:authors($node)}
+ {db2h:revhistory($node/info/revhistory)}
+ {db2h:toc($node)}
+ </div>
+};
+
+declare function db2h:authors($node) as element() {
+ <div class="authors">
+ <div class="authors-label">Authors</div>
+ {for $author in $node/info/author
+ return db2h:author($author)
+ }
+ </div>
+};
+
+declare function db2h:author($person) as element() {
+ <div class="author">
+ <span class="personanme">
+ {$person/personname/honorific/text()} {' '}
+ {$person/personname/firstname/text()} {' '}
+ {$person/personname/surname/text()}</span> {', '}
+ { if ($person/affiliation/orgname)
+ then <span class="orgname"> {$person/affiliation/orgname/text()}, </span>
+ else ()
+ }
+ <span class="email">{$person/email/text()} {' '}</span>
+ </div>
+};
+
+declare function db2h:revhistory($revhistory) as element() {
+ <div class="revhistory">
+ <div class="rev-history-label">Revision History</div>
+ <table class="rev-history-table">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Date</th>
+ <th>Who</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ {for $rev in $revhistory/revision
+ return
+ <tr>
+ <td>{$rev/revnumber/text()}</td>
+ <td>{$rev/date/text()}</td>
+ <td>
+ {$rev/authorinitials/text()}
+ {$rev//firstname/text()}
+ { if ($rev//surname) then ' ' else '' }
+ {$rev//surname/text()}
+ </td>
+ <td>{$rev/revdescription/para/text()}</td>
+ </tr>
+ }
+ </tbody>
+ </table>
+ </div>
+};
+
+declare function db2h:images-path($node as node()) as xs:string {
+let $chapter-id := $node/ancestor::db:chapter/@xml:id/string()
+let $part := substring-before(substring-after(util:collection-name($node), 'docbook/part-'), '/')
+return concat('/rest/db/nosql/docbook/part-', $part, '/', $chapter-id, '/images')
+};
+
+declare function db2h:figure($figure) as element() {
+let $title := $figure/db:title/text()
+let $scale := number($figure//@scale/string()) * 0.01
+let $height := 400 * $scale
+let $width := 500 * $scale
+let $image-collection := $figure/ancestor::db:chapter/@xml:id/string()
+return
+<div class="figure">
+ <img src="{ db2h:images-path($figure)}/{$figure//@fileref/string()}" title="{$title}" height="{$height}"/>
+ <div class="caption">Figure: {$title}</div>
+</div>
+};
+
+declare function db2h:back-matter($node) as element() {
+ <div class="back-matter">
+ {db2h:recurse($node)}
+ </div>
+};
+
+(:
+declare function db2h:sections($node as element(section)) as element() {
+let $section-number := count($node/../preceding::section)
+let $sub-section-number := count($node/preceding::section)
+return
+<div class="sections">
+ {for $section at $sec-count in $node/section
+ return
+ <div class="section1">
+ {$sec-count} {' '} <a name="s-{$sec-count}">{$section/title/text()}</a>
+ {for $sub-section at $subsec-count in $section/db:section
+ return
+ <div class="section2">
+ {$sec-count}.{$subsec-count} {' '} <a name="ss-{$sec-count}-{$subsec-count}" >{$sub-section/title/text()} </a>
+ </div>
+ }
+ </div>
+ }
+</div>
+};
+
+declare function db2h:section($node as element(section)) as element() {
+if ( name($node/..) = 'article')
+ then
+
+ let $section-number := count($node/preceding-sibling::section) + 1
+ return
+ <div class="section1">
+ <a name="s-{$section-number}"/>
+ <h1 class="section1">{$node/db:title/text()}</h1>
+ {db2h:recurse($node)}
+ </div>
+
+ else
+ let $section-number := count($node/../preceding-sibling::section) + 1
+ let $sub-section-number := count($node/preceding-sibling::section) + 1
+ return
+ <div class="section2">
+ <a name="s-{$section-number}-{$sub-section-number}"/>
+ <h2 class="section2">{$node/title/text()}</h2>
+ {db2h:recurse($node)}
+ </div>
+
+};
+
+declare function db2h:article($node as element(article)) as element() {
+let $title := $node/info/title/text()
+return
+ <html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <head>
+ <title>{$title}</title>
+ <link rel="shortcut icon" href="{$db2h:site-images}exist_icon_16x16.ico"/>
+ <link rel="icon" href="{$db2h:site-images}exist_icon_16x16.png"
+ type="image/png"/>
+ <meta http-equiv="Content-Type" content="charset=utf-8"/>
+ <script language="Javascript" type="text/javascript" src="{$db2h:site-scripts}curvycorners.js"/>
+ <link rel="stylesheet" type="text/css" href="{$db2h:site-css}docbook.css"/>
+
+ <link rel="stylesheet" type="text/css" href="{$db2h:site-css}/style.css"/>
+
+
+ {if ($db2h:syntax-highlight = 'yes')
+ then (
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shCore.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushCss.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushJScript.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushPlain.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushXml.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushXQuery.js"/>,
+
+ <link type="text/css" rel="stylesheet" href="{$db2h:site-css}styles/syntax/shCore.css"/>,
+ <link type="text/css" rel="Stylesheet" href="{$db2h:site-css}styles/syntax/shThemeDefault.css" id="theme"/>,
+
+ <script type="text/javascript">
+ SyntaxHighlighter.config.stripBrs = true;
+ SyntaxHighlighter.defaults[ 'auto-links'] = false;
+ SyntaxHighlighter.defaults[ 'wrap-lines'] = false;
+ SyntaxHighlighter.all();
+ </script>
+ ) else ()}
+
+ </head>
+ <body>
+ <div class="content">
+ {db2h:front-matter($node)}
+ {db2h:recurse($node)}
+ {db2h:analytics()}
+ </div>
+ </body>
+ </html>
+};
+
+:)
Modified: apps/docs/modules/docbook5-to-xhtml.xqm
===================================================================
--- apps/docs/modules/docbook5-to-xhtml.xqm 2011-12-31 00:20:02 UTC (rev 15624)
+++ apps/docs/modules/docbook5-to-xhtml.xqm 2011-12-31 02:44:38 UTC (rev 15625)
@@ -1,5 +1,7 @@
module namespace db2h="http://danmccreary.com/docbook2xhtml";
-import module namespace book = "http://danmccreary.com/book" at "../modules/book-module.xqm";
+(: to us this module add the following line to your XQuery
+import module namespace db2h="http://danmccreary.com/docbook2xhtml" at '../modules/docbook5-to-xhtml.xqm';
+:)
(: Docbook 5 to XHTML module using typeswitch function :)
@@ -30,25 +32,19 @@
return
typeswitch($node)
case text() return $node
-
- (:
- case element(article) return db2h:article($node)
- case element(book) return db2h:book($node) :)
-
- case element(chapter) return db2h:chapter($node)
case element(section) return db2h:section($node)
(: front matter :)
case element(info) return db2h:info($node)
case element(author) return db2h:author($node)
case element(revhistory) return db2h:revhistory($node)
-
- case element(para) return db2h:para($node)
+ (: body elements :)
+ case element(para) return db2h:para($node)
case element(orderedlist) return db2h:orderedlist($node)
- (: we take this out because the title will be different based on the part, chapter or sect1:)
+
case element(title) return db2h:title($node)
case element(figure) return db2h:figure($node)
@@ -77,28 +73,9 @@
};
-
-declare function db2h:chapter($chapter as element(chapter)) as element() {
-let $chapter-id := $chapter/@xml:id/string()
-let $id-num := substring-after($chapter-id, 'ch')
-let $no-leading-zeros := substring-after($id-num, '0')
-let $chapter-title := $chapter/db:title/text()
-let $display-title := concat('Chapter ', $no-leading-zeros, ': ', $chapter-title)
-return
-<div class="chapter">
- <div class="chapter-title">{$display-title}</div>
- <div class="chapter-subtitle">{$chapter/db:subtitle/text()}</div>
- {for $p in $chapter/db:para
- return
- db2h:main($p)
- }
- {db2h:main($chapter/db:sect1)}
-</div>
-};
-
-declare function db2h:section($section as element(sect1)) as element() {
+declare function db2h:section($section as element(section)) as element() {
<div class="section">
- db2h:recurse($section)
+ {db2h:recurse($section)}
</div>
};
Added: apps/docs/modules/exist-admin-style.xqm
===================================================================
--- apps/docs/modules/exist-admin-style.xqm (rev 0)
+++ apps/docs/modules/exist-admin-style.xqm 2011-12-31 02:44:38 UTC (rev 15625)
@@ -0,0 +1,165 @@
+module namespace style = "http://exist-db.org/style";
+declare namespace request="http://exist-db.org/xquery/request";
+declare namespace xrx="http://code.google.com/p/xrx";
+
+
+(: returns host and port we are running on :)
+declare function style:server-port() as xs:string {
+ substring-before(request:get-url(), '/exist/rest/db/')
+};
+
+(: DEPRECIATED - should now use server port :)
+declare function style:host-port() as xs:string {
+ substring-before(request:get-url(), '/exist/rest/db/')
+};
+
+(: Home page for the exist documentation page :)
+declare function style:home-domain() as xs:string {
+ 'http://docs.exist-db.org/docs'
+};
+
+(: Used for image and CSS references :)
+declare function style:site-db-uri() as xs:string {
+ '/db/cust/exist-admin'
+};
+
+(: The web base for the site:)
+declare function style:org-web-uri() as xs:string {
+ '/exist/rest/db/cust/exist-admin'
+};
+
+(: number of levels below the db content home where /db=0 and /db/cust/us-state-hist=1 :)
+declare function style:hier-depth() as xs:integer {
+ let $url := request:get-url()
+ let $remaining-path := substring-after($url, '/exist/rest/db/')
+ let $tokins := tokenize($remaining-path, '/')
+ let $count := xs:integer(count($tokins) - 2)
+ return
+ $count
+};
+
+(: number of levels below the content home where /db=0:)
+declare function style:to-base() as xs:string {
+ let $up-path := if (style:hier-depth() = 1)
+ then ('..')
+ else if (style:hier-depth() = 2)
+ then ('../..')
+ else ('../../..')
+ return
+ xs:string($up-path)
+};
+
+declare function style:import-css() as node() {
+ <link rel="stylesheet" type="text/css" href="{style:org-web-uri()}/resources/css/default-style.css"/>
+};
+
+declare function style:import-xforms-css() as node()* {
+ <link rel="stylesheet" type="text/css" href="{style:org-web-uri()}/resources/css/default-style.css"/>,
+ <link rel="stylesheet" type="text/css" href="{style:org-web-uri()}/resources/css/xforms-xsltforms.css"/>
+};
+
+(: returns the application base collection such as /db/cust/us-state-hist/apps/faq if you are anywhere inside that
+collection :)
+declare function style:app-uri() as xs:string {
+ let $db-start := substring-after(request:get-uri(), '/exist/rest')
+ let $pre-app := substring-before($db-start, '/apps/')
+ let $full-suffix := substring-after($db-start, '/apps/')
+ let $app := substring-before($full-suffix, '/')
+ return concat($pre-app, '/apps/', $app)
+};
+
+(: Depreciated. Use app-uri() returns the application base collection such as /db/cust/us-state-hist/apps/faq if you are anywhere inside that
+collection :)
+declare function style:app-base-uri() as xs:string {
+ let $db-start := substring-after(request:get-uri(), '/exist/rest')
+ let $pre-app := substring-before($db-start, '/apps/')
+ let $full-suffix := substring-after($db-start, '/apps/')
+ let $app := substring-before($full-suffix, '/')
+ return concat($pre-app, '/apps/', $app)
+};
+
+(: returns the application name from the app-info.xml file. :)
+declare function style:app-name() as xs:string {
+ let $app-id := substring-before(substring-after(request:get-uri(), '/apps/'), '/')
+ let $app-info-file := concat(style:app-uri(), '/app-info.xml')
+ let $app-name := xs:string(doc($app-info-file)//xrx:app-name/text())
+ return $app-name
+};
+
+
+(: returns the application base collection such as /db/crossflow/apps/faq if you are anywhere inside that
+collection :)
+declare function style:app-url() as xs:string {
+ concat('/exist/rest/', style:app-base-uri())
+};
+
+
+(: returns the application base collection such as /db/crossflow/apps/faq if you are anywhere inside that
+collection :)
+declare function style:app-base-url() as xs:string {
+ concat('/exist/rest', style:app-base-uri())
+};
+
+(: returns the application base collection such as /db/crossflow/apps/faq if you are anywhere inside that
+collection :)
+declare function style:app-web-uri() as xs:string {
+ concat('/exist/rest', style:app-base-uri())
+};
+
+(: returns the application base collection such as /db/crossflow/apps/faq if you are anywhere inside that
+collection :)
+declare function style:app-data-uri() as xs:string {
+ concat(style:app-base-uri(), '/data')
+};
+
+
+declare function style:import-xsltforms() as node() {
+ <link rel="stylesheet" type="text/css" href="{style:org-web-uri()}/resources/css/xforms-xsltforms.css"/>
+};
+
+declare function style:header() as node() {
+ <div id="header">
+ <a href="{style:org-web-uri()}/index.xq">
+ <img src="http://demo.syntactica.com/exist/logo.jpg"
+ alt="eXist administration applications" height="50"/>
+ </a>
+ <div class="top-hr"/>
+ </div>
+};
+
+declare function style:footer() as node()* {
+<div id="footer">
+ <div class="bottom-hr"/>
+ <div id="footer-text">This site is only for use by approved eXist developers. All other use prohibited.
+ <!-- TODO put SVG Logo here /db/cust/exist-admin/resources/svg/eXist-logo.svg -->
+ </div>
+</div>
+};
+
+(: returns a link the the current application home :)
+declare function style:app-home-link() as element() {
+ <a href="/exist/rest{style:app-base-uri()}/index.xq">{style:app-name()}</a>
+};
+
+declare function style:breadcrumb-collection-to-label($collection as xs:string) as xs:string {
+ string(doc('/db/apps/modules/breadcrumbs.xml')/breadcrumbs/collection[path=$collection]/label/text())
+};
+
+declare function style:breadcrumb() as node() {
+let $depth := style:hier-depth()
+let $uri := request:get-uri()
+let $dbpath := substring-after($uri, '/exist/rest')
+let $collection-path := substring-before($dbpath, '/')
+return
+<ul id="breadcrumb">
+ <li>
+ <a href="{style:org-web-uri()}/index.xq">Admin Home</a>
+ </li>
+ <li> > <a href="{style:org-web-uri()}/apps/index.xq"> Apps</a>
+ </li>
+ <li> > {style:app-home-link()}
+ </li>
+ <li> > <a href="{style:app-web-uri()}/views/list-items.xq">List Items</a>
+ </li>
+</ul>
+};
\ No newline at end of file
Added: apps/docs/views/list-documents.xq
===================================================================
--- apps/docs/views/list-documents.xq (rev 0)
+++ apps/docs/views/list-documents.xq 2011-12-31 02:44:38 UTC (rev 15625)
@@ -0,0 +1,42 @@
+xquery version "1.0";
+import module namespace style='http://exist-db.org/docs' at '../modules/style.xqm';
+declare namespace db="http://docbook.org/ns/docbook";
+
+let $title := 'List Documents'
+
+let $app-collection := $style:db-path-to-app
+let $data-collection := concat($app-collection, '/data')
+
+let $content :=
+<div class="content">
+ <table>
+ <thead>
+ <tr>
+ <th>xml:id</th>
+ <th>Title</th>
+ <th>Description</th>
+ <th>Status</th>
+ <th>HTML</th>
+ <th>PDF</th>
+ <th>ePub</th>
+ </tr>
+ </thead>
+ <tbody>{
+ for $doc in collection($data-collection)/db:section
+ let $id := string($doc/@xml:id)
+ order by $id
+ return
+ <tr>
+ <td>{$id}</td>
+ <td>{$doc/db:title/text()}</td>
+ <td>{$doc/db:subtitle/text()}</td>
+ <td>{$doc/@status/string()}</td>
+ <td><a href="view-doc.xq?type=xhtml&id={$id}">HTML</a></td>
+ <td><a href="view-doc.xq?type=pdf&id={$id}">PDF</a></td>
+ <td><a href="view-doc.xq?type=ePub&id={$id}">ePub</a></td>
+ </tr>
+ }</tbody></table>
+
+</div>
+
+return style:assemble-page($title, $content)
\ No newline at end of file
Added: apps/docs/views/view-doc.xq
===================================================================
--- apps/docs/views/view-doc.xq (rev 0)
+++ apps/docs/views/view-doc.xq 2011-12-31 02:44:38 UTC (rev 15625)
@@ -0,0 +1,32 @@
+xquery version "1.0";
+import module namespace style='http://exist-db.org/docs' at '../modules/style.xqm';
+import module namespace db2h="http://danmccreary.com/docbook2xhtml" at '../modules/docbook5-to-xhtml.xqm';
+declare namespace db="http://docbook.org/ns/docbook";
+
+let $title := 'List Documents'
+
+let $app-collection := $style:db-path-to-app
+let $data-collection := concat($app-collection, '/data')
+
+let $id := request:get-parameter('id', '')
+let $type := request:get-parameter('type', 'xhtml')
+let $document := collection($data-collection)/db:section[@xml:id = $id]
+
+return
+ if ($type='xhtml')
+ then
+ let $content :=
+ <div class="content">
+ {db2h:main($document)}
+
+ </div>
+
+ return style:assemble-page($title, $content)
+ else if ($type='pdf')
+ then <message>Render PDF Code Here</message>
+ else if ($type='epub')
+ then <message>Render ePub Code Here</message>
+ else
+ <error>
+ <message>Error. The render type of {$type} is unknown to this program.</message>
+ </error>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dmc...@us...> - 2011-12-31 00:20:10
|
Revision: 15624
http://exist.svn.sourceforge.net/exist/?rev=15624&view=rev
Author: dmccreary
Date: 2011-12-31 00:20:02 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
Started cleaning up the style module to work without authentication functions. Not relevent for read-only documents for now at least. Wrote a first cut at list-documents that will then have the links to the doc-to-xhtml, doc-to-pdf and doc-to-epub.
Modified Paths:
--------------
apps/docs/build-update-org-database.xml
apps/docs/build.xml
apps/docs/data/authors.xml
apps/docs/data/style.xml
apps/docs/modules/style.xqm
Added Paths:
-----------
apps/docs/modules/docbook5-to-xhtml.xqm
Modified: apps/docs/build-update-org-database.xml
===================================================================
--- apps/docs/build-update-org-database.xml 2011-12-30 23:45:20 UTC (rev 15623)
+++ apps/docs/build-update-org-database.xml 2011-12-31 00:20:02 UTC (rev 15624)
@@ -1,82 +1,64 @@
-<project xmlns:xdb="http://exist-db.org/ant" default="load-mods" name="eXist Documentation">
-<!--
-This file is intended to update only the org folder inside the exist database after a revision change.
-
--->
-
- <property file="local.properties"/>
-
- <property name="user.default.name" value="eXist-doc"/>
- <property name="user.default.password" value="eXist-doc"/>
- <property name="user.default.group" value="eXist-doc"/>
-
- <property name="server.dir" value="../.."/>
- <property name="mods.dir" value="${server.dir}/webapp/biblio/mods/"/>
- <property name="samples.dir" value="${server.dir}/samples"/>
- <property name="scripts.dir" value="../scripts"/>
- <property name="styles.dir" value="../styles"/>
-
- <path id="classpath.core">
- <fileset dir="${server.dir}/lib/core">
- <include name="*.jar"/>
- </fileset>
- <pathelement path="${server.dir}/exist.jar"/>
- <pathelement path="${server.dir}/exist-optional.jar"/>
- </path>
-
- <typedef resource="org/exist/ant/antlib.xml" uri="" rel="nofollow">http://exist-db.org/ant">
- <classpath refid="classpath.core"/>
- </typedef>
-
- <target name="load-mods" xmlns:xdb="" rel="nofollow">http://exist-db.org/ant">
- <echo message="Removing old MODS application from eXist database"/>
- <xdb:remove user="${public.xmldb.username}" password="${public.xmldb.password}"
- uri="${server-uri}" collection="${mods-collection}" failonerror="false"/>
-
- <echo message="Uploading application files"/>
- <xdb:store user="${public.xmldb.username}" password="${public.xmldb.password}"
- uri="${server-uri}/${mods-collection}" createcollection="true"
- createsubcollections="true" failonerror="false">
- <fileset dir="${mods.dir}" id="id">
- <include name="**/*.xq"/>
- <include name="**/*.xql"/>
- <include name="**/*.xml"/>
- <include name="**/*.xsl"/>
- <include name="**/*.xqm"/>
- <include name="**/*.css"/>
- <include name="**/*.js"/>
- <include name="**/*.png"/>
- <include name="**/*.gif"/>
- <include name="**/*.jpg"/>
- <include name="**/*.properties"/>
- <exclude name="**/.svn"/>
- </fileset>
- </xdb:store>
-
- <echo message="Storing jQuery scripts"/>
- <xdb:store user="${public.xmldb.username}" password="${public.xmldb.password}"
- uri="${server-uri}/${mods-collection}/scripts" createcollection="true" createsubcollections="true"
- failonerror="false">
- <fileset dir="${scripts.dir}">
- <include name="jquery/**"/>
- <exclude name="**/.svn"/>
- </fileset>
- </xdb:store>
-
- <echo message="Storing global CSS styles"/>
- <xdb:store user="${public.xmldb.username}" password="${public.xmldb.password}"
- uri="${server-uri}/${mods-collection}/styles" createcollection="true" createsubcollections="true"
- failonerror="false">
- <fileset dir="${styles.dir}">
- <include name="default-style2.css"/>
- </fileset>
- </xdb:store>
- <echo message="Creating temp collection ${server-uri}/${app-collection}/${temp-collection-name}"/>
- <xdb:create user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${app-collection}" collection="${temp-collection-name}" failonerror="false"/>
- <xdb:chown user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${app-collection}/${temp-collection-name}" name="${user.default.name}" group="${user.default.group}" failonerror="true"/>
- <xdb:chmod user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${app-collection}/${temp-collection-name}" mode="rwurwu---" failonerror="true"/>
-
-
- </target>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xdb="http://exist-db.org/ant" default="load-mods" name="eXist Documentation">
+<!--
+This file is intended to update only the org folder inside the exist database after a revision change.
+
+-->
+ <property file="local.properties"/>
+ <property name="user.default.name" value="eXist-doc"/>
+ <property name="user.default.password" value="eXist-doc"/>
+ <property name="user.default.group" value="eXist-doc"/>
+ <property name="server.dir" value="../.."/>
+ <property name="mods.dir" value="${server.dir}/webapp/biblio/mods/"/>
+ <property name="samples.dir" value="${server.dir}/samples"/>
+ <property name="scripts.dir" value="../scripts"/>
+ <property name="styles.dir" value="../styles"/>
+ <path id="classpath.core">
+ <fileset dir="${server.dir}/lib/core">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${server.dir}/exist.jar"/>
+ <pathelement path="${server.dir}/exist-optional.jar"/>
+ </path>
+ <typedef resource="org/exist/ant/antlib.xml" uri="" rel="nofollow">http://exist-db.org/ant">
+ <classpath refid="classpath.core"/>
+ </typedef>
+ <target name="load-mods">
+ <echo message="Removing old MODS application from eXist database"/>
+ <xdb:remove user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}" collection="${mods-collection}" failonerror="false"/>
+ <echo message="Uploading application files"/>
+ <xdb:store user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${mods-collection}" createcollection="true" createsubcollections="true" failonerror="false">
+ <fileset dir="${mods.dir}" id="id">
+ <include name="**/*.xq"/>
+ <include name="**/*.xql"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.xsl"/>
+ <include name="**/*.xqm"/>
+ <include name="**/*.css"/>
+ <include name="**/*.js"/>
+ <include name="**/*.png"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.jpg"/>
+ <include name="**/*.properties"/>
+ <exclude name="**/.svn"/>
+ </fileset>
+ </xdb:store>
+ <echo message="Storing jQuery scripts"/>
+ <xdb:store user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${mods-collection}/scripts" createcollection="true" createsubcollections="true" failonerror="false">
+ <fileset dir="${scripts.dir}">
+ <include name="jquery/**"/>
+ <exclude name="**/.svn"/>
+ </fileset>
+ </xdb:store>
+ <echo message="Storing global CSS styles"/>
+ <xdb:store user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${mods-collection}/styles" createcollection="true" createsubcollections="true" failonerror="false">
+ <fileset dir="${styles.dir}">
+ <include name="default-style2.css"/>
+ </fileset>
+ </xdb:store>
+ <echo message="Creating temp collection ${server-uri}/${app-collection}/${temp-collection-name}"/>
+ <xdb:create user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${app-collection}" collection="${temp-collection-name}" failonerror="false"/>
+ <xdb:chown user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${app-collection}/${temp-collection-name}" name="${user.default.name}" group="${user.default.group}" failonerror="true"/>
+ <xdb:chmod user="${public.xmldb.username}" password="${public.xmldb.password}" uri="${server-uri}/${app-collection}/${temp-collection-name}" mode="rwurwu---" failonerror="true"/>
+ </target>
+</project>
\ No newline at end of file
Modified: apps/docs/build.xml
===================================================================
--- apps/docs/build.xml 2011-12-30 23:45:20 UTC (rev 15623)
+++ apps/docs/build.xml 2011-12-31 00:20:02 UTC (rev 15624)
@@ -1,48 +1,43 @@
-<project xmlns:xdb="http://exist-db.org/ant" default="xar" name="eXist Documentation">
-
- <!-- this is where we set our exist-home, user, password and the place that we will load the docs -->
- <property file="local.properties"/>
-
-
- <!-- this tells us where to find the key jar files relative to the ${exist-home} property -->
- <path id="classpath.core">
- <fileset dir="${exist-home}/lib/core">
- <include name="*.jar"/>
- </fileset>
- <pathelement path="${exist-home}/exist.jar"/>
- <pathelement path="${exist-home}/exist-optional.jar"/>
- </path>
-
- <typedef resource="org/exist/ant/antlib.xml" uri="" rel="nofollow">http://exist-db.org/ant">
- <classpath refid="classpath.core"/>
- </typedef>
-
-
- <!-- upload app -->
- <target name="upload-exist-docs-app">
- <echo message="Loading eXist documentation system to eXist."/>
- <xdb:store
- uri="${uri}"
- createcollection="true"
- createsubcollections="true"
- user="admin" password="">
- <fileset dir="${exist-docs}">
- <include name="**/*.*"/>
- </fileset>
- </xdb:store>
- </target>
-
- <!-- the archive target -->
- <target name="xar">
- <delete file="eXist-docs-1.0.xar" failonerror="false"/>
- <zip destfile="eXist-docs-1.0.xar">
- <fileset dir="." excludes=".svn"/>
- </zip>
- </target>
-
- <target name="show-properties">
- <echo message="exist-home=${exist-home}"/>
- <echo message="exist-docs=${exist-docs}"/>
- <echo message="uri=${uri}"/>
- </target>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xdb="http://exist-db.org/ant" default="xar" name="eXist Documentation">
+
+ <!-- this is where we set our exist-home, user, password and the place that we will load the docs -->
+ <property file="local.properties"/>
+
+
+ <!-- this tells us where to find the key jar files relative to the ${exist-home} property -->
+ <path id="classpath.core">
+ <fileset dir="${exist-home}/lib/core">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${exist-home}/exist.jar"/>
+ <pathelement path="${exist-home}/exist-optional.jar"/>
+ </path>
+ <typedef resource="org/exist/ant/antlib.xml" uri="" rel="nofollow">http://exist-db.org/ant">
+ <classpath refid="classpath.core"/>
+ </typedef>
+
+
+ <!-- upload app -->
+ <target name="upload-exist-docs-app">
+ <echo message="Loading eXist documentation system to eXist."/>
+ <xdb:store uri="${uri}" createcollection="true" createsubcollections="true" user="admin" password="">
+ <fileset dir="${exist-docs}">
+ <include name="**/*.*"/>
+ </fileset>
+ </xdb:store>
+ </target>
+
+ <!-- the archive target -->
+ <target name="xar">
+ <delete file="eXist-docs-1.0.xar" failonerror="false"/>
+ <zip destfile="eXist-docs-1.0.xar">
+ <fileset dir="." excludes=".svn"/>
+ </zip>
+ </target>
+ <target name="show-properties">
+ <echo message="exist-home=${exist-home}"/>
+ <echo message="exist-docs=${exist-docs}"/>
+ <echo message="uri=${uri}"/>
+ </target>
+</project>
\ No newline at end of file
Modified: apps/docs/data/authors.xml
===================================================================
--- apps/docs/data/authors.xml 2011-12-30 23:45:20 UTC (rev 15623)
+++ apps/docs/data/authors.xml 2011-12-31 00:20:02 UTC (rev 15624)
@@ -1,35 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.oxygenxml.com/docbook/xml/5.0/rng/dbsvg.rng" type="xml"?>
-<section xmlns="" rel="nofollow">http://docbook.org/ns/docbook">
+<section xmlns="http://docbook.org/ns/docbook" version="5.0">
<info>
<title>Authors</title>
<authorgroup>
- <editor xml:id="ED.loren.cahlander">
+ <editor xml:id="person-id.loren.cahlander">
<personname>
<honorific>Mr.</honorific>
<firstname>Loren</firstname>
<othername>David</othername>
<surname>Cahlander</surname>
- <lineage/>
</personname>
<email>ix...@us...</email>
- <personblurb>
- <simpara/>
- </personblurb>
</editor>
- <author xml:id="loren.cahlander">
+ <editor xml:id="person-id.dan.mccreary">
<personname>
- <honorific>Mr.</honorific>
- <firstname>Loren</firstname>
- <othername>David</othername>
- <surname>Cahlander</surname>
- <lineage/>
+ <firstname>Dan</firstname>
+ <surname>McCreary</surname>
</personname>
- <email>ix...@us...</email>
- <personblurb>
- <simpara/>
- </personblurb>
- </author>
+ <email>da...@da...</email>
+ </editor>
</authorgroup>
</info>
<simpara/>
Modified: apps/docs/data/style.xml
===================================================================
--- apps/docs/data/style.xml 2011-12-30 23:45:20 UTC (rev 15623)
+++ apps/docs/data/style.xml 2011-12-31 00:20:02 UTC (rev 15624)
@@ -185,4 +185,4 @@
</figure>]]></programlisting>
</section>
</section>
-</section>
+</section>
\ No newline at end of file
Added: apps/docs/modules/docbook5-to-xhtml.xqm
===================================================================
--- apps/docs/modules/docbook5-to-xhtml.xqm (rev 0)
+++ apps/docs/modules/docbook5-to-xhtml.xqm 2011-12-31 00:20:02 UTC (rev 15624)
@@ -0,0 +1,377 @@
+module namespace db2h="http://danmccreary.com/docbook2xhtml";
+import module namespace book = "http://danmccreary.com/book" at "../modules/book-module.xqm";
+
+(: Docbook 5 to XHTML module using typeswitch function :)
+
+declare default element namespace "http://docbook.org/ns/docbook";
+declare namespace db="http://docbook.org/ns/docbook";
+declare namespace html="http://www.w3.org/1999/xhtml";
+declare namespace xmldb="http://exist-db.org/xquery/xmldb";
+declare namespace xf="http://www.w3.org/2002/xforms";
+
+(: A resource collection (css, images, scripts i.e. JavaScript) designed to store resources shared by two or more documents
+ Note that chapter-specific images are stored within the images collection of each chapter. :)
+declare variable $db2h:site-resources := '/db/nosql/resources/';
+
+declare variable $db2h:site-images := concat($db2h:site-resources, 'images/');
+declare variable $db2h:site-css := concat($db2h:site-resources, 'css/');
+declare variable $db2h:site-scripts := concat($db2h:site-resources, 'scripts/');
+
+(: document-specific resources are stored relative to the rendering output location :)
+declare variable $db2h:loc-images := 'images/';
+declare variable $db2h:loc-scripts := 'scripts/';
+declare variable $db2h:loc-css := 'css/';
+
+declare variable $db2h:syntax-highlight := 'yes';
+declare variable $db2h:include-table-of-contents := 'yes';
+
+declare function db2h:main($content as node()*) as item()* {
+ for $node in $content
+ return
+ typeswitch($node)
+ case text() return $node
+
+ (:
+ case element(article) return db2h:article($node)
+ case element(book) return db2h:book($node) :)
+
+
+ case element(chapter) return db2h:chapter($node)
+ case element(section) return db2h:section($node)
+
+ (: front matter :)
+ case element(info) return db2h:info($node)
+ case element(author) return db2h:author($node)
+ case element(revhistory) return db2h:revhistory($node)
+
+ case element(para) return db2h:para($node)
+
+ case element(orderedlist) return db2h:orderedlist($node)
+
+ (: we take this out because the title will be different based on the part, chapter or sect1:)
+ case element(title) return db2h:title($node)
+
+ case element(figure) return db2h:figure($node)
+
+
+ case element(emphasis) return db2h:emphasis($node)
+ case element(glossterm) return db2h:glossterm($node)
+
+ case element(itemizedlist) return db2h:itemizedlist($node)
+ case element(listitem) return db2h:listitem($node)
+
+
+ case element(programlisting) return db2h:programlisting($node)
+ case element(imagedata) return db2h:imagedata($node)
+
+ (: if we don't have it in the list above we just call the null function :)
+ default return db2h:null()
+};
+
+declare function db2h:recurse($node as node()) as item()* {
+ db2h:main($node/node())
+};
+
+declare function db2h:null() as xs:string {
+''
+};
+
+
+
+declare function db2h:chapter($chapter as element(chapter)) as element() {
+let $chapter-id := $chapter/@xml:id/string()
+let $id-num := substring-after($chapter-id, 'ch')
+let $no-leading-zeros := substring-after($id-num, '0')
+let $chapter-title := $chapter/db:title/text()
+let $display-title := concat('Chapter ', $no-leading-zeros, ': ', $chapter-title)
+return
+<div class="chapter">
+ <div class="chapter-title">{$display-title}</div>
+ <div class="chapter-subtitle">{$chapter/db:subtitle/text()}</div>
+ {for $p in $chapter/db:para
+ return
+ db2h:main($p)
+ }
+ {db2h:main($chapter/db:sect1)}
+</div>
+};
+
+declare function db2h:section($section as element(sect1)) as element() {
+ <div class="section">
+ db2h:recurse($section)
+ </div>
+};
+
+declare function db2h:toc($node as element(article)) as element() {
+ <div class="toc">
+ <div class="toc-label">Table of Contents</div>
+ {for $section at $sec-count in $node/section
+ return
+ <div class="toc-line">
+ {$sec-count} {' '} <a href="#s-{$sec-count}">{$section/title/text()}</a>
+ {for $sub-section at $subsec-count in $section/section
+ return
+ <div class="toc-line">
+ {$sec-count}.{$subsec-count} {' '} <a href="#s-{$sec-count}-{$subsec-count}" >{$sub-section/title/text()} </a>
+ </div>
+ }
+ </div>
+ }
+ </div>
+};
+
+(: we are explicitly putting in titles for each para, chapter and section
+<div class="sect1-title">{$node/text()}</div>
+:)
+declare function db2h:title($node as element(title)) as xs:string {
+''
+};
+
+(: we are explicitly putting in subtitles for each para, chapter and section
+<div class="sect1-title">{$node/text()}</div>
+:)
+declare function db2h:subtitle($node as element(title)) as xs:string {
+''
+};
+
+declare function db2h:info($node as element(info)) {
+ ''
+};
+
+declare function db2h:para($node as element(para)) as element() {
+ <p class="para">
+ {db2h:main($node/node())}
+ </p>
+};
+
+declare function db2h:itemizedlist($itemizedlist as element(itemizedlist)) as element() {
+ <ul>
+ {db2h:main($itemizedlist/node())}
+ </ul>
+};
+
+declare function db2h:orderedlist($itemizedlist as element(orderedlist)) as element() {
+ <ol>
+ {db2h:main($itemizedlist/node())}
+ </ol>
+};
+
+declare function db2h:listitem($listitem as element(listitem)) as element() {
+ <li>
+ {db2h:main($listitem/node())}
+ </li>
+};
+
+declare function db2h:emphasis($node as element(emphasis)) as element() {
+if ($node/@role = 'bold')
+ then <b>{db2h:recurse($node)}</b>
+ else <i>{db2h:recurse($node)}</i>
+};
+
+declare function db2h:glossterm($node as element(glossterm)) as element() {
+<a href="view-glossary-term.xq?term={$node/text()}">{$node/text()}</a>
+};
+
+declare function db2h:programlisting($node as element(programlisting)) as element() {
+ <pre class="programlisting">
+ {$node/text()}
+ {db2h:recurse($node)}
+ </pre>
+};
+
+declare function db2h:imagedata($node as element(imagedata)) as element() {
+ <img src="{$db2h:loc-images}{$node/@fileref}" width="{$node/contentwidth}" alt-text="{$node/@alt-text}" title="{$node/@annotations}"/>
+};
+
+declare function db2h:analytics() as element() {
+ <div class="google-analytics">
+ </div>
+};
+
+declare function db2h:front-matter($node) as element() {
+ <div class="front-matter">
+ <div class="article-title">{$node/info/title/text()}</div>
+ <div class="article-subtitle">{$node/info/subtitle/text()}</div>
+ <div class="version">
+ Version: {$node/info/revhistory/revision[last()]/revnumber/text()}
+ Date: {$node/info/revhistory/revision[last()]/date/text()}
+ </div>
+ {db2h:authors($node)}
+ {db2h:revhistory($node/info/revhistory)}
+ {db2h:toc($node)}
+ </div>
+};
+
+declare function db2h:authors($node) as element() {
+ <div class="authors">
+ <div class="authors-label">Authors</div>
+ {for $author in $node/info/author
+ return db2h:author($author)
+ }
+ </div>
+};
+
+declare function db2h:author($person) as element() {
+ <div class="author">
+ <span class="personanme">
+ {$person/personname/honorific/text()} {' '}
+ {$person/personname/firstname/text()} {' '}
+ {$person/personname/surname/text()}</span> {', '}
+ { if ($person/affiliation/orgname)
+ then <span class="orgname"> {$person/affiliation/orgname/text()}, </span>
+ else ()
+ }
+ <span class="email">{$person/email/text()} {' '}</span>
+ </div>
+};
+
+declare function db2h:revhistory($revhistory) as element() {
+ <div class="revhistory">
+ <div class="rev-history-label">Revision History</div>
+ <table class="rev-history-table">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Date</th>
+ <th>Who</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ {for $rev in $revhistory/revision
+ return
+ <tr>
+ <td>{$rev/revnumber/text()}</td>
+ <td>{$rev/date/text()}</td>
+ <td>
+ {$rev/authorinitials/text()}
+ {$rev//firstname/text()}
+ { if ($rev//surname) then ' ' else '' }
+ {$rev//surname/text()}
+ </td>
+ <td>{$rev/revdescription/para/text()}</td>
+ </tr>
+ }
+ </tbody>
+ </table>
+ </div>
+};
+
+declare function db2h:images-path($node as node()) as xs:string {
+let $chapter-id := $node/ancestor::db:chapter/@xml:id/string()
+let $part := substring-before(substring-after(util:collection-name($node), 'docbook/part-'), '/')
+return concat('/rest/db/nosql/docbook/part-', $part, '/', $chapter-id, '/images')
+};
+
+declare function db2h:figure($figure) as element() {
+let $title := $figure/db:title/text()
+let $scale := number($figure//@scale/string()) * 0.01
+let $height := 400 * $scale
+let $width := 500 * $scale
+let $image-collection := $figure/ancestor::db:chapter/@xml:id/string()
+return
+<div class="figure">
+ <img src="{ db2h:images-path($figure)}/{$figure//@fileref/string()}" title="{$title}" height="{$height}"/>
+ <div class="caption">Figure: {$title}</div>
+</div>
+};
+
+declare function db2h:back-matter($node) as element() {
+ <div class="back-matter">
+ {db2h:recurse($node)}
+ </div>
+};
+
+(:
+declare function db2h:sections($node as element(section)) as element() {
+let $section-number := count($node/../preceding::section)
+let $sub-section-number := count($node/preceding::section)
+return
+<div class="sections">
+ {for $section at $sec-count in $node/section
+ return
+ <div class="section1">
+ {$sec-count} {' '} <a name="s-{$sec-count}">{$section/title/text()}</a>
+ {for $sub-section at $subsec-count in $section/db:section
+ return
+ <div class="section2">
+ {$sec-count}.{$subsec-count} {' '} <a name="ss-{$sec-count}-{$subsec-count}" >{$sub-section/title/text()} </a>
+ </div>
+ }
+ </div>
+ }
+</div>
+};
+
+declare function db2h:section($node as element(section)) as element() {
+if ( name($node/..) = 'article')
+ then
+
+ let $section-number := count($node/preceding-sibling::section) + 1
+ return
+ <div class="section1">
+ <a name="s-{$section-number}"/>
+ <h1 class="section1">{$node/db:title/text()}</h1>
+ {db2h:recurse($node)}
+ </div>
+
+ else
+ let $section-number := count($node/../preceding-sibling::section) + 1
+ let $sub-section-number := count($node/preceding-sibling::section) + 1
+ return
+ <div class="section2">
+ <a name="s-{$section-number}-{$sub-section-number}"/>
+ <h2 class="section2">{$node/title/text()}</h2>
+ {db2h:recurse($node)}
+ </div>
+
+};
+
+declare function db2h:article($node as element(article)) as element() {
+let $title := $node/info/title/text()
+return
+ <html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <head>
+ <title>{$title}</title>
+ <link rel="shortcut icon" href="{$db2h:site-images}exist_icon_16x16.ico"/>
+ <link rel="icon" href="{$db2h:site-images}exist_icon_16x16.png"
+ type="image/png"/>
+ <meta http-equiv="Content-Type" content="charset=utf-8"/>
+ <script language="Javascript" type="text/javascript" src="{$db2h:site-scripts}curvycorners.js"/>
+ <link rel="stylesheet" type="text/css" href="{$db2h:site-css}docbook.css"/>
+
+ <link rel="stylesheet" type="text/css" href="{$db2h:site-css}/style.css"/>
+
+
+ {if ($db2h:syntax-highlight = 'yes')
+ then (
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shCore.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushCss.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushJScript.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushPlain.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushXml.js"/>,
+ <script type="text/javascript" src="{$db2h:site-scripts}syntax/shBrushXQuery.js"/>,
+
+ <link type="text/css" rel="stylesheet" href="{$db2h:site-css}styles/syntax/shCore.css"/>,
+ <link type="text/css" rel="Stylesheet" href="{$db2h:site-css}styles/syntax/shThemeDefault.css" id="theme"/>,
+
+ <script type="text/javascript">
+ SyntaxHighlighter.config.stripBrs = true;
+ SyntaxHighlighter.defaults[ 'auto-links'] = false;
+ SyntaxHighlighter.defaults[ 'wrap-lines'] = false;
+ SyntaxHighlighter.all();
+ </script>
+ ) else ()}
+
+ </head>
+ <body>
+ <div class="content">
+ {db2h:front-matter($node)}
+ {db2h:recurse($node)}
+ {db2h:analytics()}
+ </div>
+ </body>
+ </html>
+};
+
+:)
Modified: apps/docs/modules/style.xqm
===================================================================
--- apps/docs/modules/style.xqm 2011-12-30 23:45:20 UTC (rev 15623)
+++ apps/docs/modules/style.xqm 2011-12-31 00:20:02 UTC (rev 15624)
@@ -38,11 +38,8 @@
@see http://en.wikibooks.org/wiki/XRX
:)
-module namespace style = "http://style.syntactica.com/us-state-hist";
+module namespace style = "http://exist-db.org/docs";
-import module namespace auth = "http://authorization.syntactica.com" at "authorization-module.xqm";
-import module namespace users = "http://history.state.gov/ns/xquery/users" at "xmldb:exist:///db/cms/apps/user/modules/users.xqm";
-
(: Default function and element declarations :)
declare default function namespace "http://www.w3.org/2005/xpath-functions";
declare default element namespace "http://www.w3.org/1999/xhtml";
@@ -54,13 +51,20 @@
declare namespace xrx="http://code.google.com/p/xrx";
declare namespace xf="http://www.w3.org/2002/xforms";
-(: Path/URI variables passed in via controller.xql. See above. :)
+(: Path/URI variables passed in via controller.xql. See above.
declare variable $style:web-path-to-site := request:get-parameter('web-path-to-site', '');
declare variable $style:web-path-to-app := request:get-parameter('web-path-to-app', '');
declare variable $style:db-path-to-site := request:get-parameter('db-path-to-site', '');
declare variable $style:db-path-to-app := request:get-parameter('db-path-to-app', '') ;
declare variable $style:db-path-to-app-data := request:get-parameter('db-path-to-app-data', '');
+:)
+declare variable $style:web-path-to-site := '/rest/db';
+declare variable $style:web-path-to-app := '/rest/db/apps/exist-docs';
+declare variable $style:db-path-to-site := '/db';
+declare variable $style:db-path-to-app := '/db/apps/exist-docs';
+declare variable $style:db-path-to-app-data := '/db/apps/exist-docs/data';
+
(: Returns an integer between 1-4, reflecting the hierarchical depth of the current request, e.g.
/cms/ = 1, /cms/apps/ = 2, /cms/apps/template/ = 3, /cms/apps/template/views/view-item = 4 :)
declare variable $style:web-depth-in-site := xs:integer(request:get-parameter('web-depth-in-site', '1'));
@@ -77,17 +81,22 @@
style:assemble-page(style:title(), style:breadcrumbs(), (), $content)
};
+declare function style:assemble-page($title as xs:string, $content as node()+) as element() {
+ style:assemble-page($title, style:breadcrumbs(), (), $content)
+};
+
(:~
A helper function for style:assemble-page(), with an optional style parameter.
@param $style an optional style node containing CDATA-encased CSS definitions
@param $content nodes for the body of the page
@return properly serialized XHTML page
-:)
+
declare function style:assemble-page($style as element(style)*, $content as node()+)
as element() {
style:assemble-page(style:title(), style:breadcrumbs(), $style, $content)
};
+:)
(:~
A helper function for style:assemble-page(); doesn't rely on the various site/app/page-"info.xml"
@@ -248,7 +257,7 @@
)
else (),
- if (not(auth:get-current-user() = 'guest'))
+ if (not(xmldb:get-current-user() = 'guest'))
then
(
<script type="text/javascript" src="{$style:web-path-to-site}/resources/js/jquery.idletimer.js"></script>,
@@ -275,8 +284,8 @@
as node()+ {
let $banner-image := $style:site-info//xrx:site-header-banner-image/text()
let $banner-alt-text := $style:site-info//xrx:site-header-banner-image-alt-text/text()
- let $user-id := auth:get-current-user()
- let $user-name := users:user-id-to-given-name($user-id)
+ let $user-id := xmldb:get-current-user()
+ let $user-name := $user-id
let $site-search := concat($style:web-path-to-site, "/apps/site-search/search/search")
let $login-action := if ($user-id = "guest") then "Login" else "Logout"
let $login-action-uri := concat($style:web-path-to-site, "/apps/authentication/views/authentication.xq")
@@ -641,8 +650,8 @@
@return a categorized, ordered list of the pages for an app
:)
declare function style:app-pages-menu() as element()+ {
- let $username := auth:get-current-user()
- let $show-development-info := auth:has-developer-rights($username)
+ let $username := xmldb:get-current-user()
+ let $show-development-info := true()
let $show-dev-dashboard := xs:boolean(request:get-parameter('dev-dashboard', '0'))
return
if ($show-development-info and $show-dev-dashboard) then
@@ -766,8 +775,8 @@
else ()
let $label := $page/xrx:label/text()
let $description := $page//xrx:description/text()
- let $username := auth:get-current-user()
- let $show-development-info := auth:has-developer-rights($username)
+ let $username := xmldb:get-current-user()
+ let $show-development-info := true()
let $development-info :=
if ($show-development-info) then
local:development-status-image( $page//xrx:development-stage/text() )
@@ -858,8 +867,9 @@
:)
declare function style:edit-controls($id as xs:string) as node() {
<div class="edit-controls">
- { (: only put the edit controls in if the user has edit rights :)
- if ( auth:has-edit-rights(auth:get-current-user()) )
+ { (: only put the edit controls in if the user has edit rights
+ auth:has-edit-rights(auth:get-current-user()):)
+ if (true())
then (
<a href="../edit/edit?id={$id}">Edit</a>,
<a href="../edit/delete-confirm?id={$id}">Delete</a>,
@@ -887,8 +897,10 @@
declare function style:edit-controls($id as xs:string, $params as xs:string) as node() {
<div class="edit-controls">
{if (contains($params, 'v')) then <a href="../views/view-item?id={$id}">View</a> else () }
- { (: only put the edit controls in if the user has edit rights :)
- if ( auth:has-edit-rights(auth:get-current-user()) )
+ { (: only put the edit controls in if the user has edit rights
+ auth:has-edit-rights(auth:get-current-user())
+ :)
+ if (true())
then (
if (contains($params, 'e')) then <a href="../edit/edit?id={$id}">Edit</a> else (),
if (contains($params, 'd')) then <a href="../edit/delete-confirm?id={$id}">Delete</a> else (),
@@ -907,7 +919,8 @@
(: this line assumes that each item in the application collection has a unigue id :)
let $doc := collection($style:db-path-to-app-data)/*[*:id/text() = $id]
return
- if ( auth:has-publish-rights(auth:get-current-user()) )
+ (: auth:has-publish-rights(auth:get-current-user()) :)
+ if (true())
then
if ($doc//*:publication-status-code/text() = 'published')
then <a href="../../publisher/un-publish-to-web?app-id={style:app-id()}&id={$id}">Un-Publish</a>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dmc...@us...> - 2011-12-30 23:45:27
|
Revision: 15623
http://exist.svn.sourceforge.net/exist/?rev=15623&view=rev
Author: dmccreary
Date: 2011-12-30 23:45:20 +0000 (Fri, 30 Dec 2011)
Log Message:
-----------
Added targets to the build file that will upload all the exist docs into a collection.
Modified Paths:
--------------
apps/docs/build.xml
apps/docs/data/style.xml
Added Paths:
-----------
apps/docs/local.properties
Modified: apps/docs/build.xml
===================================================================
--- apps/docs/build.xml 2011-12-30 18:13:57 UTC (rev 15622)
+++ apps/docs/build.xml 2011-12-30 23:45:20 UTC (rev 15623)
@@ -1,9 +1,48 @@
-<project default="xar" name="eXist Documentation">
-
+<project xmlns:xdb="http://exist-db.org/ant" default="xar" name="eXist Documentation">
+
+ <!-- this is where we set our exist-home, user, password and the place that we will load the docs -->
+ <property file="local.properties"/>
+
+
+ <!-- this tells us where to find the key jar files relative to the ${exist-home} property -->
+ <path id="classpath.core">
+ <fileset dir="${exist-home}/lib/core">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement path="${exist-home}/exist.jar"/>
+ <pathelement path="${exist-home}/exist-optional.jar"/>
+ </path>
+
+ <typedef resource="org/exist/ant/antlib.xml" uri="" rel="nofollow">http://exist-db.org/ant">
+ <classpath refid="classpath.core"/>
+ </typedef>
+
+
+ <!-- upload app -->
+ <target name="upload-exist-docs-app">
+ <echo message="Loading eXist documentation system to eXist."/>
+ <xdb:store
+ uri="${uri}"
+ createcollection="true"
+ createsubcollections="true"
+ user="admin" password="">
+ <fileset dir="${exist-docs}">
+ <include name="**/*.*"/>
+ </fileset>
+ </xdb:store>
+ </target>
+
+ <!-- the archive target -->
<target name="xar">
<delete file="eXist-docs-1.0.xar" failonerror="false"/>
<zip destfile="eXist-docs-1.0.xar">
<fileset dir="." excludes=".svn"/>
</zip>
</target>
+
+ <target name="show-properties">
+ <echo message="exist-home=${exist-home}"/>
+ <echo message="exist-docs=${exist-docs}"/>
+ <echo message="uri=${uri}"/>
+ </target>
</project>
Modified: apps/docs/data/style.xml
===================================================================
--- apps/docs/data/style.xml 2011-12-30 18:13:57 UTC (rev 15622)
+++ apps/docs/data/style.xml 2011-12-30 23:45:20 UTC (rev 15623)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen SCHSchema="../resources/schemas/docbook.xsd" type="xml"?>
-<section xmlns="http://docbook.org/ns/docbook" xml:id="style">
+<section xmlns="http://docbook.org/ns/docbook" xml:id="style" version="5.0">
<info>
<revhistory>
<revision>
@@ -185,4 +185,4 @@
</figure>]]></programlisting>
</section>
</section>
-</section>
\ No newline at end of file
+</section>
Added: apps/docs/local.properties
===================================================================
--- apps/docs/local.properties (rev 0)
+++ apps/docs/local.properties 2011-12-30 23:45:20 UTC (rev 15623)
@@ -0,0 +1,12 @@
+# Local Property file for eXist documentation project
+#
+# Author: Dan McCreary
+# Date
+# this file is loaded into the build.xml file using the <property file="local.properties"/>
+# it contains any local references to your
+# Properties on a Windows system
+exist-home=C:\\ws\\exist-trunk
+exist-docs=C:\\ws\\exist-docs
+user=admin
+password=
+uri=xmldb:exist://localhost:8080/xmlrpc/db/apps/exist-docs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-30 18:14:04
|
Revision: 15622
http://exist.svn.sourceforge.net/exist/?rev=15622&view=rev
Author: dizzzz
Date: 2011-12-30 18:13:57 +0000 (Fri, 30 Dec 2011)
Log Message:
-----------
[ignore] added some questions (marked DWES:), can't solve the current issue yet. Wolf?
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-30 18:04:51 UTC (rev 15621)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-30 18:13:57 UTC (rev 15622)
@@ -157,11 +157,13 @@
// catchvars (CatchErrorCode (, CatchErrorDesc (, CatchErrorVal)?)? )
// need to be retrieved as variables
Sequence catchResultSeq = null;
- LocalVariable mark0 = context.markLocalVariables(false);
+ LocalVariable mark0 = context.markLocalVariables(false); // DWES: what does this do?
// Register new namespace
- // TODO: when declaring "fn:error( fn:QName('http://www.w3.org/2005/xqt-errors', 'err:FOER0000') )"
- // An Exception is thrown.
+ // DWES:
+ // when declaring "fn:error( fn:QName('http://www.w3.org/2005/xqt-errors', 'err:FOER0000') )"
+ // An Exception is thrown: err:XQST0033 It is a static error if a module contains multiple bindings for the same namespace prefix.
+ // DWES: should I use popLocalVariables
context.declareNamespace(Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX, Namespaces.W3C_XQUERY_XPATH_ERROR_NS);
context.declareNamespace(Namespaces.EXIST_XQUERY_XPATH_ERROR_PREFIX, Namespaces.EXIST_XQUERY_XPATH_ERROR_NS);
@@ -177,8 +179,7 @@
errorMatched = true;
// Get catch variables
- List<QName> catchVars = (List<QName>) catchClause.getCatchVars();
- LocalVariable mark1 = context.markLocalVariables(false);
+ LocalVariable mark1 = context.markLocalVariables(false); // DWES: what does this do?
try {
// Add std errors
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-30 18:04:57
|
Revision: 15621
http://exist.svn.sourceforge.net/exist/?rev=15621&view=rev
Author: dizzzz
Date: 2011-12-30 18:04:51 +0000 (Fri, 30 Dec 2011)
Log Message:
-----------
[ignore] minor refactoring
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/functions/fn/FunError.java
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/functions/fn/FunError.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/functions/fn/FunError.java 2011-12-30 18:00:38 UTC (rev 15620)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/functions/fn/FunError.java 2011-12-30 18:04:51 UTC (rev 15621)
@@ -83,7 +83,9 @@
public FunError(XQueryContext context, FunctionSignature signature) {
super(context, signature);
}
+
public final static ErrorCode DEFAULT_ERROR = ErrorCodes.FOER0000;
+ public static final String DEFAULT_DESCRIPTION = "An error has been raised by the query";
@Override
public int returnsType() {
@@ -95,7 +97,7 @@
// Define default values
ErrorCode errorCode = DEFAULT_ERROR;
- String errorDesc = "An error has been raised by the query";
+ String errorDesc = DEFAULT_DESCRIPTION;
Sequence errorVal = Sequence.EMPTY_SEQUENCE;
// Enter if one or more parameters are supplied
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-30 18:00:49
|
Revision: 15620
http://exist.svn.sourceforge.net/exist/?rev=15620&view=rev
Author: dizzzz
Date: 2011-12-30 18:00:38 +0000 (Fri, 30 Dec 2011)
Log Message:
-----------
[ignore] fixed tests for try-catch expression. One issue remains, with a conflicting namespace then using the err: namespace in fn:error() ...
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
branches/dizzzz/xquery3/src/org/exist/xquery/XPathException.java
branches/dizzzz/xquery3/src/org/exist/xquery/XQueryContext.java
branches/dizzzz/xquery3/test/src/org/exist/xquery/functions/xquery3/TryCatchTest.java
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-30 11:29:26 UTC (rev 15619)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-30 18:00:38 UTC (rev 15620)
@@ -160,6 +160,8 @@
LocalVariable mark0 = context.markLocalVariables(false);
// Register new namespace
+ // TODO: when declaring "fn:error( fn:QName('http://www.w3.org/2005/xqt-errors', 'err:FOER0000') )"
+ // An Exception is thrown.
context.declareNamespace(Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX, Namespaces.W3C_XQUERY_XPATH_ERROR_NS);
context.declareNamespace(Namespaces.EXIST_XQUERY_XPATH_ERROR_PREFIX, Namespaces.EXIST_XQUERY_XPATH_ERROR_NS);
@@ -169,7 +171,7 @@
// Iterate on all catch clauses
for (CatchClause catchClause : catchClauses) {
-
+
if (isErrorInList(errorCodeQname, catchClause.getCatchErrorList()) && !errorMatched) {
errorMatched = true;
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/XPathException.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/XPathException.java 2011-12-30 11:29:26 UTC (rev 15619)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/XPathException.java 2011-12-30 18:00:38 UTC (rev 15620)
@@ -46,6 +46,14 @@
this.column = expr.getColumn();
this.source = expr.getSource();
}
+
+
+ public XPathException(ErrorCode errorCode) {
+ super();
+ this.errorCode = errorCode;
+ this.message = errorCode.getDescription();
+ }
+
public XPathException(Expression expr, ErrorCode errorCode, String errorDesc) {
super();
@@ -128,6 +136,7 @@
errorCode.toString();
}
}
+
public XPathException(ErrorCode errorCode, String errorDesc, Throwable cause) {
super(cause);
this.errorCode = errorCode;
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/XQueryContext.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/XQueryContext.java 2011-12-30 11:29:26 UTC (rev 15619)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/XQueryContext.java 2011-12-30 18:00:38 UTC (rev 15620)
@@ -692,26 +692,27 @@
if( uri.equals( Namespaces.XML_NS ) ) {
throw( new XPathException( "err:XQST0070: Namespace URI '" + uri + "' must be bound to the 'xml' prefix" ) );
}
+
final String prevURI = staticNamespaces.get( prefix );
//This prefix was not bound
if( prevURI == null ) {
-
- //Bind it
+
if( uri.length() > 0 ) {
+ //Bind it
staticNamespaces.put( prefix, uri );
staticPrefixes.put( uri, prefix );
return;
- }
- //Nothing to bind
- else {
+
+ } else {
+ //Nothing to bind
//TODO : check the specs : unbinding an NS which is not already bound may be disallowed.
LOG.warn( "Unbinding unbound prefix '" + prefix + "'" );
}
- } else
- //This prefix was bound
- {
+
+ } else {
+ //This prefix was bound
//Unbind it
if( uri.length() == 0 ) {
@@ -725,7 +726,11 @@
}
//those prefixes can be rebound to different URIs
- if( ( prefix.equals( "xs" ) && Namespaces.SCHEMA_NS.equals( prevURI ) ) || ( prefix.equals( "xsi" ) && Namespaces.SCHEMA_INSTANCE_NS.equals( prevURI ) ) || ( prefix.equals( "xdt" ) && Namespaces.XPATH_DATATYPES_NS.equals( prevURI ) ) || ( prefix.equals( "fn" ) && Namespaces.XPATH_FUNCTIONS_NS.equals( prevURI ) ) || ( prefix.equals( "local" ) && Namespaces.XQUERY_LOCAL_NS.equals( prevURI ) ) ) {
+ if( ( prefix.equals( "xs" ) && Namespaces.SCHEMA_NS.equals( prevURI ) )
+ || ( prefix.equals( "xsi" ) && Namespaces.SCHEMA_INSTANCE_NS.equals( prevURI ) )
+ || ( prefix.equals( "xdt" ) && Namespaces.XPATH_DATATYPES_NS.equals( prevURI ) )
+ || ( prefix.equals( "fn" ) && Namespaces.XPATH_FUNCTIONS_NS.equals( prevURI ) )
+ || ( prefix.equals( "local" ) && Namespaces.XQUERY_LOCAL_NS.equals( prevURI ) ) ) {
staticPrefixes.remove( prevURI );
staticNamespaces.remove( prefix );
@@ -734,18 +739,19 @@
staticNamespaces.put( prefix, uri );
staticPrefixes.put( uri, prefix );
return;
- }
- //Nothing to bind (not sure if it should raise an error though)
- else {
+
+ } else {
+ //Nothing to bind (not sure if it should raise an error though)
//TODO : check the specs : unbinding an NS which is not already bound may be disallowed.
LOG.warn( "Unbinding unbound prefix '" + prefix + "'" );
}
+
} else {
//Forbids rebinding the *same* prefix in a *different* namespace in this *same* context
if( !uri.equals( prevURI ) ) {
- throw( new XPathException( "err:XQST0033: Namespace prefix '" + prefix + "' is already bound to a different uri '" + prevURI + "'" ) );
+ throw( new XPathException( ErrorCodes.XQST0033 ) );
}
}
}
Modified: branches/dizzzz/xquery3/test/src/org/exist/xquery/functions/xquery3/TryCatchTest.java
===================================================================
--- branches/dizzzz/xquery3/test/src/org/exist/xquery/functions/xquery3/TryCatchTest.java 2011-12-30 11:29:26 UTC (rev 15619)
+++ branches/dizzzz/xquery3/test/src/org/exist/xquery/functions/xquery3/TryCatchTest.java 2011-12-30 18:00:38 UTC (rev 15620)
@@ -185,7 +185,7 @@
String query = "xquery version '3.0';"
+ "try { a + 7 } "
+ "catch * ($errcode, $errdesc, $errval) "
- + "{ $errcode, $errdesc } ";
+ + "{ $err:code, $err:description } ";
try {
ResourceSet results = executeQuery(query);
@@ -288,8 +288,8 @@
String query1 = "xquery version '3.0';"
+ "try {"
+ " fn:error( fn:QName('http://www.w3.org/2005/xqt-errors', 'err:FOER0000') ) "
- + "} catch * ($errcode) "
- + "{ $errcode }";
+ + "} catch * "
+ + "{ $err:code }";
try {
ResourceSet results = executeQuery(query1);
@@ -309,7 +309,7 @@
String query2 = "xquery version '3.0';"
+ "try {"
+ " fn:error( fn:QName('http://www.w3.org/2005/xqt-errors', 'err:FOER0000') ) "
- + "} catch * ($errcode , $errdescr, $errval) "
+ + "} catch * ($err:code , $err:description, $err:value) "
+ "{ $errcode }";
try {
ResourceSet results = executeQuery(query2);
@@ -330,8 +330,8 @@
String query3 = "xquery version '3.0';"
+ "try {"
+ " fn:error(fn:QName('http://www.w3.org/2005/xqt-errors', 'err:FOER0000'), 'TEST') "
- + "} catch * ($errcode, $errdesc, $errval) "
- + "{ $errcode, $errdesc }";
+ + "} catch * "
+ + "{ $err:code, $err:description }";
try {
ResourceSet results = executeQuery(query3);
@@ -405,8 +405,8 @@
String query = "xquery version '3.0';"
+ "try { a + 7 } "
- + "catch * ($errcode, $errdesc, $errval) "
- + "{ $errcode, $errdesc, empty($errval) } ";
+ + "catch * "
+ + "{ $err:code, $err:description, empty($err:value) } ";
try {
ResourceSet results = executeQuery(query);
@@ -458,7 +458,7 @@
+ "try { "
+ " fn:error(fn:QName('http://foo.com', 'ERRORNAME'), 'ERRORTEXT') "
+ "} "
- + "catch foo:ERRORNAME ($code) { $code } "
+ + "catch foo:ERRORNAME { $err:code } "
+ "catch * { 'bad' } ";
try {
ResourceSet results = executeQuery(query2);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-30 11:29:33
|
Revision: 15619
http://exist.svn.sourceforge.net/exist/?rev=15619&view=rev
Author: dizzzz
Date: 2011-12-30 11:29:26 +0000 (Fri, 30 Dec 2011)
Log Message:
-----------
[ignore] try-catch ; restructuring code, making code more simple
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 22:17:17 UTC (rev 15618)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-30 11:29:26 UTC (rev 15619)
@@ -132,16 +132,17 @@
} catch (Throwable throwable) {
ErrorCode errorCode = null;
+ XPathException xpe = null;
// fn:error throws an XPathException
if(throwable instanceof XPathException){
// Get errorcode from nicely thrown xpathexception
- XPathException xpe = (XPathException)throwable;
+ xpe = (XPathException)throwable;
errorCode = xpe.getErrorCode();
// if no errorcode is found, reconstruct by parsing the error text.
if (errorCode == null) {
- errorCode = extractErrorCode((XPathException)xpe);
+ errorCode = extractErrorCode(xpe);
}
} else {
@@ -160,6 +161,7 @@
// Register new namespace
context.declareNamespace(Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX, Namespaces.W3C_XQUERY_XPATH_ERROR_NS);
+ context.declareNamespace(Namespaces.EXIST_XQUERY_XPATH_ERROR_PREFIX, Namespaces.EXIST_XQUERY_XPATH_ERROR_NS);
try {
// flag used to escape loop when errorcode has matched
@@ -176,145 +178,20 @@
List<QName> catchVars = (List<QName>) catchClause.getCatchVars();
LocalVariable mark1 = context.markLocalVariables(false);
+ try {
+ // Add std errors
+ addErrCode(errorCodeQname);
+ addErrDescription(errorCode);
+ addErrValue(xpe);
+ addErrModule(xpe);
+ addErrLineNumber(xpe);
+ addErrColumnNumber(xpe);
+ addErrAdditional(xpe);
- try {
- // err:code xs:QName
- // The error code
- String code = errorCodeQname.getStringValue();
+ // Evaluate catch expression
+ catchResultSeq = ((Expression) catchClause.getCatchExpr()).eval(contextSequence, contextItem);
- QName q_code = new QName("code", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
- LocalVariable err_code = new LocalVariable( q_code);
- err_code.setSequenceType(new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
- err_code.setValue(new StringValue(code));
- context.declareVariableBinding(err_code);
- // err:description xs:string?
- // A description of the error condition; an empty sequence if no
- // description is available (for example, if the error function
- // was called with one argument).
- String description = errorCode.getDescription();
-
- QName q_description = new QName("description", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
- LocalVariable err_description = new LocalVariable( q_description);
- err_description.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
- if(description == null){
- err_description.setValue(Sequence.EMPTY_SEQUENCE);
- } else {
- err_description.setValue(new StringValue(errorCode.getDescription()));
- }
- context.declareVariableBinding(err_description);
-
- // err:value item()*
- // Value associated with the error. For an error raised by calling
- // the error function, this is the value of the third argument
- // (if supplied).
- QName q_value = new QName("value", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
- LocalVariable err_value = new LocalVariable( q_value);
- err_value.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_MORE));
-
- if (throwable instanceof XPathException) {
- // Get errorcode from exception
- XPathException xpe = (XPathException) throwable;
- Sequence sequence = xpe.getErrorVal();
- if (sequence == null) {
- // TODO setting an empty sequence does not work, it does
- // not make the variable visible
- sequence = Sequence.EMPTY_SEQUENCE;
- }
- err_value.setValue(sequence);
-
- } else {
- // fill data from throwable object
- StringValue value = new StringValue(getStackTrace(throwable));
- err_value.setValue(value);
- }
- context.declareVariableBinding(err_value);
-
-
- // err:module xs:string?
- // The URI (or system ID) of the module containing the expression
- // where the error occurred, or an empty sequence if the information
- // is not available.
-
- String module = null ; // to be defined where to get
- if (throwable instanceof XPathException) {
- XPathException xpe = (XPathException)throwable;
- XACMLSource src = xpe.getXACMLSource();
- if(src!=null){
- module=src.getKey();
- }
- }
-
- QName q_module = new QName("module", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
- LocalVariable err_module = new LocalVariable( q_module);
- err_module.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
- if(module == null){
- err_module.setValue(Sequence.EMPTY_SEQUENCE);
- } else {
- err_module.setValue(new StringValue(module));
- }
- context.declareVariableBinding(err_module);
-
- // err:line-number xs:integer?
- // The line number within the stylesheet module of the instruction
- // where the error occurred, or an empty sequence if the information
- // is not available. The value may be approximate.
- Integer line_nr = null ;
- if (throwable instanceof XPathException) {
- XPathException xpe = (XPathException)throwable;
- line_nr=xpe.getLine();
- }
-
- QName q_line_nr = new QName("line-number", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
- LocalVariable err_line_nr = new LocalVariable( q_line_nr);
- err_line_nr.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
- if(line_nr == null){
- err_line_nr.setValue(Sequence.EMPTY_SEQUENCE);
- } else {
- err_line_nr.setValue(new IntegerValue(line_nr));
- }
- context.declareVariableBinding(err_line_nr);
-
- // err:column-number xs:integer?
- // The column number within the stylesheet module of the instruction
- // where the error occurred, or an empty sequence if the information
- // is not available. The value may be approximate.
- Integer column_nr = null ; // to be defined where to get
- if (throwable instanceof XPathException) {
- XPathException xpe = (XPathException)throwable;
- column_nr=xpe.getColumn();
- }
-
- QName q_column_nr = new QName("column-number", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
- LocalVariable err_column_nr = new LocalVariable( q_column_nr);
- err_column_nr.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
- if(column_nr == null){
- err_column_nr.setValue(Sequence.EMPTY_SEQUENCE);
- } else {
- err_column_nr.setValue(new IntegerValue(column_nr));
- }
- context.declareVariableBinding(err_column_nr);
-
- // err:additional item()*
- // Implementation-defined. This variable must be bound so that a query
- // can reference it without raising an error. The purpose of this
- // variable is to allow implementations to provide any additional
- // information that might be useful.
- String additional = null;
-
- QName q_additional = new QName("additional", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
- LocalVariable err_additional = new LocalVariable( q_additional);
- err_additional.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
- if(additional == null){
- err_additional.setValue(Sequence.EMPTY_SEQUENCE);
- } else {
- err_additional.setValue(new StringValue("to do"));
- }
- context.declareVariableBinding(err_additional);
-
- // Evaluate catch expression
- catchResultSeq = ((Expression) catchClause.getCatchExpr()).eval(contextSequence, contextItem);
-
} finally {
context.popLocalVariables(mark1);
}
@@ -342,6 +219,154 @@
}
}
+
+ // err:additional item()*
+ // Implementation-defined. This variable must be bound so that a query
+ // can reference it without raising an error. The purpose of this
+ // variable is to allow implementations to provide any additional
+ // information that might be useful.
+ private void addErrAdditional(XPathException xpe) throws XPathException {
+ String additional = null;
+
+ QName q_additional = new QName("additional", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_additional = new LocalVariable( q_additional);
+ err_additional.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(additional == null){
+ err_additional.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_additional.setValue(new StringValue("to do"));
+ }
+ context.declareVariableBinding(err_additional);
+ }
+
+ // err:column-number xs:integer?
+ // The column number within the stylesheet module of the instruction
+ // where the error occurred, or an empty sequence if the information
+ // is not available. The value may be approximate.
+ private void addErrColumnNumber(XPathException xpe) throws XPathException {
+
+ Integer column_nr = null ;
+ if (xpe != null) {
+ column_nr=xpe.getColumn();
+ }
+
+ QName q_column_nr = new QName("column-number", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_column_nr = new LocalVariable( q_column_nr);
+ err_column_nr.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(column_nr == null){
+ err_column_nr.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_column_nr.setValue(new IntegerValue(column_nr));
+ }
+ context.declareVariableBinding(err_column_nr);
+ }
+
+ // err:line-number xs:integer?
+ // The line number within the stylesheet module of the instruction
+ // where the error occurred, or an empty sequence if the information
+ // is not available. The value may be approximate.
+ private void addErrLineNumber(XPathException xpe) throws XPathException {
+
+ Integer line_nr = null ;
+ if (xpe != null) {
+ line_nr=xpe.getLine();
+ }
+
+ QName q_line_nr = new QName("line-number", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_line_nr = new LocalVariable( q_line_nr);
+ err_line_nr.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(line_nr == null){
+ err_line_nr.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_line_nr.setValue(new IntegerValue(line_nr));
+ }
+ context.declareVariableBinding(err_line_nr);
+ }
+
+ // err:module xs:string?
+ // The URI (or system ID) of the module containing the expression
+ // where the error occurred, or an empty sequence if the information
+ // is not available.
+ private void addErrModule(XPathException xpe) throws XPathException {
+
+ String module = null ; // to be defined where to get
+ if (xpe != null) {
+ XACMLSource src = xpe.getXACMLSource();
+ if(src!=null){
+ module=src.getKey();
+ }
+ }
+
+ QName q_module = new QName("module", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_module = new LocalVariable( q_module);
+ err_module.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(module == null){
+ err_module.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_module.setValue(new StringValue(module));
+ }
+ context.declareVariableBinding(err_module);
+ }
+
+ // err:value item()*
+ // Value associated with the error. For an error raised by calling
+ // the error function, this is the value of the third argument
+ // (if supplied).
+ private void addErrValue(XPathException xpe) throws XPathException {
+
+ QName q_value = new QName("value", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_value = new LocalVariable( q_value);
+ err_value.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_MORE));
+
+ if (xpe != null) {
+ // Get errorcode from exception
+ Sequence sequence = xpe.getErrorVal();
+ if (sequence == null) {
+ sequence = Sequence.EMPTY_SEQUENCE;
+ }
+ err_value.setValue(sequence);
+
+ } else {
+ // fill data from throwable object
+ StringValue value = new StringValue(getStackTrace(xpe));
+ err_value.setValue(value);
+ }
+ context.declareVariableBinding(err_value);
+ }
+
+ // err:description xs:string?
+ // A description of the error condition; an empty sequence if no
+ // description is available (for example, if the error function
+ // was called with one argument).
+ private void addErrDescription(ErrorCode errorCode) throws XPathException {
+
+ String description = errorCode.getDescription();
+
+ QName q_description = new QName("description", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_description = new LocalVariable( q_description);
+ err_description.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(description == null){
+ err_description.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_description.setValue(new StringValue(errorCode.getDescription()));
+ }
+ context.declareVariableBinding(err_description);
+ }
+
+ // err:code xs:QName
+ // The error code
+ private void addErrCode(QName errorCodeQname) throws XPathException {
+
+ String code = errorCodeQname.getStringValue();
+
+ QName q_code = new QName("code", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_code = new LocalVariable( q_code);
+ err_code.setSequenceType(new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
+ err_code.setValue(new StringValue(code));
+ context.declareVariableBinding(err_code);
+ }
+
+
/**
* Extract and construct errorcode from error text.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 22:17:23
|
Revision: 15618
http://exist.svn.sourceforge.net/exist/?rev=15618&view=rev
Author: dizzzz
Date: 2011-12-29 22:17:17 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] added test retrieval all params
Modified Paths:
--------------
branches/dizzzz/xquery3/test/src/xquery/xquery3/xq3_trycatch.xml
Modified: branches/dizzzz/xquery3/test/src/xquery/xquery3/xq3_trycatch.xml
===================================================================
--- branches/dizzzz/xquery3/test/src/xquery/xquery3/xq3_trycatch.xml 2011-12-29 22:08:45 UTC (rev 15617)
+++ branches/dizzzz/xquery3/test/src/xquery/xquery3/xq3_trycatch.xml 2011-12-29 22:17:17 UTC (rev 15618)
@@ -289,5 +289,23 @@
<c/>
</expected>
</test>
+
+<test output="text">
+ <task>Test for catching the right java exception 2</task>
+ <code><![CDATA[
+ xquery version '3.0';
+ let $x := "a b c"
+ return
+try {
+ fn:error(QName('http://foobar', 'foo:BAR'), "foofoo", <barbar/>)
+}
+catch * {
+ $err:code,'-', exists($err:value), $err:description,
+ $err:module, '(', $err:line-number, ',', $err:column-number, ')'
+}
+]]>
+ </code>
+ <expected>foo:BAR - true foofoo String ( 6 , 5 )</expected>
+ </test>
</TestSet>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 22:08:52
|
Revision: 15617
http://exist.svn.sourceforge.net/exist/?rev=15617&view=rev
Author: dizzzz
Date: 2011-12-29 22:08:45 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] repairing tests, repaired line-number and column-number variables
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
branches/dizzzz/xquery3/test/src/xquery/xquery3/xq3_trycatch.xml
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 21:21:36 UTC (rev 15616)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 22:08:45 UTC (rev 15617)
@@ -265,7 +265,7 @@
line_nr=xpe.getLine();
}
- QName q_line_nr = new QName("line-nr", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ QName q_line_nr = new QName("line-number", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
LocalVariable err_line_nr = new LocalVariable( q_line_nr);
err_line_nr.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
if(line_nr == null){
@@ -285,7 +285,7 @@
column_nr=xpe.getColumn();
}
- QName q_column_nr = new QName("column-nr", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ QName q_column_nr = new QName("column-number", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
LocalVariable err_column_nr = new LocalVariable( q_column_nr);
err_column_nr.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
if(column_nr == null){
Modified: branches/dizzzz/xquery3/test/src/xquery/xquery3/xq3_trycatch.xml
===================================================================
--- branches/dizzzz/xquery3/test/src/xquery/xquery3/xq3_trycatch.xml 2011-12-29 21:21:36 UTC (rev 15616)
+++ branches/dizzzz/xquery3/test/src/xquery/xquery3/xq3_trycatch.xml 2011-12-29 22:08:45 UTC (rev 15617)
@@ -81,9 +81,9 @@
<product>{$product/name}
<margin>{$product/price div $product/cost}</margin>
</product>
- } catch * ($errcode) {
+ } catch * {
<product>{
- ($product/name, "Error:", $errcode)
+ ($product/name, "Error:", $err:code)
}</product>
}
}</result>
@@ -252,10 +252,10 @@
xquery version '3.0';
try{
xmldb:store('/db/foobaar/', "text.xml", <a/>)
-} catch * ($errcode, $errdesc) {
+} catch * {
<result>
-<code>{$errcode}</code>
-<desc>{$errdesc}</desc>
+<code>{$err:code}</code>
+<desc>{$err:description}</desc>
</result>
}
]]>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 21:21:43
|
Revision: 15616
http://exist.svn.sourceforge.net/exist/?rev=15616&view=rev
Author: dizzzz
Date: 2011-12-29 21:21:36 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] Added report of location of error.
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
branches/dizzzz/xquery3/src/org/exist/xquery/XPathException.java
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 19:00:39 UTC (rev 15615)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 21:21:36 UTC (rev 15616)
@@ -31,6 +31,7 @@
import org.exist.Namespaces;
import org.exist.dom.QName;
+import org.exist.security.xacml.XACMLSource;
import org.exist.xquery.ErrorCodes.ErrorCode;
import org.exist.xquery.ErrorCodes.JavaErrorCode;
import org.exist.xquery.util.ExpressionDumper;
@@ -238,7 +239,10 @@
String module = null ; // to be defined where to get
if (throwable instanceof XPathException) {
XPathException xpe = (XPathException)throwable;
- module=this.getContext().getModuleLoadPath();
+ XACMLSource src = xpe.getXACMLSource();
+ if(src!=null){
+ module=src.getKey();
+ }
}
QName q_module = new QName("module", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
@@ -316,7 +320,7 @@
}
} else {
- // if in the end nothing is set, rethrow
+ // if in the end nothing is set, rethrow after loop
}
} // for catch clauses
@@ -338,63 +342,6 @@
}
}
- private void handeObsoleteVars(List<QName> catchVars, ErrorCode errorCode, Throwable throwable) throws XPathException {
- int varPos = 1;
-
- // catch variables
- // "(" CatchErrorCode ("," CatchErrorDesc ("," CatchErrorVal)?)? ")"
- for (QName catchVar : catchVars) {
-
- // reset qname and prefix
- catchVar.setPrefix(null);
- catchVar.setNamespaceURI("");
-
- LocalVariable localVar = new LocalVariable(catchVar);
-
- // This should be in order of existance
- // xs:QName, xs:string?, and item()* respectively.
- switch (varPos) {
- case 1:
- // Error code: qname
- localVar.setSequenceType(new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
- QNameValue qnv = new QNameValue(context, catchVar);
- localVar.setValue(new StringValue(errorCode.getErrorQName().getStringValue()));
- break;
-
- case 2:
- // Error description : optional string
- localVar.setSequenceType(new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE));
- StringValue sv = new StringValue(errorCode.getDescription());
- localVar.setValue(sv);
- break;
-
- case 3:
- // Error value : optional item
- localVar.setSequenceType(new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE));
- if (throwable instanceof XPathException) {
- // Get errorcode from exception
- XPathException xpe = (XPathException) throwable;
- Sequence sequence = xpe.getErrorVal();
- if (sequence == null) {
- // TODO setting an empty sequence does not work, it does
- // not make the variable visible
- sequence = Sequence.EMPTY_SEQUENCE;
- }
- localVar.setValue(sequence);
-
- } else {
- // fill data from throwable object
- StringValue value = new StringValue(getStackTrace(throwable));
- localVar.setValue(value);
- }
- break;
- }
- context.declareVariableBinding(localVar);
- varPos++;
-
- } // for - Var catch variables
- }
-
/**
* Extract and construct errorcode from error text.
*/
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/XPathException.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/XPathException.java 2011-12-29 19:00:39 UTC (rev 15615)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/XPathException.java 2011-12-29 21:21:36 UTC (rev 15616)
@@ -175,6 +175,10 @@
return errorCode;
}
+ public XACMLSource getXACMLSource() {
+ return source;
+ }
+
public void addFunctionCall(UserDefinedFunction def, Expression call) {
if(callStack == null) {
callStack = new ArrayList<FunctionStackElement>();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 19:00:45
|
Revision: 15615
http://exist.svn.sourceforge.net/exist/?rev=15615&view=rev
Author: dizzzz
Date: 2011-12-29 19:00:39 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] 3nd step in updating try-catch ; almost there
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 18:44:22 UTC (rev 15614)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 19:00:39 UTC (rev 15615)
@@ -176,13 +176,7 @@
LocalVariable mark1 = context.markLocalVariables(false);
- try {
- // DWES: this needs te be removed, isolation of old code
- //handeObsoleteVars(catchVars, errorCode, throwable);
-
- // Replace by the following code.
- // Issue: err:code is not available yet in catch expression
-
+ try {
// err:code xs:QName
// The error code
String code = errorCodeQname.getStringValue();
@@ -242,6 +236,10 @@
// is not available.
String module = null ; // to be defined where to get
+ if (throwable instanceof XPathException) {
+ XPathException xpe = (XPathException)throwable;
+ module=this.getContext().getModuleLoadPath();
+ }
QName q_module = new QName("module", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
LocalVariable err_module = new LocalVariable( q_module);
@@ -257,7 +255,11 @@
// The line number within the stylesheet module of the instruction
// where the error occurred, or an empty sequence if the information
// is not available. The value may be approximate.
- Integer line_nr = null ; // to be defined where to get
+ Integer line_nr = null ;
+ if (throwable instanceof XPathException) {
+ XPathException xpe = (XPathException)throwable;
+ line_nr=xpe.getLine();
+ }
QName q_line_nr = new QName("line-nr", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
LocalVariable err_line_nr = new LocalVariable( q_line_nr);
@@ -274,6 +276,10 @@
// where the error occurred, or an empty sequence if the information
// is not available. The value may be approximate.
Integer column_nr = null ; // to be defined where to get
+ if (throwable instanceof XPathException) {
+ XPathException xpe = (XPathException)throwable;
+ column_nr=xpe.getColumn();
+ }
QName q_column_nr = new QName("column-nr", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
LocalVariable err_column_nr = new LocalVariable( q_column_nr);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 18:44:28
|
Revision: 15614
http://exist.svn.sourceforge.net/exist/?rev=15614&view=rev
Author: dizzzz
Date: 2011-12-29 18:44:22 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] 2nd step in updating try-catch ; the following case works already:
xquery version '3.0';
try {
fn:error(fn:QName('http://www.example.com/HR', 'myerr:toohighsal'), 'Does not apply because salary is too high', ("a",<b/>))
}
catch * {
$err:code, $err:description, $err:value, $err:module, $err:line-nr, $err:colum-nr, $err:additional
}
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 18:29:50 UTC (rev 15613)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 18:44:22 UTC (rev 15614)
@@ -34,6 +34,7 @@
import org.exist.xquery.ErrorCodes.ErrorCode;
import org.exist.xquery.ErrorCodes.JavaErrorCode;
import org.exist.xquery.util.ExpressionDumper;
+import org.exist.xquery.value.IntegerValue;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.QNameValue;
import org.exist.xquery.value.Sequence;
@@ -240,21 +241,66 @@
// where the error occurred, or an empty sequence if the information
// is not available.
+ String module = null ; // to be defined where to get
+
+ QName q_module = new QName("module", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_module = new LocalVariable( q_module);
+ err_module.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(module == null){
+ err_module.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_module.setValue(new StringValue(module));
+ }
+ context.declareVariableBinding(err_module);
+
// err:line-number xs:integer?
// The line number within the stylesheet module of the instruction
// where the error occurred, or an empty sequence if the information
// is not available. The value may be approximate.
+ Integer line_nr = null ; // to be defined where to get
+ QName q_line_nr = new QName("line-nr", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_line_nr = new LocalVariable( q_line_nr);
+ err_line_nr.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(line_nr == null){
+ err_line_nr.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_line_nr.setValue(new IntegerValue(line_nr));
+ }
+ context.declareVariableBinding(err_line_nr);
+
// err:column-number xs:integer?
// The column number within the stylesheet module of the instruction
// where the error occurred, or an empty sequence if the information
// is not available. The value may be approximate.
+ Integer column_nr = null ; // to be defined where to get
+ QName q_column_nr = new QName("column-nr", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_column_nr = new LocalVariable( q_column_nr);
+ err_column_nr.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(column_nr == null){
+ err_column_nr.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_column_nr.setValue(new IntegerValue(column_nr));
+ }
+ context.declareVariableBinding(err_column_nr);
+
// err:additional item()*
// Implementation-defined. This variable must be bound so that a query
// can reference it without raising an error. The purpose of this
// variable is to allow implementations to provide any additional
// information that might be useful.
+ String additional = null;
+
+ QName q_additional = new QName("additional", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_additional = new LocalVariable( q_additional);
+ err_additional.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(additional == null){
+ err_additional.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_additional.setValue(new StringValue("to do"));
+ }
+ context.declareVariableBinding(err_additional);
// Evaluate catch expression
catchResultSeq = ((Expression) catchClause.getCatchExpr()).eval(contextSequence, contextItem);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 18:29:56
|
Revision: 15613
http://exist.svn.sourceforge.net/exist/?rev=15613&view=rev
Author: dizzzz
Date: 2011-12-29 18:29:50 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] 1st step in updating try-catch ; the following case works already:
xquery version '3.0';
try {
fn:error(fn:QName('http://www.example.com/HR', 'myerr:toohighsal'), 'Does not apply because salary is too high', ("a",<b/>))
}
catch * {
$err:code, $err:description, $err:value
}
Modified Paths:
--------------
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 16:20:03 UTC (rev 15612)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 18:29:50 UTC (rev 15613)
@@ -155,6 +155,9 @@
// need to be retrieved as variables
Sequence catchResultSeq = null;
LocalVariable mark0 = context.markLocalVariables(false);
+
+ // Register new namespace
+ context.declareNamespace(Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX, Namespaces.W3C_XQUERY_XPATH_ERROR_NS);
try {
// flag used to escape loop when errorcode has matched
@@ -174,31 +177,64 @@
try {
// DWES: this needs te be removed, isolation of old code
- handeObsoleteVars(catchVars, errorCode, throwable);
+ //handeObsoleteVars(catchVars, errorCode, throwable);
// Replace by the following code.
// Issue: err:code is not available yet in catch expression
// err:code xs:QName
// The error code
+ String code = errorCodeQname.getStringValue();
+
QName q_code = new QName("code", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
LocalVariable err_code = new LocalVariable( q_code);
err_code.setSequenceType(new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
- err_code.setValue(new StringValue(errorCodeQname.getStringValue()));
- context.declareVariableBinding(err_code);
+ err_code.setValue(new StringValue(code));
+ context.declareVariableBinding(err_code);
- catchVars.add(q_code);
-
// err:description xs:string?
// A description of the error condition; an empty sequence if no
// description is available (for example, if the error function
// was called with one argument).
+ String description = errorCode.getDescription();
+
+ QName q_description = new QName("description", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_description = new LocalVariable( q_description);
+ err_description.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ if(description == null){
+ err_description.setValue(Sequence.EMPTY_SEQUENCE);
+ } else {
+ err_description.setValue(new StringValue(errorCode.getDescription()));
+ }
+ context.declareVariableBinding(err_description);
// err:value item()*
// Value associated with the error. For an error raised by calling
// the error function, this is the value of the third argument
// (if supplied).
+ QName q_value = new QName("value", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_value = new LocalVariable( q_value);
+ err_value.setSequenceType(new SequenceType(Type.QNAME, Cardinality.ZERO_OR_MORE));
+ if (throwable instanceof XPathException) {
+ // Get errorcode from exception
+ XPathException xpe = (XPathException) throwable;
+ Sequence sequence = xpe.getErrorVal();
+ if (sequence == null) {
+ // TODO setting an empty sequence does not work, it does
+ // not make the variable visible
+ sequence = Sequence.EMPTY_SEQUENCE;
+ }
+ err_value.setValue(sequence);
+
+ } else {
+ // fill data from throwable object
+ StringValue value = new StringValue(getStackTrace(throwable));
+ err_value.setValue(value);
+ }
+ context.declareVariableBinding(err_value);
+
+
// err:module xs:string?
// The URI (or system ID) of the module containing the expression
// where the error occurred, or an empty sequence if the information
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 16:20:15
|
Revision: 15612
http://exist.svn.sourceforge.net/exist/?rev=15612&view=rev
Author: dizzzz
Date: 2011-12-29 16:20:03 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] first step, updating try-catch expression to latest specification
Modified Paths:
--------------
branches/dizzzz/xquery3/nbproject/project.xml
branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
Modified: branches/dizzzz/xquery3/nbproject/project.xml
===================================================================
--- branches/dizzzz/xquery3/nbproject/project.xml 2011-12-29 15:55:04 UTC (rev 15611)
+++ branches/dizzzz/xquery3/nbproject/project.xml 2011-12-29 16:20:03 UTC (rev 15612)
@@ -3,7 +3,7 @@
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="" rel="nofollow">http://www.netbeans.org/ns/j2se-project/3">
- <name>eXist-1.5</name>
+ <name>eXist-1.5-xquery3</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir" name="Core"/>
Modified: branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java
===================================================================
--- branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 15:55:04 UTC (rev 15611)
+++ branches/dizzzz/xquery3/src/org/exist/xquery/TryCatchExpression.java 2011-12-29 16:20:03 UTC (rev 15612)
@@ -28,8 +28,8 @@
import org.apache.log4j.Logger;
+import org.exist.Namespaces;
import org.exist.dom.QName;
-import org.exist.xquery.ErrorCodes.EXistErrorCode;
import org.exist.xquery.ErrorCodes.ErrorCode;
import org.exist.xquery.ErrorCodes.JavaErrorCode;
@@ -131,6 +131,7 @@
ErrorCode errorCode = null;
+ // fn:error throws an XPathException
if(throwable instanceof XPathException){
// Get errorcode from nicely thrown xpathexception
XPathException xpe = (XPathException)throwable;
@@ -169,63 +170,56 @@
// Get catch variables
List<QName> catchVars = (List<QName>) catchClause.getCatchVars();
LocalVariable mark1 = context.markLocalVariables(false);
- int varPos = 1;
+
try {
- // catch variables
- // "(" CatchErrorCode ("," CatchErrorDesc ("," CatchErrorVal)?)? ")"
- for (QName catchVar : catchVars) {
+ // DWES: this needs te be removed, isolation of old code
+ handeObsoleteVars(catchVars, errorCode, throwable);
- // reset qname and prefix
- catchVar.setPrefix(null);
- catchVar.setNamespaceURI("");
+ // Replace by the following code.
+ // Issue: err:code is not available yet in catch expression
+
+ // err:code xs:QName
+ // The error code
+ QName q_code = new QName("code", Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX);
+ LocalVariable err_code = new LocalVariable( q_code);
+ err_code.setSequenceType(new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
+ err_code.setValue(new StringValue(errorCodeQname.getStringValue()));
+ context.declareVariableBinding(err_code);
+
+ catchVars.add(q_code);
+
+ // err:description xs:string?
+ // A description of the error condition; an empty sequence if no
+ // description is available (for example, if the error function
+ // was called with one argument).
- LocalVariable localVar = new LocalVariable(catchVar);
+ // err:value item()*
+ // Value associated with the error. For an error raised by calling
+ // the error function, this is the value of the third argument
+ // (if supplied).
+
+ // err:module xs:string?
+ // The URI (or system ID) of the module containing the expression
+ // where the error occurred, or an empty sequence if the information
+ // is not available.
+
+ // err:line-number xs:integer?
+ // The line number within the stylesheet module of the instruction
+ // where the error occurred, or an empty sequence if the information
+ // is not available. The value may be approximate.
+
+ // err:column-number xs:integer?
+ // The column number within the stylesheet module of the instruction
+ // where the error occurred, or an empty sequence if the information
+ // is not available. The value may be approximate.
+
+ // err:additional item()*
+ // Implementation-defined. This variable must be bound so that a query
+ // can reference it without raising an error. The purpose of this
+ // variable is to allow implementations to provide any additional
+ // information that might be useful.
- // This should be in order of existance
- // xs:QName, xs:string?, and item()* respectively.
- switch (varPos) {
- case 1:
- // Error code: qname
- localVar.setSequenceType(new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
- QNameValue qnv = new QNameValue(context, catchVar);
- localVar.setValue(new StringValue(errorCode.getErrorQName().getStringValue()));
- break;
-
- case 2:
- // Error description : optional string
- localVar.setSequenceType(new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE));
- StringValue sv = new StringValue(errorCode.getDescription());
- localVar.setValue(sv);
- break;
-
- case 3:
- // Error value : optional item
- localVar.setSequenceType(new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE));
- if (throwable instanceof XPathException) {
- // Get errorcode from exception
- XPathException xpe = (XPathException) throwable;
- Sequence sequence = xpe.getErrorVal();
- if (sequence == null) {
- // TODO setting an empty sequence does not work, it does
- // not make the variable visible
- sequence = Sequence.EMPTY_SEQUENCE;
- }
- localVar.setValue(sequence);
-
- } else {
- // fill data from throwable object
- StringValue value = new StringValue(getStackTrace(throwable));
- localVar.setValue(value);
- }
- break;
- }
- context.declareVariableBinding(localVar);
- varPos++;
-
- } // Var catch variables
-
-
// Evaluate catch expression
catchResultSeq = ((Expression) catchClause.getCatchExpr()).eval(contextSequence, contextItem);
@@ -256,6 +250,63 @@
}
}
+ private void handeObsoleteVars(List<QName> catchVars, ErrorCode errorCode, Throwable throwable) throws XPathException {
+ int varPos = 1;
+
+ // catch variables
+ // "(" CatchErrorCode ("," CatchErrorDesc ("," CatchErrorVal)?)? ")"
+ for (QName catchVar : catchVars) {
+
+ // reset qname and prefix
+ catchVar.setPrefix(null);
+ catchVar.setNamespaceURI("");
+
+ LocalVariable localVar = new LocalVariable(catchVar);
+
+ // This should be in order of existance
+ // xs:QName, xs:string?, and item()* respectively.
+ switch (varPos) {
+ case 1:
+ // Error code: qname
+ localVar.setSequenceType(new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
+ QNameValue qnv = new QNameValue(context, catchVar);
+ localVar.setValue(new StringValue(errorCode.getErrorQName().getStringValue()));
+ break;
+
+ case 2:
+ // Error description : optional string
+ localVar.setSequenceType(new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE));
+ StringValue sv = new StringValue(errorCode.getDescription());
+ localVar.setValue(sv);
+ break;
+
+ case 3:
+ // Error value : optional item
+ localVar.setSequenceType(new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE));
+ if (throwable instanceof XPathException) {
+ // Get errorcode from exception
+ XPathException xpe = (XPathException) throwable;
+ Sequence sequence = xpe.getErrorVal();
+ if (sequence == null) {
+ // TODO setting an empty sequence does not work, it does
+ // not make the variable visible
+ sequence = Sequence.EMPTY_SEQUENCE;
+ }
+ localVar.setValue(sequence);
+
+ } else {
+ // fill data from throwable object
+ StringValue value = new StringValue(getStackTrace(throwable));
+ localVar.setValue(value);
+ }
+ break;
+ }
+ context.declareVariableBinding(localVar);
+ varPos++;
+
+ } // for - Var catch variables
+ }
+
/**
* Extract and construct errorcode from error text.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 15:55:10
|
Revision: 15611
http://exist.svn.sourceforge.net/exist/?rev=15611&view=rev
Author: dizzzz
Date: 2011-12-29 15:55:04 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] I should use command line tools
Added Paths:
-----------
branches/dizzzz/xquery3/
Property changes on: branches/dizzzz/xquery3
___________________________________________________________________
Added: svn:ignore
+ build
dist
private
.exist_history
.exist_query_history
exist*.jar
client.properties
conf.xml
descriptor.xml
mime-types.xml
server.xml
start.jar
key.store
Added: svn:mergeinfo
+ /branches/adam/eXist-acl:14123-14668
/branches/adam/security-locking:15302-15345
/branches/jmfg/res64-eXist:12887-13224
/trunk/eXist/nbproject:8007-14504
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 15:53:35
|
Revision: 15610
http://exist.svn.sourceforge.net/exist/?rev=15610&view=rev
Author: dizzzz
Date: 2011-12-29 15:53:29 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
[ignore] I should use command line tools
Removed Paths:
-------------
branches/dizzzz/xquery3/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 15:52:03
|
Revision: 15609
http://exist.svn.sourceforge.net/exist/?rev=15609&view=rev
Author: dizzzz
Date: 2011-12-29 15:51:57 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
New branch for updated xquery3 spec
Added Paths:
-----------
branches/dizzzz/xquery3/eXist/
Property changes on: branches/dizzzz/xquery3/eXist
___________________________________________________________________
Added: svn:ignore
+ build
dist
private
.exist_history
.exist_query_history
exist*.jar
client.properties
conf.xml
descriptor.xml
mime-types.xml
server.xml
start.jar
key.store
Added: svn:mergeinfo
+ /branches/adam/eXist-acl:14123-14668
/branches/adam/security-locking:15302-15345
/branches/jmfg/res64-eXist:12887-13224
/trunk/eXist/nbproject:8007-14504
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2011-12-29 15:51:22
|
Revision: 15608
http://exist.svn.sourceforge.net/exist/?rev=15608&view=rev
Author: dizzzz
Date: 2011-12-29 15:51:16 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
New branch for updated xquery3 spec
Added Paths:
-----------
branches/dizzzz/xquery3/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kri...@us...> - 2011-12-28 23:36:32
|
Revision: 15607
http://exist.svn.sourceforge.net/exist/?rev=15607&view=rev
Author: krizzdewizz
Date: 2011-12-28 23:36:26 +0000 (Wed, 28 Dec 2011)
Log Message:
-----------
provide a link to open browse view
Modified Paths:
--------------
trunk/eclipse_plugin/org.exist.eclipse.browse/src/org/exist/eclipse/browse/internal/views/document/DocumentView.java
Modified: trunk/eclipse_plugin/org.exist.eclipse.browse/src/org/exist/eclipse/browse/internal/views/document/DocumentView.java
===================================================================
--- trunk/eclipse_plugin/org.exist.eclipse.browse/src/org/exist/eclipse/browse/internal/views/document/DocumentView.java 2011-12-28 23:17:31 UTC (rev 15606)
+++ trunk/eclipse_plugin/org.exist.eclipse.browse/src/org/exist/eclipse/browse/internal/views/document/DocumentView.java 2011-12-28 23:36:26 UTC (rev 15607)
@@ -15,21 +15,23 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.part.ViewPart;
@@ -69,6 +71,12 @@
private Text _textFilter;
private Label _labelCount;
+ private Link _infoLink;
+
+ private Composite _content;
+
+ private Composite _stack;
+
/**
* The constructor.
*/
@@ -94,20 +102,46 @@
layout.verticalSpacing = 2;
parent.setLayout(layout);
- Composite inner = new Composite(parent, SWT.NONE);
- GridLayout innerLayout = new GridLayout();
- innerLayout.marginHeight = 0;
- innerLayout.marginWidth = 2;
- innerLayout.numColumns = 2;
- GridData innerGd = new GridData(GridData.FILL_HORIZONTAL);
- inner.setLayoutData(innerGd);
+ Composite stack = new Composite(parent, SWT.NONE);
+ _stack = stack;
+ StackLayout a = new StackLayout();
+ stack.setLayout(a);
+ stack.setLayoutData(new GridData(GridData.FILL_BOTH));
- inner.setLayout(innerLayout);
+ Link infoLink = new Link(stack, SWT.NONE);
+ String explorerName = PlatformUI.getWorkbench().getViewRegistry().find(
+ BrowseView.ID).getLabel();
+ infoLink.setText("To display documents here, open a collection in <a>"
+ + explorerName + "</a>.");
+ infoLink.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ onOpenEXistExplorer();
+ }
+ });
+ _infoLink = infoLink;
+
+ Composite content = new Composite(stack, SWT.NONE);
+ GridLayout contentGl = new GridLayout();
+ contentGl.marginWidth = 0;
+ contentGl.marginHeight = 0;
+ content.setLayout(contentGl);
+ _content = content;
+
+ Composite top = new Composite(content, SWT.NONE);
+ GridLayout topLayout = new GridLayout();
+ topLayout.marginHeight = 0;
+ topLayout.marginWidth = 2;
+ topLayout.numColumns = 2;
+ top.setLayout(topLayout);
+ GridData topGd = new GridData(GridData.FILL_HORIZONTAL);
+ top.setLayoutData(topGd);
+
// text control - filter
- Label filterLabel = new Label(inner, SWT.NONE);
+ Label filterLabel = new Label(top, SWT.NONE);
filterLabel.setText("Filter:");
filterLabel.setLayoutData(new GridData(0));
- _textFilter = new Text(inner, SWT.BORDER);
+ _textFilter = new Text(top, SWT.BORDER);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
_textFilter.setLayoutData(gd);
@@ -125,16 +159,11 @@
}
});
- _viewer = new TableViewer(parent, SWT.VIRTUAL | SWT.MULTI);
+ _viewer = new TableViewer(content, SWT.VIRTUAL | SWT.MULTI);
_viewer.setContentProvider(new ViewContentProvider(this));
_viewer.setLabelProvider(new ViewLabelProvider());
_viewer.setUseHashlookup(true);
_viewer.setSorter(new NameSorter());
- _viewer.getTable().addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- onPaintTable(e);
- }
- });
// SWT.FULL_SELECTION does not have an effect. create effect with
// TableColumn that fill's horizontally
@@ -163,7 +192,7 @@
_viewer.getTable().setLayoutData(gd);
// text control - count
- _labelCount = new Label(parent, SWT.NONE);
+ _labelCount = new Label(content, SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalIndent = 2;
_labelCount.setLayoutData(gd);
@@ -177,24 +206,18 @@
DocumentCoordinator.getInstance().addListener(this);
_origPartname = getPartName();
+ updateStackLayout();
+
DocumentDnD.install(this);
}
- protected void onPaintTable(PaintEvent e) {
- String msg = null;
- if (!hasItem()) {
- String explorerName = PlatformUI.getWorkbench().getViewRegistry()
- .find(BrowseView.ID).getLabel();
- msg = "To display documents, double click a collection\nin "
- + explorerName + ".";
- } else if (getViewer().getTable().getItemCount() == 0) {
- msg = "No documents found";
+ protected void onOpenEXistExplorer() {
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().showView(BrowseView.ID);
+ } catch (PartInitException e) {
+ throw new RuntimeException(e);
}
-
- if (msg != null) {
- GC gc = e.gc;
- gc.drawText(msg, 4, 4);
- }
}
/**
@@ -284,6 +307,7 @@
protected void setItem(IBrowseItem item) {
setItemInternal(item);
createInput();
+ updateStackLayout();
}
protected boolean hasItem() {
@@ -418,4 +442,10 @@
_agOpenDocument = new ActionGroupOpenDocument(this);
_agDocumentExtension = new ActionGroupDocumentExtension(this);
}
+
+ private void updateStackLayout() {
+ ((StackLayout) _stack.getLayout()).topControl = (hasItem()) ? _content
+ : _infoLink;
+ _stack.layout();
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kri...@us...> - 2011-12-28 23:17:40
|
Revision: 15606
http://exist.svn.sourceforge.net/exist/?rev=15606&view=rev
Author: krizzdewizz
Date: 2011-12-28 23:17:31 +0000 (Wed, 28 Dec 2011)
Log Message:
-----------
changed function proposals file format to eXist built-in xqdoc xml format (util:extract-docs). enriched with function comments. exact open declaration position/navigation
Modified Paths:
--------------
trunk/eclipse_plugin/org.exist.eclipse.query/src/org/exist/eclipse/query/internal/xquery/completion/ExistXQueryMethod.java
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/resources/fn.functions
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/resources/op.functions
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/src/org/exist/eclipse/xquery/ui/completion/IXQueryMethod.java
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/src/org/exist/eclipse/xquery/ui/internal/completion/XQueryCompletionEngine.java
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/src/org/exist/eclipse/xquery/ui/internal/completion/XQueryCompletionProposalLabelProvider.java
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/src/org/exist/eclipse/xquery/ui/internal/completion/XQueryMethod.java
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/src/org/exist/eclipse/xquery/ui/internal/completion/XQueryMixinModel.java
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/src/org/exist/eclipse/xquery/ui/internal/selection/XQuerySelectionEngine.java
Added Paths:
-----------
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/resources/functions_info.txt
trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/src/org/exist/eclipse/xquery/ui/internal/completion/LibDocument.java
Modified: trunk/eclipse_plugin/org.exist.eclipse.query/src/org/exist/eclipse/query/internal/xquery/completion/ExistXQueryMethod.java
===================================================================
--- trunk/eclipse_plugin/org.exist.eclipse.query/src/org/exist/eclipse/query/internal/xquery/completion/ExistXQueryMethod.java 2011-12-28 23:13:45 UTC (rev 15605)
+++ trunk/eclipse_plugin/org.exist.eclipse.query/src/org/exist/eclipse/query/internal/xquery/completion/ExistXQueryMethod.java 2011-12-28 23:17:31 UTC (rev 15606)
@@ -26,7 +26,8 @@
* Add the given <code>parameter</code> to the method.
*
* @param name
- * @param type empty for none
+ * @param type
+ * empty for none
*/
public void addParameter(String name, String type) {
_parameterNames.add(name);
@@ -49,4 +50,13 @@
return _name;
}
+
+ public String getComment() {
+ return "";
+ }
+
+ public String getSignature() {
+ return "";
+ }
+
}
Modified: trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/resources/fn.functions
===================================================================
--- trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/resources/fn.functions 2011-12-28 23:13:45 UTC (rev 15605)
+++ trunk/eclipse_plugin/org.exist.eclipse.xquery.ui/resources/fn.functions 2011-12-28 23:17:31 UTC (rev 15606)
@@ -1,151 +1,1889 @@
-fn:abs($arg as numeric?) as numeric?
-fn:adjust-date-to-timezone($arg as xs:date?) as xs:date?
-fn:adjust-date-to-timezone($arg as xs:date?) as xs:date?
-fn:adjust-date-to-timezone($arg as xs:date?, $timezone as xs:dayTimeDuration?) as xs:date?
-fn:adjust-dateTime-to-timezone($arg as xs:dateTime?) as xs:dateTime?
-fn:adjust-dateTime-to-timezone($arg as xs:dateTime?, $timezone as xs:dayTimeDuration?) as xs:dateTime?
-fn:adjust-time-to-timezone($arg as xs:time?) as xs:time?
-fn:adjust-time-to-timezone($arg as xs:time?, $timezone as xs:dayTimeDuration?) as xs:time?
-fn:avg($arg as xs:anyAtomicType*) as xs:anyAtomicType?
-fn:base-uri() as xs:anyURI?
-fn:base-uri($arg as node()?) as xs:anyURI?
-fn:boolean($arg as item()*) as xs:boolean
-fn:ceiling($arg as numeric?) as numeric?
-fn:codepoint-equal($comparand1 as xs:string?, $comparand2 as xs:string?) as xs:boolean?
-fn:codepoints-to-string($arg as xs:integer*) as xs:string
-fn:collection() as node()*
-fn:collection($arg as xs:string?) as node()*
-fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?) as xs:integer?
-fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?, $collation as xs:string) as xs:integer?
-fn:concat($arg1 as xs:anyAtomicType?, $arg2 as xs:anyAtomicType?, ...) as xs:string
-fn:contains($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
-fn:contains($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
-fn:count($arg as item()*) as xs:integer
-fn:current-date() as xs:date
-fn:current-dateTime() as xs:dateTime
-fn:current-time() as xs:time
-fn:data($arg as item()*) as xs:anyAtomicType*
-fn:dateTime($arg1 as xs:date?, $arg2 as xs:time?) as xs:dateTime?
-fn:day-from-date($arg as xs:date?) as xs:integer?
-fn:day-from-dateTime($arg as xs:dateTime?) as xs:integer?
-fn:days-from-duration($arg as xs:duration?) as xs:integer?
-fn:deep-equal($parameter1 as item()*, $parameter2 as item()*) as xs:boolean
-fn:deep-equal($parameter1 as item()*, $parameter2 as item()*, $collation as string) as xs:boolean
-fn:default-collation() as xs:string
-fn:distinct-values($arg as xs:anyAtomicType*) as xs:anyAtomicType*
-fn:distinct-values($arg as xs:anyAtomicType*, $collation as xs:string) as xs:anyAtomicType*
-fn:doc($uri as xs:string?) as document-node()?
-fn:doc-available($uri as xs:string?) as xs:boolean
-fn:document-uri($arg as node()?) as xs:anyURI?
-fn:empty($arg as item()*) as xs:boolean
-fn:encode-for-uri($uri-part as xs:string?) as xs:string
-fn:ends-with($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
-fn:ends-with($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
-fn:error() as none
-fn:error($error as xs:QName) as none
-fn:error($error as xs:QName?, $description as xs:string) as none
-fn:error($error as xs:QName?, $description as xs:string, $error-object as item()*) as none
-fn:escape-html-uri($uri as xs:string?) as xs:string
-fn:exactly-one($arg as item()*) as item()
-fn:exists($arg as item()*) as xs:boolean
-fn:false() as xs:boolean
-fn:floor($arg as numeric?) as numeric?
-fn:hours-from-dateTime($arg as xs:dateTime?) as xs:integer?
-fn:hours-from-duration($arg as xs:duration?) as xs:integer?
-fn:hours-from-time($arg as xs:time?) as xs:integer?
-fn:id($arg as xs:string*) as element()*
-fn:id($arg as xs:string*, $node as node()) as element()*
-fn:idref($arg as xs:string*) as node()*
-fn:idref($arg as xs:string*, $node as node()) as node()*
-fn:implicit-timezone() as xs:dayTimeDuration
-fn:in-scope-prefixes($element as element()) as xs:string*
-fn:index-of($seqParam as xs:anyAtomicType*, $srchParam as xs:anyAtomicType) as xs:integer*
-fn:index-of($seqParam as xs:anyAtomicType*, $srchParam as xs:anyAtomicType, $collation as xs:string) as xs:integer*
-fn:insert-before($target as item()*, $position as xs:integer, $inserts as item()*) as item()*
-fn:iri-to-uri($iri as xs:string?) as xs:string
-fn:lang($testlang as xs:string?) as xs:boolean
-fn:lang($testlang as xs:string?, $node as node()) as xs:boolean
-fn:last() as xs:integer
-fn:local-name() as xs:string
-fn:local-name($arg as node()?) as xs:string
-fn:local-name-from-QName($arg as xs:QName?) as xs:NCName?
-fn:lower-case($arg as xs:string?) as xs:string
-fn:matches($input as xs:string?, $pattern as xs:string) as xs:boolean
-fn:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean
-fn:max($arg as xs:anyAtomicType*) as xs:anyAtomicType?
-fn:max($arg as xs:anyAtomicType*, $collation as string) as xs:anyAtomicType?
-fn:min($arg as xs:anyAtomicType*) as xs:anyAtomicType?
-fn:min($arg as xs:anyAtomicType*, $collation as string) as xs:anyAtomicType?
-fn:minutes-from-dateTime($arg as xs:dateTime?) as xs:integer?
-fn:minutes-from-duration($arg as xs:duration?) as xs:integer?
-fn:minutes-from-time($arg as xs:time?) as xs:integer?
-fn:month-from-date($arg as xs:date?) as xs:integer?
-fn:month-from-dateTime($arg as xs:dateTime?) as xs:integer?
-fn:months-from-duration($arg as xs:duration?) as xs:integer?
-fn:name() as xs:string
-fn:name($arg as node()?) as xs:string
-fn:namespace-uri() as xs:anyURI
-fn:namespace-uri($arg as node()?) as xs:anyURI
-fn:namespace-uri-for-prefix($prefix as xs:string?, $element as element()) as xs:anyURI?
-fn:namespace-uri-from-QName($arg as xs:QName?) as xs:anyURI?
-fn:nilled($arg as node()?) as xs:boolean?
-fn:node-name($arg as node()?) as xs:QName?
-fn:normalize-space() as xs:string
-fn:normalize-space($arg as xs:string?) as xs:string
-fn:normalize-unicode($arg as xs:string?) as xs:string
-fn:normalize-unicode($arg as xs:string?, $normalizationForm as xs:string) as xs:string
-fn:not($arg as item()*) as xs:boolean
-fn:number() as xs:double
-fn:number($arg as xs:anyAtomicType?) as xs:double
-fn:one-or-more($arg as item()*) as item()+
-fn:position() as xs:integer
-fn:prefix-from-QName($arg as xs:QName?) as xs:NCName?
-fn:QName($paramURI as xs:string?, $paramQName as xs:string) as xs:QName
-fn:remove($target as item()*, $position as xs:integer) as item()*
-fn:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string
-fn:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string
-fn:resolve-QName($qname as xs:string?, $element as element()) as xs:QName?
-fn:resolve-uri($relative as xs:string?) as xs:anyURI?
-fn:resolve-uri($relative as xs:string?, $base as xs:string) as xs:anyURI?
-fn:reverse($arg as item()*) as item()*
-fn:root() as node()
-fn:root($arg as node()?) as node()?
-fn:round($arg as numeric?) as numeric?
-fn:round-half-to-even($arg as numeric?) as numeric?
-fn:round-half-to-even($arg as numeric?, $precision as xs:integer) as numeric?
-fn:seconds-from-dateTime($arg as xs:dateTime?) as xs:decimal?
-fn:seconds-from-duration($arg as xs:duration?) as xs:decimal?
-fn:seconds-from-time($arg as xs:time?) as xs:decimal?
-fn:starts-with($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
-fn:starts-with($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
-fn:static-base-uri() as xs:anyURI?
-fn:string() as xs:string
-fn:string($arg as item()?) as xs:string
-fn:string-join($arg1 as xs:string*, $arg2 as xs:string) as xs:string
-fn:string-length() as xs:integer
-fn:string-length($arg as xs:string?) as xs:integer
-fn:string-to-codepoints($arg as xs:string?) as xs:integer*
-fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double) as item()*
-fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double, $length as xs:double) as item()*
-fn:substring($sourceString as xs:string?, $startingLoc as xs:double) as xs:string
-fn:substring($sourceString as xs:string?, $startingLoc as xs:double, $length as xs:double) as xs:string
-fn:substring-after($arg1 as xs:string?, $arg2 as xs:string?) as xs:string
-fn:substring-after($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:string
-fn:substring-before($arg1 as xs:string?, $arg2 as xs:string?) as xs:string
-fn:substring-before($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:string
-fn:sum($arg as xs:anyAtomicType*) as xs:anyAtomicType
-fn:sum($arg as xs:anyAtomicType*, $zero as xs:anyAtomicType?) as xs:anyAtomicType?
-fn:timezone-from-date($arg as xs:date?) as xs:dayTimeDuration?
-fn:timezone-from-dateTime($arg as xs:dateTime?) as xs:dayTimeDuration?
-fn:timezone-from-time($arg as xs:time?) as xs:dayTimeDuration?
-fn:tokenize($input as xs:string?, $pattern as xs:string) as xs:string*
-fn:tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string*
-fn:trace($value as item()*, $label as xs:string) as item()*
-fn:translate($arg as xs:string?, $mapString as xs:string, $transString as xs:string) as xs:string
-fn:true() as xs:boolean
-fn:unordered($sourceSeq as item()*) as item()*
-fn:upper-case($arg as xs:string?) as xs:string
-fn:year-from-date($arg as xs:date?) as xs:integer?
-fn:year-from-dateTime($arg as xs:dateTime?) as xs:integer?
-fn:years-from-duration($arg as xs:duration?) as xs:integer?
-fn:zero-or-one($arg as item()*) as item()?
\ No newline at end of file
+<xqdoc xmlns="" rel="nofollow">http://www.xqdoc.org/1.0">
+ <control>
+ <date>2011-12-28T14:56:50.937+01:00</date>
+ <version>1.0</version>
+ </control>
+ <module type="library">
+ <uri>" rel="nofollow">http://www.w3.org/2005/xpath-functions</uri>
+ <name/>
+ <comment>
+ <description>A module with the XQuery/XPath Core Library Functions</description>
+ <since>&lt; eXist-1.0</since>
+ </comment>
+ </module>
+ <functions>
+ <function>
+ <comment>
+ <description>Returns the absolute value of the argument $number. If the argument is negative returns -$number otherwise returns $number.</description>
+ <param>$number The number</param>
+ <return>the absolute value of the argument</return>
+ </comment>
+ <name>abs</name>
+ <signature>abs($number as numeric?) numeric</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Adjusts the xs:date value $date to the implicit timezone of the current locale.</description>
+ <param>$date The date</param>
+ <return>the adjusted date</return>
+ </comment>
+ <name>adjust-date-to-timezone</name>
+ <signature>adjust-date-to-timezone($date as xs:date?) xs:date?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Adjusts the xs:date value $date to a specific timezone, or to no timezone at all. If $duration is the empty sequence, returns an xs:date without a timezone.</description>
+ <param>$date The date</param>
+ <param>$duration The duration</param>
+ <return>the adjusted date</return>
+ </comment>
+ <name>adjust-date-to-timezone</name>
+ <signature>adjust-date-to-timezone($date as xs:date?, $duration as xdt:dayTimeDuration?) xs:date?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Adjusts the xs:dateTime value $date-time to the implicit timezone of the current locale.</description>
+ <param>$date-time The date-time</param>
+ <return>the adjusted date-time</return>
+ </comment>
+ <name>adjust-dateTime-to-timezone</name>
+ <signature>adjust-dateTime-to-timezone($date-time as xs:dateTime?) xs:dateTime?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Adjusts the xs:dateTime value $date-time to a specific timezone, or to no timezone at all. If $duration is the empty sequence, returns an xs:dateTime without a timezone.</description>
+ <param>$date-time The date-time</param>
+ <param>$duration The duration</param>
+ <return>the adjusted date-time</return>
+ </comment>
+ <name>adjust-dateTime-to-timezone</name>
+ <signature>adjust-dateTime-to-timezone($date-time as xs:dateTime?, $duration as xdt:dayTimeDuration?) xs:dateTime?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Adjusts the xs:time value $time to the implicit timezone of the current locale.</description>
+ <param>$time The time</param>
+ <return>the adjusted time</return>
+ </comment>
+ <name>adjust-time-to-timezone</name>
+ <signature>adjust-time-to-timezone($time as xs:time?) xs:time?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Adjusts the xs:time value $time to a specific timezone, or to no timezone at all. If $duration is the empty sequence, returns an xs:time without a timezone.</description>
+ <param>$time The time</param>
+ <param>$duration The duration</param>
+ <return>the adjusted time</return>
+ </comment>
+ <name>adjust-time-to-timezone</name>
+ <signature>adjust-time-to-timezone($time as xs:time?, $duration as xdt:dayTimeDuration?) xs:time?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the average of the values in the input sequence $values, that is, the sum of the values divided by the number of values.</description>
+ <param>$values The values</param>
+ <return>the average of the values in the input sequence</return>
+ </comment>
+ <name>avg</name>
+ <signature>avg($values as xdt:anyAtomicType*) xdt:anyAtomicType?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the value of the base URI property for $uri. If $uri is the empty sequence, the empty sequence is returned.</description>
+ <param>$uri The URI</param>
+ <return>the base URI from $uri</return>
+ </comment>
+ <name>base-uri</name>
+ <signature>base-uri($uri as node()?) xs:anyURI?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the value of the base URI property for the context item.</description>
+ <param>$a</param>
+ <return>the base URI from the context item</return>
+ </comment>
+ <name>base-uri</name>
+ <signature>base-uri() xs:anyURI?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Computes the xs:boolean value of the sequence $items.</description>
+ <param>$items The items</param>
+ <return>the boolean value, ebv, of the items</return>
+ </comment>
+ <name>boolean</name>
+ <signature>boolean($items as item()*) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns a value of the same type as the argument. Specifically, returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of the argument, $number.</description>
+ <param>$number The number</param>
+ <return>the non-fractional number not less than $number</return>
+ </comment>
+ <name>ceiling</name>
+ <signature>ceiling($number as numeric?) numeric</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns true or false depending on whether the value of $string-1 is equal to the value of $string-2, according to the Unicode code point collation.</description>
+ <param>$string-1 The first string</param>
+ <param>$string-2 The second string</param>
+ <return>true() if the codepoints are equal, false() otherwise</return>
+ </comment>
+ <name>codepoint-equal</name>
+ <signature>codepoint-equal($string-1 as xs:string?, $string-2 as xs:string?) xs:boolean?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Creates an xs:string from a sequence of code points. Returns the zero-length string if $codepoints is the empty sequence. If any of the code points in $codepoints is not a legal XML character, an error is raised</description>
+ <param>$codepoints The codepoints as a sequence of xs:integer values</param>
+ <return>the string constructed from the codepoints if valid</return>
+ </comment>
+ <name>codepoints-to-string</name>
+ <signature>codepoints-to-string($codepoints as xs:integer*) xs:string</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the documents contained in the collections specified in the input sequence. Collection URIs can be specified either as a simple collection path or an XMLDB URI. Documents contained in subcollections are also included.</description>
+ <param>$collection-uris The collection-uris for which to include the documents</param>
+ <param>overloaded</param>
+ <return>the document nodes contained in or under the given collections</return>
+ </comment>
+ <name>collection</name>
+ <signature>collection($collection-uris as xs:string*, ...) node()*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the collatable comparison between $string-1 and $string-2, -1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned. Please remember to specify the collation in the context or use the three argument version if you don't want the system default.</description>
+ <param>$string-1 The first string</param>
+ <param>$string-2 The second string</param>
+ <return>-1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned.</return>
+ </comment>
+ <name>compare</name>
+ <signature>compare($string-1 as xs:string?, $string-2 as xs:string?) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the collatable comparison using $collation-uri between $string-1 and $string-2, -1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned. The third argument $collation-uri is relative so you only need to specify the last part of a valid full collation-uri, e.g. '?lang=sv-SE', 'lang=sv-SE;strength=primary;decomposition=standard' or 'swedish'.</description>
+ <param>$string-1 The first string</param>
+ <param>$string-2 The second string</param>
+ <param>$collation-uri The relative collation URI</param>
+ <return>-1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned.</return>
+ </comment>
+ <name>compare</name>
+ <signature>compare($string-1 as xs:string?, $string-2 as xs:string?, $collation-uri as xs:string) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Accepts two or more xdt:anyAtomicType arguments, $atomizable-values, and converts them to xs:string. Returns the xs:string that is the concatenation of the values of its arguments after conversion. If any of the arguments is the empty sequence, the argument is treated as the zero-length string.</description>
+ <param>$atomizable-values The atomizable values</param>
+ <param>overloaded</param>
+ <return>the concatenated values</return>
+ </comment>
+ <name>concat</name>
+ <signature>concat($atomizable-values as xdt:anyAtomicType?, ...) xs:string?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns an xs:boolean indicating whether or not the value of $source-string contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $substring, according to the default collation.</description>
+ <param>$source-string The source-string</param>
+ <param>$substring The substring</param>
+ <return>true() if $source-string contains $substring, false() otherwise</return>
+ </comment>
+ <name>contains</name>
+ <signature>contains($source-string as xs:string?, $substring as xs:string?) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns an xs:boolean indicating whether or not the value of $source-string contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $substring, according to the collation that is specified in $collation-uri.The third argument $collation-uri is relative so you only need to specify the last part of a valid full collation-uri, e.g. '?lang=sv-SE', 'lang=sv-SE;strength=primary;decomposition=standard' or 'swedish'.</description>
+ <param>$source-string The source-string</param>
+ <param>$substring The substring</param>
+ <param>$collation-uri The collation URI</param>
+ <return>true() if $source-string contains $substring, false() otherwise</return>
+ </comment>
+ <name>contains</name>
+ <signature>contains($source-string as xs:string?, $substring as xs:string?, $collation-uri as xs:string) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the number of items in the argument sequence, $items.</description>
+ <param>$items The items</param>
+ <return>the number of items in the argument sequence</return>
+ </comment>
+ <name>count</name>
+ <signature>count($items as item()*) xs:integer</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed.</description>
+ <param>$a</param>
+ <return>the date current within the query execution time span</return>
+ </comment>
+ <name>current-date</name>
+ <signature>current-date() xs:date</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the xs:dateTime (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed.</description>
+ <param>$a</param>
+ <return>the date-time current within query execution time span</return>
+ </comment>
+ <name>current-dateTime</name>
+ <signature>current-dateTime() xs:dateTime</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the xs:time (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-time() is executed.</description>
+ <param>$a</param>
+ <return>the time current within query execution time span</return>
+ </comment>
+ <name>current-time</name>
+ <signature>current-time() xs:time</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the sequence of atomic values from the items in $items.</description>
+ <param>$items The items</param>
+ <return>the atomic values of the items in $items</return>
+ </comment>
+ <name>data</name>
+ <signature>data($items as item()*) xdt:anyAtomicType*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Creates an xs:dateTime from an xs:date, $date, and an xs:time, $time.</description>
+ <param>$date The date as xs:date</param>
+ <param>$time The time as xs:time</param>
+ <return>the combined date and time as xs:dateTime</return>
+ </comment>
+ <name>dateTime</name>
+ <signature>dateTime($date as xs:date?, $time as xs:time?) xs:dateTime?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $date.</description>
+ <param>$date The date as xs:date</param>
+ <return>the day component from $date</return>
+ </comment>
+ <name>day-from-date</name>
+ <signature>day-from-date($date as xs:date?) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $date-time.</description>
+ <param>$date-time The date-time as xs:dateTime</param>
+ <return>the day component from $date-time</return>
+ </comment>
+ <name>day-from-dateTime</name>
+ <signature>day-from-dateTime($date-time as xs:dateTime?) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns an xs:integer representing the days component in the canonical lexical representation of the value of $duration. The result may be negative.</description>
+ <param>$duration The duration as xs:dayTimeDuration</param>
+ <return>the days component of $duration</return>
+ </comment>
+ <name>days-from-duration</name>
+ <signature>days-from-duration($duration as xdt:dayTimeDuration?) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns true iff every item in $items-1 is deep-equal to the item at the same position in $items-2, false otherwise. If both $items-1 and $items-2 are the empty sequence, returns true(). </description>
+ <param>$items-1 The first item sequence</param>
+ <param>$items-2 The second item sequence</param>
+ <return>true() if the sequences are deep-equal, false() otherwise</return>
+ </comment>
+ <name>deep-equal</name>
+ <signature>deep-equal($items-1 as item()*, $items-2 as item()*) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns true iff every item in $items-1 is deep-equal to the item at the same position in $items-2, false otherwise. If both $items-1 and $items-2 are the empty sequence, returns true(). Comparison collation is specified by $collation-uri. The third argument $collation-uri is relative so you only need to specify the last part of a valid full collation-uri, e.g. '?lang=sv-SE', 'lang=sv-SE;strength=primary;decomposition=standard' or 'swedish'.</description>
+ <param>$items-1 The first item sequence</param>
+ <param>$items-2 The second item sequence</param>
+ <param>$collation-uri The collation URI</param>
+ <return>true() if the sequences are deep-equal, false() otherwise</return>
+ </comment>
+ <name>deep-equal</name>
+ <signature>deep-equal($items-1 as item()*, $items-2 as item()*, $collation-uri as xs:string) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the context's default collation. E.g. " rel="nofollow">http://www.w3.org/2005/xpath-functions/collation/codepoint.</description>
+ <param>$a</param>
+ <return>the default collation from the context</return>
+ </comment>
+ <name>default-collation</name>
+ <signature>default-collation() xs:string</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns a sequence where duplicate values of $atomic-values, based on value equality, have been deleted.</description>
+ <param>$atomic-values The atomic values</param>
+ <return>the distinct values sequence</return>
+ </comment>
+ <name>distinct-values</name>
+ <signature>distinct-values($atomic-values as xdt:anyAtomicType*) xdt:anyAtomicType*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns a sequence where duplicate values of $atomic-values, based on value equality specified by collation $collation-uri, have been deleted.</description>
+ <param>$atomic-values The atomic values</param>
+ <param>$collation-uri The collation URI</param>
+ <return>the distinct values sequence</return>
+ </comment>
+ <name>distinct-values</name>
+ <signature>distinct-values($atomic-values as xdt:anyAtomicType*, $collation-uri as xs:string) xdt:anyAtomicType*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the document node of $document-uri. Resource URIs can be specified either as a simple collection path, an XMLDB URI or any URI.</description>
+ <param>$document-uri The document URI</param>
+ <return>the document node of $document-uri</return>
+ </comment>
+ <name>doc</name>
+ <signature>doc($document-uri as xs:string?) node()?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns whether or not the document, $document-uri, specified in the input sequence is available. Resource URIs can be specified either as a simple collection path, an XMLDB URI or any URI.</description>
+ <param>$document-uri The document URI</param>
+ <return>true() if the document is available, false() otherwise</return>
+ </comment>
+ <name>doc-available</name>
+ <signature>doc-available($document-uri as xs:string?) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the document nodes of the documents based on the DOCTYPE.</description>
+ <param>$doctype one or more DOCTYPE names</param>
+ <return>the document nodes matching the DOCTYPE names</return>
+ <deprecated>This function is eXist-specific and deprecated. It should not be in the standard functions namespace. Please use util:doctype() instead.
+This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.</deprecated>
+ </comment>
+ <name>doctype</name>
+ <signature>doctype($doctype as xs:string+) node()*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the documents specified in the input sequence. This function is specific to eXist and will be replaced with the corresponding fn:doc function. Collection URIs can be specified either as a simple collection path or an XMLDB URI. If the input sequence is empty, the function will load all documents in the database.</description>
+ <param>$document-uris The document URIs</param>
+ <param>overloaded</param>
+ <return>the documents</return>
+ <deprecated>Moved to the 'http://exist-db.org/xquery/xmldb' namespace since it conflicts with the XSLT 2.0 function.
+This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.</deprecated>
+ </comment>
+ <name>document</name>
+ <signature>document($document-uris as xs:string+, ...) node()*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the absolute URI of the resource from which the document node $document-node was constructed, if none such URI exists returns the empty sequence. If $document-node is the empty sequence, returns the empty sequence.</description>
+ <param>$document-node The document node</param>
+ <return>the document URI of $document-node</return>
+ </comment>
+ <name>document-uri</name>
+ <signature>document-uri($document-node as node()?) xs:anyURI?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns true() if the value of $items is the empty sequence, false() otherwise.</description>
+ <param>$items The item sequence</param>
+ <return>true() if the empty sequence, false() otherwise</return>
+ </comment>
+ <name>empty</name>
+ <signature>empty($items as item()*) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Escapes reserved characters in $uri-part by replacing it with its percent-encoded form as described in [RFC 3986]. If $uri-part is the empty sequence, returns the zero-length string.</description>
+ <param>$uri-part The URI part to encode</param>
+ <return>the URI part with reserved characters percent encoded</return>
+ </comment>
+ <name>encode-for-uri</name>
+ <signature>encode-for-uri($uri-part as xs:string?) xs:string</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns true if the string value of $suffix is a suffix of the string value of $source-string, false otherwise. If either $source-string or $suffix is the empty sequence, the empty sequence is returned.</description>
+ <param>$source-string The source-string</param>
+ <param>$suffix The suffix</param>
+ <return>true() if $suffix is suffix of $source-string, false() otherwise</return>
+ </comment>
+ <name>ends-with</name>
+ <signature>ends-with($source-string as xs:string?, $suffix as xs:string?) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns true if the string value of $suffix is a suffix of the string value of $source-string using collation $collation-uri, false otherwise. If either $source-string or $suffix is the empty sequence, the empty sequence is returned. The third argument $collation-uri is relative so you only need to specify the last part of a valid full collation-uri, e.g. '?lang=sv-SE', 'lang=sv-SE;strength=primary;decomposition=standard' or 'swedish'.</description>
+ <param>$source-string The source-string</param>
+ <param>$suffix The suffix</param>
+ <param>$collation-uri The collation URI</param>
+ <return>true() if $suffix is suffix of $source-string, false() otherwise</return>
+ </comment>
+ <name>ends-with</name>
+ <signature>ends-with($source-string as xs:string?, $suffix as xs:string?, $collation-uri as xs:string) xs:boolean?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception using $qname and the default message, 'An error has been raised by the query'.</description>
+ <param>$qname The qname</param>
+ </comment>
+ <name>error</name>
+ <signature>error($qname as xs:QName) empty()</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception using $qname and $message.</description>
+ <param>$qname The qname</param>
+ <param>$message The message</param>
+ </comment>
+ <name>error</name>
+ <signature>error($qname as xs:QName?, $message as xs:string) empty()</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception using $qname and $message with $error-object appended.</description>
+ <param>$qname The qname</param>
+ <param>$message The message</param>
+ <param>$error-object The error object</param>
+ </comment>
+ <name>error</name>
+ <signature>error($qname as xs:QName?, $message as xs:string, $error-object as item()*) empty()</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Indicates that an irrecoverable error has occurred. The script will terminate immediately with an exception using the default qname, 'http://www.w3.org/2004/07/xqt-errors#err:FOER0000', and the default error message, 'An error has been raised by the query'.</description>
+ <param>$a</param>
+ </comment>
+ <name>error</name>
+ <signature>error() empty()</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Replaces all nonprintable ASCII characters in the string value of $html-uri by an escape sequence represented as a hexadecimal octet in the form %XX. If $html-uri is the empty sequence, returns the zero-length string.</description>
+ <param>$html-uri The html URI</param>
+ <return>all nonprintable ASCII characters in $html-uri encoded by escape sequences</return>
+ </comment>
+ <name>escape-html-uri</name>
+ <signature>escape-html-uri($html-uri as xs:string?) xs:string</signature>
+ </function>
+ <function>
+ <comment>
+ <description>This function applies the URI escaping rules defined in section 2 of [RFC 2396] as amended by [RFC 2732], with one exception, to the string supplied as $uri, which typically represents all or part of a URI. The effect of the function is to escape a set of identified characters in the string. Each such character is replaced in the string by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. $escape-reserved indicates whether to escape reserved characters.</description>
+ <param>$uri The URI</param>
+ <param>$escape-reserved The escaped-reserved</param>
+ <return>the identified characters in $uri encoded with escape sequences</return>
+ </comment>
+ <name>escape-uri</name>
+ <signature>escape-uri($uri as xs:string?, $escape-reserved as xs:boolean) xs:string</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the argument sequence, $items, if it contains exactly one item. Otherwise, raises an error.</description>
+ <param>$items The item sequence</param>
+ <return>the sole item in $items if it contains exactly one item. Otherwise, an error is raised.</return>
+ </comment>
+ <name>exactly-one</name>
+ <signature>exactly-one($items as item()*) item()</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns true if the argument $items is not the empty sequence, false otherwise.</description>
+ <param>$items The item sequence</param>
+ <return>true() if not the empty-sequence, false() otherwise</return>
+ </comment>
+ <name>exists</name>
+ <signature>exists($items as item()*) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Always returns the boolean value false</description>
+ <param>$a</param>
+ <return>false</return>
+ </comment>
+ <name>false</name>
+ <signature>false() xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the largets number not greater than the value of $number. If $number is the empty sequence, returns the empty sequence.</description>
+ <param>$number The number</param>
+ <return>the largets number without fraction part not greater than the value of $number</return>
+ </comment>
+ <name>floor</name>
+ <signature>floor($number as numeric*) numeric</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $date-time.</description>
+ <param>$date-time The date-time as xs:dateTime</param>
+ <return>the hours component from $date-time</return>
+ </comment>
+ <name>hours-from-dateTime</name>
+ <signature>hours-from-dateTime($date-time as xs:dateTime?) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns an xs:integer representing the hours component in the canonical lexical representation of the value of $duration. The result may be negative.</description>
+ <param>$duration The duration as xs:dayTimeDuration</param>
+ <return>the hours component of $duration</return>
+ </comment>
+ <name>hours-from-duration</name>
+ <signature>hours-from-duration($duration as xdt:dayTimeDuration?) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $time.</description>
+ <param>$time The time as xs:time</param>
+ <return>the hours component from $time</return>
+ </comment>
+ <name>hours-from-time</name>
+ <signature>hours-from-time($time as xs:time?) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $idrefs. If none is matching or $idrefs is the empty sequence, returns the empty sequence.</description>
+ <param>$idrefs The IDREF sequence</param>
+ <return>the elements with IDs matching IDREFs from $idref-sequence</return>
+ </comment>
+ <name>id</name>
+ <signature>id($idrefs as xs:string*) element()*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $idrefs and is in the same document as $node-in-document. If none is matching or $idrefs is the empty sequence, returns the empty sequence.</description>
+ <param>$idrefs The IDREF sequence</param>
+ <param>$node-in-document The node in document</param>
+ <return>the elements with IDs matching IDREFs from $idrefs in the same document as $node-in-document</return>
+ </comment>
+ <name>id</name>
+ <signature>id($idrefs as xs:string*, $node-in-document as node()) element()*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the sequence of element or attributes nodes with an IDREF value matching the value of one or more of the ID values supplied in $ids. If none is matching or $ids is the empty sequence, returns the empty sequence.</description>
+ <param>$ids The ID sequence</param>
+ <return>the elements with matching IDREF values from IDs in $ids</return>
+ </comment>
+ <name>idref</name>
+ <signature>idref($ids as xs:string*) node()*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the sequence of element or attributes nodes with an IDREF value matching the value of one or more of the ID values supplied in $ids. If none is matching or $ids is the empty sequence, returns the empty sequence.</description>
+ <param>$ids The ID sequence</param>
+ <param>$node-in-document The node in document</param>
+ <return>the elements with matching IDREF values from IDs in $ids in the same document as $node-in-document</return>
+ </comment>
+ <name>idref</name>
+ <signature>idref($ids as xs:string*, $node-in-document as node()) node()*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the value of the implicit timezone property from the dynamic context.</description>
+ <param>$a</param>
+ <return>the implicit timezone daytime-duration from the dynamic context</return>
+ </comment>
+ <name>implicit-timezone</name>
+ <signature>implicit-timezone() xdt:dayTimeDuration</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string.</description>
+ <param>$element The element</param>
+ <return>the prefixes</return>
+ </comment>
+ <name>in-scope-prefixes</name>
+ <signature>in-scope-prefixes($element as element()) xs:string*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns a sequence of positive integers giving the positions within the sequence of atomic values $source that are equal to $search.
+
+The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. The collation is used when string comparison is required.
+
+The items in the sequence $source are compared with $search under the rules for the 'eq' operator. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the 'eq' operator is not defined for their types, are considered to be distinct. If an item compares equal, then the position of that item in the sequence $source is included in the result.
+
+If the value of $source is the empty sequence, or if no item in $source matches $search, then the empty sequence is returned.
+
+The first item in a sequence is at position 1, not position 0.
+
+The result sequence is in ascending numeric order.</description>
+ <param>$source The source sequence</param>
+ <param>$search The search component</param>
+ <return>the sequence of positive integers giving the positions within the sequence</return>
+ </comment>
+ <name>index-of</name>
+ <signature>index-of($source as xdt:anyAtomicType*, $search as xdt:anyAtomicType) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns a sequence of positive integers giving the positions within the sequence of atomic values $source that are equal to $search.
+
+The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. The collation is used when string comparison is required.
+
+The items in the sequence $source are compared with $search under the rules for the 'eq' operator. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the 'eq' operator is not defined for their types, are considered to be distinct. If an item compares equal, then the position of that item in the sequence $source is included in the result.
+
+If the value of $source is the empty sequence, or if no item in $source matches $search, then the empty sequence is returned.
+
+The first item in a sequence is at position 1, not position 0.
+
+The result sequence is in ascending numeric order. The third argument $collation-uri is relative so you only need to specify the last part of a valid full collation-uri, e.g. '?lang=sv-SE', 'lang=sv-SE;strength=primary;decomposition=standard' or 'swedish'.</description>
+ <param>$source The source sequence</param>
+ <param>$search The search component</param>
+ <param>$collation-uri The collation URI</param>
+ <return>the sequence of positive integers giving the positions within the sequence</return>
+ </comment>
+ <name>index-of</name>
+ <signature>index-of($source as xdt:anyAtomicType*, $search as xdt:anyAtomicType, $collation-uri as xs:string) xs:integer?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns a new sequence constructed from the value of $target with the value of $inserts inserted at the position specified by the value of $position. (The value of $target is not affected by the sequence construction.)
+
+If $target is the empty sequence, $inserts is returned. If $inserts is the empty sequence, $target is returned.
+
+The value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $inserts, followed by the remaining elements of $target, in that sequence.
+
+If $position is less than one (1), the first position, the effective value of $position is one (1). If $position is greater than the number of items in $target, then the effective value of $position is equal to the number of items in $target plus 1.</description>
+ <param>$target The target</param>
+ <param>$position The position to insert before</param>
+ <param>$inserts The data to insert</param>
+ <return>the new sequence</return>
+ </comment>
+ <name>insert-before</name>
+ <signature>insert-before($target as item()*, $position as xs:integer, $inserts as item()*) item()*</signature>
+ </function>
+ <function>
+ <comment>
+ <description>This function converts an xs:string containing an IRI into a URI according to the rules spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.
+
+If $iri contains a character that is invalid in an IRI, such as the space character (see note below), the invalid character is replaced by its percent-encoded form as described in [RFC 3986] before the conversion is performed.
+
+If $iri is the empty sequence, returns the zero-length string.
+
+Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings, this function must always generate hexadecimal values using the upper-case letters A-F.
+
+Notes:
+
+This function does not check whether $iri is a legal IRI. It treats it as an xs:string and operates on the characters in the xs:string.
+
+The following printable ASCII characters are invalid in an IRI: "<", ">", " " " (double quote), space, "{", "}", "|", "\", "^", and "`". Since these characters should not appear in an IRI, if they do appear in $iri they will be percent-encoded. In addition, characters outside the range x20-x126 will be percent-encoded because they are invalid in a URI.
+
+Since this function does not escape the PERCENT SIGN "%" and this character is not allowed in data within a URI, users wishing to convert character strings, such as file names, that include "%" to a URI should manually escape "%" by replacing it with "%25".</description>
+ <param>$iri The IRI</param>
+ <return>the URI</return>
+ </comment>
+ <name>iri-to-uri</name>
+ <signature>iri-to-uri($iri as xs:string?) xs:string</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Returns the item in $source that is located at the position specified by $index.</description>
+ <param>$source The source sequence</param>
+ <param>$index The index of the item in the source sequence to return</param>
+ <return>the item</return>
+ <deprecated>This function is eXist-specific and deprecated. It should not be in the standard functions namespace. Use e.g. $x[1] instead.
+This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.</deprecated>
+ </comment>
+ <name>item-at</name>
+ <signature>item-at($source as item()*, $index as xs:integer) item()?</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Tests whether the language of the context item as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $lang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false().
+
+The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+
+If $lang is the empty sequence it is interpreted as the zero-length string.</description>
+ <param>$lang The language code</param>
+ <return>true if the language code matches, false otherwise</return>
+ </comment>
+ <name>lang</name>
+ <signature>lang($lang as xs:string?) xs:boolean</signature>
+ </function>
+ <function>
+ <comment>
+ <description>Tests whether the language of $node as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $lang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false().
+
+The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+
+If $lang is the empty sequence it is interpreted as the zero-length string.</description>
+ <param>$lang The language code</param>
+ <param>$node The node</param>
+ <return>true if the language code matches, false otherwise</return>
+ </comment>
+ <name>lang</name>
+ <signature>lang($lang as xs:string?, $n...
[truncated message content] |