XPath in oXygen

From Digital Scholarship Group
Jump to navigation Jump to search

oXygen's XPath

Creating a new working set

If you want to be able to run XPath queries across the entire WWO textbase, you will probably want to configure working sets in the oXygen's XPath toolbar. To do so:

  • Select the document dropdown in the XPath toolbar.

Xpath-toolbar.png

  • Click "Configure XPath Working Sets".

Xpath-toolbar-dropdown.png

  • Click "New working set".
  • Name your new working set something like "WWO" or "textbase", then hit enter.
  • With your set selected, click "Add resources".
  • Select "Folders" from the dropdown.
  • Navigate to and select the directory where the textbase lives.
    • You might find it more useful to select only the textbase directories which hold WWO texts ("distribution", "improvement", "on_deck", "under_construction"). This keeps you from seeing results taken from the schemas or from snippets of TEI used in XInclude instructions.
  • Click "Choose".
  • Make sure your working set has a check mark next to it.
  • Click "OK".
  • Done!

Using your working set

To use your new working set, select the document dropdown again. Notice that there's a list of items with checkboxes. The XPath toolbar will, by default, search the current XML document. Sure enough, you'll find that the "Current file" option is selected. To prepare for a textbase-wide XPath query, choose the "Working sets" option. This will enable you to run your XPath against the files in every working set you have checked off in the "Configure working sets" window.

Note that both of these modes - "Current file" and "Working sets" - are particularly useful for WWO search and exploration. If you get no results from a query against working sets, try reconstructing your XPath using "Current file" mode on a single text before trying again on the entire textbase.

Making the most out of working sets

Even if you don't do it now, remember that you can always make more working sets to fit your needs. Repeat the instructions above to create new working sets for the folders or files that you need to query. Then, before you run an XPath, make sure that only those working sets that you need are checked in the "Configure working sets" window.

As mentioned above, you may wish to preemptively exclude unimportant results by only using the WWO textbase folders with actual texts in them. For most people, this single working set (associated with three folders), may be sufficient. However, what if you want to run an XPath query on only the published texts? Or only on the texts under construction? One possibility is to create four separate working sets, each associated with one folder ("distribution", "improvement", "on_deck", "under_construction"). Running an XPath against only the "distribution" folder, for example, would be as easy as making sure only that working set was checked off in the configuration window. To run a full textbase search, they would simply select all four sets.

This example is overkill for most encoders. Just remember to make new working sets whenever you need to query new or specialized groups of files.