Re: [xsl] XSL-FO Doctype Problem

Subject: Re: [xsl] XSL-FO Doctype Problem
From: Eliot Kimber <ekimber@xxxxxxxxxxxx>
Date: Sun, 27 Jan 2008 09:23:14 -0600
Karl Stubsjoen wrote:
My XSL-FO output is getting a doctype.  This is because the parent xsl
template declares a doctype, but I do not understand, if I have an
output of type xml at the fo template level, and I am matching on root
"/", shouldn't the doctype be snuffed?

Here is the top of the fo file, which breaks the fo to pdf generation:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE fo:root PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
- - - cut - - -


Here is what the top of my fo template looks like:


<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
	xmlns:wap="http://ade.az.gov/webapplicationtemplater";
    xmlns:fo="http://www.w3.org/1999/XSL/Transform";
				exclude-result-prefixes="xsl wap fo">

	<xsl:import href="../../../wap.codebase/documents.xsl/wap.xsl"/>
	
	<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
	<xsl:template match="/">
		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>


There doesn't appear to be anything in this style sheet that would trigger use of the HTML public and system identifier for the output--that seems very strange indeed. In particular, you've explicitly declared the output as XML and have not specified any public or system identifier, so you wouldn't normally expect to get one in the output.


I observe that the xsl:stylesheet element is using the wrong URL for the "fo" namespace prefix (Transform rather than Format) but since you then rebind "fo" to the correct URL on the fo:root element, that shouldn't matter.

The only thing that makes sense is that your XSLT engine is, for some reason, adding the HTML public and system ID to the output.

Cheers,

Eliot

--
Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 610.631.6770
www.reallysi.com
www.rsuitecms.com

Current Thread