File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ use strict;
2
+ use warnings;
3
+
4
+ use Test::More " no_plan" ; # I, for one, don't like it when a plan
5
+ # comes together
6
+
7
+ use XML::XPathScript;
8
+
9
+ my $xps = XML::XPathScript-> new;
10
+
11
+ my $noop_stylesheet = ' <%= apply_templates() %>' ;
12
+ my $result = $xps -> transform( <<'NAMESPACED_XML' , $noop_stylesheet );
13
+ <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">
14
+ <channel>
15
+ <title>Geography Channel</title>
16
+ <wp:wxr_version>1.2</wp:wxr_version>
17
+ </channel>
18
+ </rss>
19
+ NAMESPACED_XML
20
+
21
+ my ($rss_attributes ) = $result =~ m / ^<rss ([^>]*)>/ ;
22
+ my @rss_attributes = split m / / , $rss_attributes ;
23
+ is scalar (grep { $_ eq ' version="2.0"' } @rss_attributes ), 1;
24
+ is scalar (grep { $_ =~ m / ^xmlns:/ } @rss_attributes ), 3;
25
+ unlike $result , qr { xmlns:xmlns:} ;
26
+ like $result , qr { <wp:wxr_version>1.2</wp:wxr_version>} ;
27
+ like $result , qr { <title>Geography Channel</title>} ;
You can’t perform that action at this time.
0 commit comments