in reply to XML::Parser and white spaces
chocolateboy#!/usr/bin/perl -w use strict; use XML::Parser; use Hook::LexWrap; wrap XML::Parser::Tree::Char, pre => sub { # pre-empt Tree's Char handler unless # string is nonblank $_[-1] = 1 unless ($_[1] =~ /\S/); }; my $xml = $ARGV[0] || die "usage: mytree.pl file.xml"; my $parser = XML::Parser->new(Style => 'Tree'); my $tree = $parser->parsefile($xml);
|
|---|