1. Shlomi Fish
  2. Fiction-XML

Commits

Shlomi Fish  committed baee589

Add the XHTML namespace.

Add the XHTML namespace to the resultant XHTML of the one generated by
Screenplay-XML->HTML.

  • Participants
  • Parent commits cdeb8c8
  • Branches default

Comments (0)

Files changed (2)

File perl/modules/XML-Grammar-Fiction/extradata/screenplay-xml-to-html.xslt

View file
  • Ignore whitespace
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet version = '1.0'
+     xmlns='http://www.w3.org/1999/xhtml'
      xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
      xmlns:sp="http://web-cpan.berlios.de/modules/XML-Grammar-Screenplay/screenplay-xml-0.2/"
      >

File perl/modules/XML-Grammar-Fiction/t/screenplay/to-xhtml.t

View file
  • Ignore whitespace
     my $xpc = XML::LibXML::XPathContext->new();
     $xpc->registerNs('x', q{http://www.w3.org/1999/xhtml});
     # TEST*$num_texts
-    my @results = $xpc->find(q{//x:html}, $doc);
+    my $r = $xpc->find(q{//x:html}, $doc);
     is (
-        scalar(@results),
+        $r->size(),
         1,
         "Found one article with id index",
     );
 
-    @results = $xpc->find(q{//x:div[@class='saying']}, $doc);
+    $r = $xpc->find(q{//x:div[@class='saying']}, $doc);
     # TEST*$num_texts
     ok (
-        (scalar(@results)
-            >=
-            1
-        ),
+        ($r->size() >= 1),
         "Found role=description sections",
     );
 
-    @results = $xpc->find(q{//x:div[@class='saying']/x:p/x:strong[@class='sayer']}, $doc);
+    $r = $xpc->find(q{//x:div[@class='saying']/x:p/x:strong[@class='sayer']}, $doc);
     # TEST*$num_texts
     ok (
-        (scalar(@results)
-            >=
-            1
-        ),
+        ( $r->size() >= 1 ),
         "Found role=description sections",
     );
-
 }
 
 1;