package III::MinimalTag;

use HTML::Embperl::Syntax qw{:types} ;
use HTML::Embperl::Syntax::HTML ;

# We inherit the generic HTML support from HTML::Embperl::Syntax::HTML
use vars qw(@ISA);
@ISA = qw(HTML::Embperl::Syntax::HTML) ;

sub new {
  my $class = shift;
  my $self = HTML::Embperl::Syntax::HTML::new($class);

  # initialise ourselves when an object is created if it hasn't
  # been done already
  if (!$self->{-randomInit}) {
    $self->{-randomInit} = 1;
    init($self);
  }
  return $self;
}

# initialise things and define our new syntax handling
sub init {
  my $self = shift;

  # redefine the tags we want to manipulate attributes for
  $self->AddTag('test', ['attribute'], undef, undef, {
      perlcode => q[ {
        # _ep_sa is an apparently undocumented function which
        # allows you to rewrite an attribute of the current node
        # specified by %$n%
        _ep_sa(%$n%, 'attribute', %&'attribute%);
      }],

  });
 
}

1;

