On 19 Mar 2009, at 22:07, Sam Fuqua wrote:

Hi

I am trying to create a FOP through an XSLT and am having some trouble with namespaces. The XML is being generated clientside and being posted to the server. The server has an XSL on the filesystem which it uses. The XML generated has namespaces which seem to conflict with the FO namespaces. I can get it to work with the command line when the namespaces are absent, but thwen they are present it just throws out an empty PDF. Has anyone experienced this or know why this is happening?

Is the document namespace also declared in the stylesheet?

If you have the following root:

<svg xmlns="http://www.w3.org/2000/svg";>
...

Then, to process that node in XSLT, you need either:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns="http://www.w3.org/2000/svg";>
...

<xsl:template match="svg">
...

or

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:svg="http://www.w3.org/2000/svg";>
...
<xsl:template match="svg:svg">
...

The first option is actually not very convenient, since it would also mean that the default namespace for the result tree will be the SVG namespace. The better practice is to bind a prefix and use qualified names in the matching patterns.

HTH!

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to