NEWBIE: Error when converting from XML to PDF

I’m a complete newbie to XML/XSLT, and I’m using XML Spy’s “” tool in an attempt to convert a simple XML file into a PDF doc. But I’m receiving the following error message:

XML Spy

Output of external XSL converter:

[ERROR] Unsupported element encountered: html (Namespace: default). Source context: unavailable
[ERROR] Expected XSL-FO (root, page-sequence, etc.), SVG (svg, rect, etc.) or elements from another supported language.
[ERROR] java.lang.NullPointerException

Does anyone know what this means? Any & all help is appreciated.

In order to transform XML to PDF you need an XSL stylesheet that uses XSL:FO (formatting objects). So your stylesheet could look like:

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

<xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>
    <xsl:template match="/">
      <fo:root>
              . . . .


You should be able to find plenty of references and tools to help you with XML:FO. You can also convert html to XSL:FO which can then be tailored, e.g check out http://www-106.ibm.com/developerworks/library/x-xslfo2app/ .

Hope this helps.

Stuart Fyffe-Collins
Software AG (UK) Ltd.

Great! Thanks for your help. That will really help me to get a foot in the door when it comes to XML-FO. Have a great week.