xsl-list
[Top] [All Lists]

Re: [xsl] <xsl:copy-of> question

2007-01-22 10:10:25
Hi:

I do have a template match for <para> in my style
sheet. 

Why then does it throw this error? This is what is
puzzling me. 

--- Jay Bryant <jay(_at_)bryantcs(_dot_)com> wrote:

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 




--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





 
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>