Page 1 of 1

Parse error: whitespace required (found ">")

Posted: Wed Feb 23, 2005 2:48 pm
by smaug42
I am using XEP to transform a large document to PDF. The transform to PDF works fine with the default settings... but if I go into the "Configure transformation scenario" and add in an HTML header (using the "Append header and footer" button) and try to transform again, I get this error:

Code: Select all


[error] Fatal parse error: file:/home/ccornell/doc/xml/manual.doc_xslt: line 1, column 62: whitespace required (found ">")

Parse error: whitespace required (found ">")
Process ended with exit code: 1
The HTML I'm trying to use as a header is pretty simple:

Code: Select all


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Logo</title>
</head>
<body>
<img
style="width: 100px; height: 50px;" src="logo.jpg">
</body>
</html>
So... what's going wrong here? Is there some special syntax required for the HTML header function?

Posted: Wed Feb 23, 2005 3:56 pm
by george
Hi,

You cannot mix FO and HTML.
Getting PDF from XML means
1. convert the XML using a stylesheet (XSLT) to FO (Formatting Objects)
2. convert the FO document to PDF using a FO Processor

The header and footer options are just some helpers to allow a partial result to be properly presented in the embedded views. For instance imagine that you have a stylesheet that generates only a table row, in order to have it properly presented the html, head, body, table tags can be added in the header and footer so that the result header + transformation result + footer will get a well formed (X)HTML document.

Best Regards,
George

Posted: Wed Feb 23, 2005 4:01 pm
by smaug42
Thanks, I thought it was too easy to be able to add a "header" like that... :-) It wasn't really clear in the documentation what that header/footer thing was, so I assumed (hoped) it allowed me to add a header or footer to the final transformed page. It makes sense now...

Now to find a way to insert a company logo/watermark on the top of every page of the PDF....

Posted: Thu Feb 24, 2005 10:57 am
by sorin_ristache
Hello,

If the XML document uses the DocBook framework you can add headers and/or footers to every page of the transformation result by customizing some templates in the DocBook stylesheets depending of what you have to display in the header/footer. If the output format of your transformation is HTML you can find more informations at

http://www.sagehill.net/docbookxsl/HTMLHeaders.html

For PDF output see

http://www.sagehill.net/docbookxsl/PrintHeaders.html

Regards,
Sorin

Posted: Fri Feb 25, 2005 12:13 pm
by smaug42
Excellent references. Thanks. They are bookmarked now :-) The second link is exactly the solution I need.