RE: [xsl] Problem with embeded XHTML in an XML file andtransformation to XSL:FO

Subject: RE: [xsl] Problem with embeded XHTML in an XML file andtransformation to XSL:FO
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 13 Aug 2006 15:28:52 +0100
> I added &lt;ns:elem xmlns:ns="doc"/> to the beginning of the 
> text element and am a step further (I think) as it gives me a 
> next error:

The input you are passing to the XML parser now contains an ns:elem element
followed by an html element. If you typed

<ns:elem xmlns:ns="doc"><html/>

into a text editor and then tried to parse this as an XML document, you
would get exactly the same error.

Michael Kay
http://www.saxonica.com/

> 
> Error on line 1 column 27 of file:///home/Luuk/workspace/ATFM%
> 20Solutions/:
>   SXXP0003: Error reported by XML parser: The markup in the 
> document following the root
>   element must be well-formed.
> Error on line 1048575 of file:///home/Luuk/workspace/ATFM%
> 20Solutions/xsl/xhtml2fo.xsl:
>   net.sf.saxon.trans.DynamicError: 
> org.xml.sax.SAXParseException: The markup in the document
>   following the root element must be well-formed.
> net.sf.saxon.trans.DynamicError: 
> org.xml.sax.SAXParseException: The markup in the document 
> following the root element must be well-formed.
> 
> Am I just opening a can of worms here?
> It is probably something basic, but my brain is fried at this stage...
> 
> The XML parsed is show below, where the content bit is 
> processed with the next part of the stylesheet:
> 
>   <xsl:template match="Content" xmlns:saxon="http://saxon.sf.net/";
> >      
> 	        <xsl:if test=". != ''">
> 	        	<fo:block space-after="10mm">
> 		      		<xsl:variable 
> name="parseContent" select="saxon:parse(.)"/>
> 					<xsl:value-of 
> select="$parseContent"/>    				
> 	           	</fo:block>
>            	</xsl:if>
>   </xsl:template>
> 
> ___
> 
> The XML: 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <Sections>
>    <Section>
>       <Title>Technical Summary</Title>
>       <IE.SFI.4400>
> 	        <Content Version="1.0" type="XHTML">&lt;ns:elem 
> xmlns:ns="doc"/&gt;&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;bo
> dy&gt;&lt;bla bla bla  class="MsoNormal" style="margin-top: 
> 6pt; text-align: justify; text-indent: 21.25pt; font-family: 
> times new roman;"&gt;&lt;font size="3"&gt;&lt;span 
> style="font-size: 12pt;"&gt;
> 
> &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> 
> &lt;p class="MsoNormal" style="margin-top: 6pt; text-align: justify;
> text-indent: 21.25pt; font-family: times new 
> roman;"&gt;&lt;font size="3"&gt;&lt;span lang="EN-GB" 
> style="font-size: 12pt;"&gt;bla bla bla &amp;#945;2-bla bla 
> bla &amp;#945;2-bla bla bla.&lt;/span&gt;&lt;span style="font-size:
> 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> 
> 
> &lt;p class="MsoNormal" style="margin-top: 6pt; text-align: justify;
> text-indent: 21.25pt; font-family: times new 
> roman;"&gt;&lt;font size="3"&gt;&lt;span lang="EN-GB" 
> style="font-size:
> 12pt;"&gt;&amp;#945;2-bla bla bla
> &lt;/span&gt;&lt;/font&gt;&lt;span style="font-size: 
> 12pt;"&gt;&lt;font size="3"&gt;&lt;span style="font-size: 
> 12pt;" lang="EN-GB"&gt;bla bla bla 
> &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font 
> size="3"&gt;&lt;span lang="EN-GB" style="font-size: 
> 12pt;"&gt;groups.&lt;/span&gt;&lt;span
> style="font-size:
> 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> 
> 
> &lt;p class="MsoNormal" style="margin-top: 6pt; text-align: justify;
> text-indent: 21.25pt; font-family: times new 
> roman;"&gt;&lt;font size="3"&gt;&lt;span lang="EN-GB" 
> style="font-size: 12pt;"&gt;bla bla bla:&lt;/span&gt;&lt;span 
> style="font-size:
> 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> 
> 
> &lt;p class="MsoNormal" style="margin-top: 6pt; margin-left: 63.8pt;
> text-align: justify; text-indent: -35.25pt; font-family: 
> times new roman;"&gt;&lt;font size="3"&gt;&lt;span 
> lang="EN-GB" style="font-size:
> 12pt;"&gt;1)&lt;/span&gt;&lt;span lang="EN-GB" style="font-size:
> 7pt;"&gt;             &lt;/span&gt;&lt;span lang="EN-GB"
> style="font-size: 12pt;"&gt;model the &amp;#945;2-bla bla bla 
> &amp;#8216;&lt;i&gt;in silico&lt;/i&gt;&amp;#8217; test 
> &amp;#945;2-adrenoceptor antagonists. &lt;/span&gt;&lt;span 
> style="font-size:
> 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> 
> 
> &lt;p class="MsoNormal" style="margin-top: 6pt; margin-left: 63.8pt;
> text-align: justify; text-indent: -35.25pt; font-family: 
> times new roman;"&gt;&lt;font size="3"&gt;&lt;span 
> lang="EN-GB" style="font-size:
> 12pt;"&gt;2)&lt;/span&gt;&lt;span lang="EN-GB" style="font-size:
> 7pt;"&gt;         
> &lt;/span&gt;&lt;span lang="EN-GB" style="font-size: 
> 12pt;"&gt;bla bla bla &lt;/span&gt;&lt;span style="font-size:
> 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> 
> 
> &lt;p class="MsoNormal" style="margin-top: 6pt; margin-left: 63.8pt;
> text-align: justify; text-indent: -35.25pt; font-family: 
> times new roman;"&gt;&lt;font size="3"&gt;&lt;span 
> lang="EN-GB" style="font-size:
> 12pt;"&gt;3)&lt;/span&gt;&lt;span lang="EN-GB" style="font-size:
> 7pt;"&gt;               
> &lt;/span&gt;&lt;span lang="EN-GB" style="font-size:
> 12pt;"&gt;evaluate&lt;span style="color: red;"&gt; 
> &lt;/span&gt;bla bla bla &amp;#945;2-bla bla 
> bla.&lt;/span&gt;&lt;span style="font-size:
> 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> 
> 
> &lt;p class="MsoNormal" style="margin-top: 6pt; text-align: justify;
> text-indent: 21.25pt; font-family: times new 
> roman;"&gt;&lt;font size="3"&gt;&lt;span lang="EN-GB" 
> style="font-size: 12pt;"&gt;The applicant&amp;#8217; bla bla 
> bla &lt;/span&gt;&lt;st1:country-region&gt;&lt;st1:place&gt;&lt;span
> lang="EN-GB" style="font-size:
> 12pt;"&gt;Ireland&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:count
> ry-region&gt;&lt;span lang="EN-GB" style="font-size: 
> 12pt;"&gt; with such capability.&lt;/span&gt;&lt;span 
> style="font-size: 
> 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> &lt;p class="MsoNormal" style="margin-top: 6pt; text-align: justify;
> text-indent: 21.25pt; font-family: times new 
> roman;"&gt;&lt;font size="3"&gt;&lt;span lang="EN-GB" 
> style="font-size:
> 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
> 
> &lt;/body&gt;&lt;/html&gt;</Content>
> 		       <Attachments Version="1.0">
> 		          <Attachment context="" mimeType="" name="">
> 			            <Link/>
> 			            <Comment author="" timestamp=""/>
> 			            <Property name=""/>
> 		          </Attachment>
> 	        </Attachments>
>       </IE.SFI.4400>
>    </Section>
> </Sections>
> 
> Tanks again!
> 
> Luuk

Current Thread