[xsl] Question about XSLTC

Subject: [xsl] Question about XSLTC
From: "Ben Rainville" <brainville@xxxxxxxxxxx>
Date: Mon, 6 Aug 2007 14:07:09 -0700
Hello,

I am working on application where we convert Word documents to PDFs.  To
do this, we take the XML describing the Word document, transform it into
FO using XSL, and then render the FO using RenderX's XEP.  Until
recently, this was working just fine.

Recently we have decided to switch to using XSLTC, to improve the speed
of our transforms.  In other parts of our application, we have been able
to use XSLTC without a problem.  However in the part that generates PDFs
from Word docs, I have run into a problem.  With our old transformer
factory, transforming a document would produce, for example:

<fo:block widows="2" orphans="2" font-size="10pt" line-height="1.147"
white-space-collapse="false">
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="first-page-header" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="first-page-footer" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="odd-page-header" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="odd-page-footer" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="even-page-header" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="even-page-footer" />
        <fo:block xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags" text-align="left"
font-family="TimesNewRoman" font-size="12pt" language="EN-US">
          <fo:inline>
            <fo:leader leader-length="0pt" />
            Some content
          </fo:inline>
        </fo:block>
      </fo:block>

Using the new transformer factory
(org.apache.xalan.xsltc.trax.TransformerFactoryImpl), I get the
following:

<fo:block widows="2" orphans="2" font-size="10pt" line-height="1.147"
white-space-collapse="false">
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="first-page-header" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="first-page-footer" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="odd-page-header" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="odd-page-footer" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="even-page-header" />
        <fo:marker xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
marker-class-name="even-page-footer" />
        <block xmlns:svg="http://www.w3.org/2000/svg";
xmlns:st1="urn:schemas-microsoft-com:office:smarttags" text-align="left"
font-family="TimesNewRoman" font-size="12pt" language="EN-US">
          <inline>
            <leader leader-length="0pt" />
            Some content
          </inline>
        </block>
      </fo:block>

As you can see, it appears that there is some kind of a namespace
problem for the fo:block that is inside of another fo:block.  Has anyone
seen an issue similar to this?  I can post the XML and XSL if it would
help.

Thanks in advance,

Ben Rainville

Current Thread