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

Subject: Re: [xsl] <xsl:copy-of> question
From: ms <mina_hurray@xxxxxxxxx>
Date: Mon, 22 Jan 2007 09:10:03 -0800 (PST)
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@xxxxxxxxxxxx> 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 
> 
> 



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

Current Thread