[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] question


Subject: Re: [xsl] <xsl:copy-of> question
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Mon, 22 Jan 2007 11:08:12 -0600

Hi:

I have a question about <xsl:copy-of>

I have am xml input file:

<a>
<para>Test</para>
</a>

My xslt:

<xsl:template match="a">
<xsl:copy-of select="node()"/>
</xsl:template>

I am using renderx XEP as the processor, and when Igenerate the PDF I
get an error message saying

"Element 'para' belonging to the anonymous namespace cannot occur in
an XSL-FO document outside 'instream-foreign-object' elements."

Can you tell me what this means?

It means that para is not one of the elements supported by FO. The copy-of statement is copying the para element to the output, and XEP doesn't recognize it as valid FO (because it isn't).


You should write a template to handle the para element, too. For example:

<xsl:template match="a">
 <xsl:apply-templates/>
</xsl:template>

<xsl:template match="para">
 <fo:block><xsl:apply-templates/></fo:block>
</xsl:template>

Now the contents of your para appear in an FO block element. Assuming you don't have similar problems elsewhere and that you have declared the FO namespace in an appropriate place, those two templates should solve the problem.

Jay Bryant
Bryant Communication Services



Current Thread
Keywords
xml