]> granicus.if.org Git - docbook-dsssl/commitdiff
Another attempt at flexible named entity and XInclude processing
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Sat, 9 May 2009 17:06:45 +0000 (17:06 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Sat, 9 May 2009 17:06:45 +0000 (17:06 +0000)
xsl/epub/bin/lib/docbook.rb
xsl/epub/bin/spec/epub_regressions_spec.rb
xsl/epub/bin/spec/files/entity.xml [new file with mode: 0644]
xsl/epub/bin/spec/files/onegraphic.entity.xml
xsl/epub/bin/spec/files/onegraphic.xinclude.xml

index bbe1d271b2a177b071fda9d6dbe27844a0814d66..ef72ef8740489b0d838a9dd78cd62cede8ded2db 100755 (executable)
@@ -117,7 +117,7 @@ module DocBook
     def collapse_docbook
       collapsed_file = File.join(File.dirname(@docbook_file),
                                               '.collapsed.' + File.basename(@docbook_file))
-      entity_collapse_command = "xmllint --noent -o '#{collapsed_file}' '#{@docbook_file}'"
+      entity_collapse_command = "xmllint --loaddtd --noent -o '#{collapsed_file}' '#{@docbook_file}'"
       entity_success = system(entity_collapse_command)
       raise "Could not collapse named entites in #{@docbook_file}" unless entity_success
 
index 113650e5edc5f68bec9609fd8ea53071825ff961..e7ebbb3ebb9b091bd656752481ebc35d558e38cc 100755 (executable)
@@ -144,6 +144,12 @@ describe DocBook::Epub do
     xincludeents_epubfile.should be_valid_epub  
   end
 
+  it "should not warn about named &entity;s" do
+    ents_epub = DocBook::Epub.new(File.join(@filedir, "entity.xml"), @tmpdir)
+    ents_epubfile  = File.join(@tmpdir, "entsepub.epub")
+    ents_epub.render_to_file(ents_epubfile, $DEBUG)
+    ents_epubfile.should be_valid_epub  
+  end
 
   after(:all) do
     FileUtils.rm_r(@tmpdir, :force => true)
diff --git a/xsl/epub/bin/spec/files/entity.xml b/xsl/epub/bin/spec/files/entity.xml
new file mode 100644 (file)
index 0000000..0e5f733
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
+         "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<article>
+ <section>
+   <title>Title</title>
+   <para>&copy;</para>
+ </section>
+</article>
index 8b83101ddd5ed6a187673dd17a578e2fe080be99..89d04c8d8c9e2a65d861c794e2ae34c49c0dd2a6 100644 (file)
@@ -11,6 +11,7 @@
 <sect1>
   <title>The stamp image</title>
 
+
 <para>The stamp image has a natural size of 200x128 pixels.</para>
 
 <para>The stamp image.</para>
index 72d712ce7eee0a700399277b6d64c4648453b7c3..87f972d702af7694cec73916ba357a7f3e4c843e 100644 (file)
 
 <para>The small duck.</para>
 
+<para>Include a copy entity to trigger a bug in entity collapsing 
+  following <ulink url="https://sourceforge.net/tracker/?func=detail&amp;aid=2750442&amp;group_id=21935&amp;atid=373747">Bug #2750442</ulink>'s resolution.
+To that end: &copy;.
+Reported by Michael Wiedmann.</para>
+
 <mediaobject>
   <imageobject role="webhires">
     <imagedata format="PNG" fileref="graphics/duck-small.png"/>