views:

203

answers:

1

Hello! :-) I'm trying to convert a DocBook XML - File via XSLT to HTML. The XML - File contains an image and this is were i get the following error.

build-html: [xslt] Transforming into C:\dev\DocBook\DocBookmitXML\output [xslt] Processing C:\dev\DocBook\DocBookmitXML\src\BurndownChart.jpg to C:\dev\DocBook\DocBookmitXML\output\BurndownChart.html [xslt] Loading stylesheet C:\dev\DocBook\DocBookmitXML\docbook-xsl-1.75.1\xhtml\docbook.xsl [xslt] : Fatal Error! org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence. Cause: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence. [xslt] Failed to process null


The DocBook-File:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

Freitags um 11.30 Uhr me, myself and I An introduction to DocBook this is text Core Docbook Testtabelle Monat Woche Besucher Mai 1 4711 Mai 2 4712 Mai 3 4713 Gesamt 47110 now to the difficult stuff... A Picture

  <mediaobject>
   <imageobject>
    <imagedata format="JPEG" fileref="BurndownChart.jpeg" />
   </imageobject>
  </mediaobject>

</sect1>


The Build-File:

<?xml version="1.0" encoding="ISO-8859-1"?>

<path id="xalan.classpath">
 <fileset dir="${xalan.lib.dir}" id="xalan.fileset">
  <include name="xalan.jar" />
  <include name="xercesImpl.jar" />
 </fileset>
</path>

<target name="clean" description="Cleans up the generated files">
 <delete dir="${doc.dir}" />
</target>

<target name="depends">
 <mkdir dir="${doc.dir}" />
</target>

<target name="build-html" depends="clean,depends" description="Generates HTML files from DocBook">
<xslt basedir="src" destdir="${doc.dir}" style="${html.stylesheet}" extension=".html">
  <classpath refid="xalan.classpath" />
 </xslt>
</target>


Has anyone any idea, where to look for the error?

A: 

If you take a careful look at the error message, you'll notice that it's actually trying to process the JPEG file, which will of course fail. By default when invoked this way, the xslt task will try to transform all files it finds in the specified directory. You can add add an attribute like includes="*.xml" to tell it to process *.xml files only.

Jukka Matilainen