NAME

XTM::Smile::SAX - AsTMa tag expansion

SYNOPSIS

use XTM::Smile::SAX;
my $expander = new XTM::Smile::SAX   (tmbase => 'file:/where/are/the/maps/');
my $parser   = find any SAX2 parser  (Handler => $expander);
$parser->parse_string($XML);

DESCRIPTION

This package scans the SAX event stream for tags in the namespace

http://topicmaps.bond.edu.au/astma/1.0/

and expands them into tags of the namespace

http://topicmaps.bond.edu.au/smile/1.0/

according to the description below.

Example:

<?xml ....
<some_document>
   ...
   <astma:default astma:tau_expr="file:w3o.atm"/>
   <astma:slide astma:tid="w3c-user-interface"/>
   ...
</some_document>

will consult the man I<file:w3o.atm> and will return

<?xml ....
<some_document>
   ...
   <smile:slide smile:tid='w3c-user-interface'>
      <smile:title>User Interface Activity</smile:title>
      <smile:types><smile:type>W3C Activity</smile:type></smile:types>
      <smile:inlines><smile:inline>HTML, CSS1/2, XSL-FO/XSLT, WAI, SVG, I18N</smile:inline></smile:inlines>
      <smile:instances>test1, test2, test3</smile:instances>
      <smile:references>
         <smile:reference href='http://www.w3c.org/' type='simple' />
         <smile:reference href='http://www.w3c2.org/' type='simple' />
         <smile:reference href='http://www.w3c3.org/' type='simple' />
      </smile:references>
   </smile:slide>
   ...
</some_document>

For a listing of incoming and outgoing elements, please refer to the documentation in the docs directory.

INTERFACE

Constructor

Following fields can be passed:

urlbase:

This controls the base URL which will be used to derive an absolute URL for the Topic Map to be loaded, in case the provided URL was relative.

tmbase:

The same for Topic Maps in the tm: space.

tau_expr:

An Topic Map expression as described in XTM::Virtual. The resulting map will be used as a default unless another map is provided via a astma:map attribute (see below)

default_format:

This format string will serve as default if (a) either no slide-wide format has been specified or (b) no slide-specific format can be found.

Methods

This filter captures following SAX events and propagates them to the next filter:

start_element
characters
end_element

AUTHOR INFORMATION

Copyright 2002, Robert Barta <rho@telecoma.net>, All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See

http://www.perl.com/perl/misc/Artistic.html