Integrating Eclipse

From BaseX Documentation

Jump to: navigation, search

This article is part of the Getting Started Section. It describes how to run XPath/XQuery code from within the Eclipse IDE.

Another article describes how to compile and run BaseX with Eclipse.

Contents

[edit] Installation

The following steps apply to all operating systems:

[edit] Windows

It should be sufficient to install the official XQuery Development Tools Plugin (XQDT): http://www.xqdt.org/
Update Site: http://download.eclipse.org/webtools/incubator/repository/xquery/milestones/

[edit] Linux

[edit] Mac OSX

[edit] Setting up

Use BaseX as query processor in Eclipse

You can set up the XQuery interpreter as standalone or client version, as shown on the screenshot:

[edit] Setting up as Standalone

  1. Start Eclipse and go to PreferencesXQueryInterpreters.
  2. Add a new Interpreter with the Add button.
  3. Enter "BaseX" as name and choose "Java XQuery Engine" as Interpreter type.
  4. Point Interpreter JAR/WAR to the BaseX JAR archive
  5. Choose org.basex.BaseX as Main class

[edit] Setting up as Client

  1. Start Eclipse and go to PreferencesXQueryInterpreters.
  2. Add a new Interpreter with the Add button.
  3. Enter "BaseX" as name and choose "Java XQuery Engine" as Interpreter type.
  4. Point Interpreter JAR/WAR to the BaseX JAR archive
  5. Choose org.basex.BaseXClient as Main class
  6. Set interpreter arguments for your server, port, username and password, e.g. -Uadmin -Padmin -nlocalhost -p1984.

[edit] Usage

The query execution works as follows:

  1. Create a new XQuery Project with FileNewXQuery Project.
  2. Add a new XQuery Module with FileNewXQuery Module.
  3. Edit your XQuery Module and execute it with Run.
  4. The results are displayed in the Console window of Eclipse.
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export