Commits

dirkbaechle committed 2c65cb0

- fixed two errors for lxml support in the Docbook Tool
- removed "jw" from the list of PDF renderers (doesn't support XML input, only SGML :( ...)

Comments (0)

Files changed (8)

 
 fop = whereis('fop')
 xep = whereis('xep')
-jw = whereis('jw')
 epydoc_cli = whereis('epydoc')
 
 #
 """ % (date, ver, rev))
 
 
-if not fop and not xep and not jw:
-    print "doc: No PDF renderer found (fop|xep|jw), skipping building User Guide."
+if not fop and not xep:
+    print "doc: No PDF renderer found (fop|xep), skipping building User Guide."
 else:
     #
     # Always create a version.xml file containing the version information

doc/design/SConstruct

 
 has_pdf = False
 if (env.WhereIs('fop') or 
-    env.WhereIs('xep') or
-    env.WhereIs('jw')):
+    env.WhereIs('xep')):
     has_pdf = True
 
 #

doc/developer/SConstruct

 
 has_pdf = False
 if (env.WhereIs('fop') or 
-    env.WhereIs('xep') or
-    env.WhereIs('jw')):
+    env.WhereIs('xep')):
     has_pdf = True
 
 #

doc/man/SConstruct

 
 has_pdf = False
 if (env.WhereIs('fop') or 
-    env.WhereIs('xep') or
-    env.WhereIs('jw')):
+    env.WhereIs('xep')):
     has_pdf = True
 
 # Helper function, combining all the steps for a single target

doc/python10/SConstruct

 
 has_pdf = False
 if (env.WhereIs('fop') or 
-    env.WhereIs('xep') or
-    env.WhereIs('jw')):
+    env.WhereIs('xep')):
     has_pdf = True
 
 #

doc/reference/SConstruct

 
 has_pdf = False
 if (env.WhereIs('fop') or 
-    env.WhereIs('xep') or
-    env.WhereIs('jw')):
+    env.WhereIs('xep')):
     has_pdf = True
 
 #

doc/user/SConstruct

 
 has_pdf = False
 if (env.WhereIs('fop') or 
-    env.WhereIs('xep') or
-    env.WhereIs('jw')):
+    env.WhereIs('xep')):
     has_pdf = True
 
 #

src/engine/SCons/Tool/docbook/__init__.py

     
     xsl_style = env.subst('$DOCBOOK_XSL')
     xsl_tree = etree.parse(xsl_style)
+    transform = etree.XSLT(xsl_tree)
     doc = etree.parse(str(source[0]))
     # Support for additional parameters
     parampass = {}
     if parampass:
-        result = doc.xslt(xsl_tree, *parampass)
+        result = transform(doc, **parampass)
     else:
-        result = doc.xslt(xsl_tree)
+        result = transform(doc)
         
-    result.write(str(target[0]), pretty_print=True)
+    try:
+        of = open(str(target[0]), "w")
+        of.write(of.write(etree.tostring(result, pretty_print=True)))
+        of.close()
+    except:
+        pass
 
     return None
 
     doc = etree.parse(str(source[0]))
     doc.xinclude()
     try:
-        of = open(str(target[0]), 'w')
-        of.write(str(doc))
-        of.close()
+        doc.write(str(target[0]), xml_declaration=True, 
+                  encoding="UTF-8", pretty_print=True)
     except:
         pass