X hits on this document

370 views

0 shares

1 downloads

0 comments

107 / 142

Indexing and searching XML with swish-e

8.

install ( sudo make install )

For best results, it is a good idea have previously installed the libxml2 family of C libraries. To install the Perl module you change to the Perl directory and enter the usual commands for installing modules:

  • 1.

    perl Makefile.PL

  • 2.

    make

  • 3.

    make test

  • 4.

    sudo make install

Installation on Windows is just as easy. Download the distribution, run the resulting .exe file, and the in- staller will do the rest. Be careful. It is a good idea to use the installer's defaults since applications using swish-e will need access to the necessary dynamically linked library (dll) files. These dll files need to be in your PATH environment variable. If you have previously installed Perl, the installer will install the modules as well as the swish-e application.

After installation, you will have local access to the voluminous documentation, not to mention the HTML-based documentation in the distribution's html directory:

  • swish-e -h

  • man swish-e

  • man SWISH-CONFIG

  • man SWISH-RUN

  • man SWISH-FAQ

  • man SWISH-LIBRARY

  • perldoc SWISH::API

Exercises

These exercises demonstrate how to create and search simple indexes of XML documents. The exercises build on earlier exercises in this workbook by using the data created in those exercises.

Indexing XHTML

Swish-e excels at indexing rich and well-structured HTML files. In a previous exercise sets of XHTML files were created from MARC records. They were saved in the xml-data/xhtml/marc2xhtml directory. Open any one of these files in your text editor and notice the structure of each of their head elements, such as this one (line have been hard-wrapped for readability):

<head>

<title>Biology, psychology, and medicine</title>

<meta name="id"

content="adler-biology-1072276585"/>

99

Document info
Document views370
Page views376
Page last viewedSat Dec 03 10:43:13 UTC 2016
Pages142
Paragraphs3126
Words34660

Comments