tags:

views:

102

answers:

2

I have an XML and an appropriate XSL that I need to provide to a Java application. This Java application is expected to generate a HTML page after XSL transformation. This is not my Java application so I do not know which XSL processor it is using internally.

The problem is that it completely ignores my xsl:output directive; thus, instead of generating HTML, it generates plain XML.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">  
<xsl:output method="html" omit-xml-declaration="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" />

Do you have any suggestions on what to do? Do you have a workaround?

Thanks.

A: 

Could it be that since the doc type points to XHTML strict that the processor reasonably assumes that XML output is acceptable?

AnthonyWJones
Thanks for the answer, however I've tried using 4.01 Transitional and it's the same issue.
Dario
Without an understanding of the internals of the code doing the transform I think then you are on a hiding to nothing.
AnthonyWJones
A: 

XSLT will generate output as text, the output directive is explained at w3schools. The only thing to differentiate "XML" output from "HTML" or "XHTML" is some minor formatting.

Depending on your XSLT engine it might have separate methods for outputting XML and text, since it's more common to use it to output XML as a well-formed XML document.

Timothy Walters