Commits

Anonymous committed ff19e58

XML::CompareML: created a function to return the CSS style.

Comments (0)

Files changed (2)

 --- #YAML:1.0
 name: XML-CompareML
-version: 0.1.3
+version: 0.2.0
 license: bsd
 distribution_type: module
 requires:
 provides:
   XML::CompareML:
     file: lib/XML/CompareML.pm
-    version: 0.1.3
+    version: 0.2.0
   XML::CompareML::Base:
     file: lib/XML/CompareML/Base.pm
   XML::CompareML::DTD::Generate:

lib/XML/CompareML/HTML.pm

 {
     my $self = shift;
 
+    my $style = $self->get_head_css_style();
+
+    my $o = $self->{o};
+    print {*{$o}} <<"EOF";
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+<title>Version Control Systems Comparison</title>
+$style
+</head>
+<body>
+EOF
+}
+
+sub get_head_css_style
+{
+    my $self = shift;
+    
     my $stylesheet_url = undef;
-
-    my ($style, $style_link);
+    my $style;
+    
     if ($stylesheet_url)
     {
         $style = "<link rel=\"stylesheet\" href=\"$stylesheet_url\" />";
 -->
 </style>
 EOF
-
-    my $o = $self->{o};
-    print {*{$o}} <<"EOF";
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html
-     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
-<title>Version Control Systems Comparison</title>
-$style
-</head>
-<body>
-EOF
     }
+    return $style;
 }
 
 sub start_rendering