Jabber-mod_perl

 view release on metacpan or  search on metacpan

examples/MyStamp.pm  view on Meta::CPAN

  }
  xwarn "ELEMENT 1 (".$nad->nad_elem_name(1).") ATTRS: ".Dumper(\@attrs);
  return PASS unless $type eq "message";;
  my $el = $nad->find_elem(1,-1,"body",1);
  my $data = $nad->nad_cdata( $el );
  xwarn "Body element is: $el - $data";
  my $ns = $nad->find_scoped_namespace("http://jabber.org/protocol/xhtml-im","");
  xwarn "namespace is: $ns";
  xwarn "NAMESPACES: ".Dumper($nad->list_namespaces());
  my $elhtml = $nad->find_elem(1,$ns,"html",1) if $ns;
  xwarn "XHTML HTML element is: $elhtml";
  my $elx = $nad->find_elem($elhtml,-1,"body",1) if $elhtml;
  xwarn "BODY HTML element (no namespace) is: $elx";
  my $datax = $nad->nad_cdata( $elx ) if $elx;
  xwarn "Body xhtml element is: $elhtml/$elx - $datax" if $elx;
  #$nad->append_cdata_head($el, "some data or other");
  $nad->replace_cdata_head($el, "beginning... ($data/$el) ...some data or other") if $el > 0;
  $nad->replace_cdata_head($elx, "beginning... ($datax) ...some data or other") if $elx;

  # accumulate stats
  $cnt++;



( run in 1.368 second using v1.01-cache-2.11-cpan-49f99fa48dc )