XML-XPathScript

 view release on metacpan or  search on metacpan

examples/docbook2latex.xps  view on Meta::CPAN

	my ($self, $t)=@_;

	my $numcols=findvalue('@cols',$self);

	my $title;
	if (findvalue('name(..)',$self) eq "table") {
		$title=apply_templates_under("../title",$self);
	};
	# So "defined($title)" is a valid test for "this is a formal table".

	my @styles=split m/,/,utf8tolatin1(findvalue('@tgroupstyle',$self));

	my @TeXspecs=map {&$typeset_tablecolumnpattern($_->{colspec},
												   "colspec",$self);
				  } _table_getcolspecs_onelevel($self);

	$TeXspecs[$#TeXspecs] =~ s/\|$//;

	$t->{pre}=join("",map {"\\".$_."{"} @styles)."\n";

	if ($fancytables) {

lib/XML/XPathScript/Stylesheet/DocBook2LaTeX.pm  view on Meta::CPAN

	my ($self, $t)=@_;

	my $numcols=findvalue('@cols',$self);

	my $title;
	if (findvalue('name(..)',$self) eq "table") {
		$title=apply_templates_under("../title",$self);
	};
	# So "defined($title)" is a valid test for "this is a formal table".

	my @styles=split m/,/,utf8tolatin1(findvalue('@tgroupstyle',$self));

	my @TeXspecs=map {&$typeset_tablecolumnpattern($_->{colspec},
												   "colspec",$self);
				  } _table_getcolspecs_onelevel($self);

	$TeXspecs[$#TeXspecs] =~ s/\|$//;

	$t->{pre}=join("",map {"\\".$_."{"} @styles)."\n";

	if ($fancytables) {

manual/DocBook2LaTeX.pm  view on Meta::CPAN

	my ($self, $t)=@_;

	my $numcols=findvalue('@cols',$self);

	my $title;
	if (findvalue('name(..)',$self) eq "table") {
		$title=apply_templates_under("../title",$self);
	};
	# So "defined($title)" is a valid test for "this is a formal table".

	my @styles=split m/,/,utf8tolatin1(findvalue('@tgroupstyle',$self));

	my @TeXspecs=map {&$typeset_tablecolumnpattern($_->{colspec},
												   "colspec",$self);
				  } _table_getcolspecs_onelevel($self);

	$TeXspecs[$#TeXspecs] =~ s/\|$//;

	$t->{pre}=join("",map {"\\".$_."{"} @styles)."\n";

	if ($fancytables) {

t/19namespace.t  view on Meta::CPAN

my $result = $xps->transform( <<'NAMESPACED_XML', $noop_stylesheet);
<rss xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wp="http://wordpress.org/export/1.2/" version="2.0">
    <channel>
     <title>Geography Channel</title>
     <wp:wxr_version>1.2</wp:wxr_version>
    </channel>
</rss>
NAMESPACED_XML

my ($rss_attributes) = $result =~ m/^<rss ([^>]*)>/;
my @rss_attributes = split m/ /, $rss_attributes;
is scalar(grep { $_ eq 'version="2.0"' } @rss_attributes), 1;
is scalar(grep { $_ =~ m/^xmlns:/      } @rss_attributes), 3;
unlike $result, qr{xmlns:xmlns:};
like $result, qr{<wp:wxr_version>1.2</wp:wxr_version>};
like $result, qr{<title>Geography Channel</title>};



( run in 1.290 second using v1.01-cache-2.11-cpan-71847e10f99 )