Re: [xsl] Problem with embeded XHTML in an XML file and transformation to XSL:FO

Subject: Re: [xsl] Problem with embeded XHTML in an XML file and transformation to XSL:FO
From: Luuk Jansen <subscribe@xxxxxxxxxxxxxxxxx>
Date: Sun, 13 Aug 2006 12:47:25 +0100
On Sat, 2006-08-12 at 20:32 +0100, andrew welch wrote:
> On 8/12/06, Luuk Jansen <subscribe@xxxxxxxxxxxxxxxxx> wrote:
> > Thanks Andrew that works now!
> >
> > When I said "test the application again" I meant that I never trust a
> > change in components to behave exactly the same, but it seems fine so
> > far except a few errors concerning version.
> >
> > The system runs though the XML files as it did before, but I get the
> > following error:
> >
> > Error on line 12 column 110 of file:///home/Luuk/workspace/ATFM%
> > 20Solutions/:
> >   SXXP0003: Error reported by XML parser: The prefix "o" for element
> > "o:p" is not bound.
> > ___
> >
> > This is caused by the <xsl:variable name="htmlContent"
> > select="saxon:parse(.)"/> command.
> >
> > Wat does this mean?
> > I cannot find any such element.
> 
> In the example you posted earlier you had:
> 
> &lt;o:p&gt;&lt;/o:p&gt;
> 
> Once this has been parsed twice you have the element:
> 
> <o:p/>
> 
> You haven't defined a namespace for the prefix "o" so the XML parser
> is throwing the error.  Just define a namespace in your stylesheet for
> "o":
> 
> xmlns:o="....."
> 

All-right, I missed that one, sorry about that.

The namespace is urn:schemas-microsoft-com:office:office as I found on
the internet, but adding into the template as seen below doesn't seem to
work (still gives exactly the same error, so doesn't seen to pay any
attention to it).

  <xsl:template match="Content"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:saxon="http://saxon.sf.net/";>      
	        <xsl:if test=". != ''">
	        	<fo:block space-after="10mm">
		      		<xsl:variable name="parseContent" select="saxon:parse(.)"/>
					<xsl:apply-templates select="$parseContent"/>    				
	           	</fo:block>
           	</xsl:if>
  </xsl:template>

Am I doing something stupid wrong?
Sorry for all these newbie questions!

Regards,

Luuk

Current Thread