exist open source native xml database praktische hinweise

10
eXist Open Source Native XML Database Praktische Hinweise

Upload: wilda-dorst

Post on 05-Apr-2015

103 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EXist Open Source Native XML Database Praktische Hinweise

eXist Open Source Native XML

DatabasePraktische Hinweise

Page 2: EXist Open Source Native XML Database Praktische Hinweise

Editor

• oXygen XML Editor (!)– Direktes erstellen von XML, XSLT und XQuery

Dokumenten in der Datenbank über die WebDAV Schnittstelle

– Komfortables Syntaxhighlighting– XQuery + XSLT Debugger

• Java Admin Tool• Exist Plugin

Page 3: EXist Open Source Native XML Database Praktische Hinweise

Basiskonfiguration (für Webanwendungen in der Datenbank)

• $EXIST_HOME/webapp/WEB-INF/controller-config.xml(1)<!-- ++ Default configuration: main web application is served from the +

+ webapp directory. --> <root pattern="/tools" path="xmldb:exist:///db/www"/><root pattern=".*" path="/"/> (2)<!-- ++ The following configuration assumes that the main webapp

++ is stored in the database. However, the contents of the /webapp directory ++ should still be accessible with a /fs prefix in the path. -->

<root pattern="/fs" path="/"/> <root pattern=".*" path="xmldb:exist:///db/www"/>

Konfiguration (2) verwenden!

Page 4: EXist Open Source Native XML Database Praktische Hinweise

Basiskonfiguration (für Webanwendungen in der Datenbank)

• Eine Datei „controller.xql“ in die Datenbank speichern unterhalb von

xmldb:exist:///db/www

• Sorgt für das Handling der ein- und ausgehenden Requests

Page 5: EXist Open Source Native XML Database Praktische Hinweise

Basiskonfiguration (für Webanwendungen in der Datenbank)

xquery version "1.0";

(: root path: redirect to test.xql :)if ($exist:path eq '/') then <dispatch xmlns="http://exist.sourceforge.net/NS/exist">

<redirect url="test.xql"/></dispatch>else (: everything else is passed through :) <ignore xmlns="http://exist.sourceforge.net/NS/exist">

<cache-control cache="yes"/> </ignore>

Page 6: EXist Open Source Native XML Database Praktische Hinweise

Nähere Informationen zur Konfiguration von Webanwendungen

http://exist-db.org/urlrewrite.html

Page 7: EXist Open Source Native XML Database Praktische Hinweise

eXist und XQuery

• XQuery ist im Kern eine Datenbankabfragesprache (wie SQL)– XPath– FLOWR Ausdrücke

• aber auch (!): nach der W3C Standard Spezifikation eine erweiterbare Sprache (ähnlich wie LUA)– Der Funktionsumfang von XQuery kann beliebig

durch Module erweitert werden– Das Binding geschieht über das Namespace Konzept– Dadurch kann XQuery andere Skriptsprachen wie

PHP oder JSP vollständig ersetzen

Page 9: EXist Open Source Native XML Database Praktische Hinweise

Besipielszenarien

• Eine Datenbankabfrage mit XPath

• Eine Datenbankabfrage mit dem „xmldb-Modul“

• Ein XML Dokument mittels XSLT nach HTML transformieren

• (Clientseitige Daten aus einem Formular auslesen und als XML in die Datenbank speichern)

Page 10: EXist Open Source Native XML Database Praktische Hinweise

jochen.graf(at)uni-koeln.de