summaryrefslogtreecommitdiff
path: root/report
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-09-13 12:13:28 +0200
committermguetlein <martin.guetlein@gmail.com>2010-09-13 12:13:28 +0200
commit3cf7ecd7f1f4811e1b7f77ebc36cf280268b495c (patch)
tree505976cabb16afd6804b2fd78fb753e3ec726d5a /report
parent0acc756e0f2db27abeacf9e229a910df315d279d (diff)
fix report dtd
Diffstat (limited to 'report')
-rw-r--r--report/report_application.rb6
-rw-r--r--report/xml_report.rb6
2 files changed, 10 insertions, 2 deletions
diff --git a/report/report_application.rb b/report/report_application.rb
index 12775cc..f76ff32 100644
--- a/report/report_application.rb
+++ b/report/report_application.rb
@@ -18,6 +18,12 @@ def perform
end
+get '/+'ENV['REPORT_DTD'] do
+ content_type "application/xml-dtd"
+ body(File.new(ENV['REPORT_DTD']))
+end
+
+
get '/report/:type/css_style_sheet/?' do
perform do |rs|
"@import \""+params[:css_style_sheet]+"\";"
diff --git a/report/xml_report.rb b/report/xml_report.rb
index a621400..50c9007 100644
--- a/report/xml_report.rb
+++ b/report/xml_report.rb
@@ -2,8 +2,10 @@
require "report/xml_report_util.rb"
ENV['REPORT_DTD'] = "docbook-xml-4.5/docbookx.dtd" unless ENV['REPORT_DTD']
+
#transfer to absolute path
-ENV['REPORT_DTD'] = File.expand_path(ENV['REPORT_DTD']) if File.exist?(ENV['REPORT_DTD'])
+#ENV['REPORT_DTD'] = File.expand_path(ENV['REPORT_DTD']) if File.exist?(ENV['REPORT_DTD'])
+
# = XMLReport
#
@@ -21,7 +23,7 @@ module Reports
@doc = Document.new
decl = XMLDecl.new
@doc << decl
- type = DocType.new('article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "'+ENV['REPORT_DTD']+'"')
+ type = DocType.new('article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "'+$sinatra.url_for('/'+ENV['REPORT_DTD'], :full)+'"')
@doc << type
@root = Element.new("article")