You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sc...@lotus.com on 2000/03/14 21:40:18 UTC

Re: Err: Warning: can't output text before document element!

Hi Khondker at sputnik7.  You are outputing an xml file that doesn't have a
document element, which is not legal XML, and thus the warning.  You might
want to try:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text"/>
  <xsl:template match="page">
      <xsl:value-of select="text" />
  </xsl:template>

  <xsl:template match="text">
  </xsl:template>
</xsl:stylesheet>

...depending on what you are trying to do.

-scott




                                                                                                                   
                    "K. Rumman                                                                                     
                    Akhter"              To:     "Xalan-Dev" <xa...@xml.apache.org>                            
                    <kakhter@sput        cc:     (bcc: Scott Boag/CAM/Lotus)                                       
                    nik7.com>            Subject:     Err: Warning: can't output text before document element!     
                                                                                                                   
                    03/14/00                                                                                       
                    03:19 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    xalan-dev                                                                                      
                                                                                                                   
                                                                                                                   




i get two error message like this:
Warning: can't output text before document element!  Ignoring...
           at
org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1606)
           at ...
---------
Warning: can't output text before document element!  Ignoring...
           at
org.apache.xalan.xpath.xml.FormatterToDOM.append(FormatterToDOM.java,
Compiled Code)
           at ...

my xml file (using XSPs)outputs this:
----------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
                      "http://www.w3.org/TR/REC-html40/strict.dtd">
<page>


 <text>
&lt;html&gt;
 &lt;head&gt;
  &lt;title&gt; s p u t n i k 7 . c o m Newsletter &lt;/title&gt;
  &lt;style&gt;
  h1 {text-align:center;background:black;color:green;font: normal 24pt
&quot;Ariel&quot;, &quot;Helvetica&quot;}
  h2 {text-align:center;background:black;color:green;font: normal 18pt
&quot;Ariel&quot;, &quot;Helvetica&quot;}
  p {text-align:justify;backgorund:silver;text-indent:8pt;font: normal
10pt/14pt &quot;Ariel&quot;, &quot;Helvetica&quot;}
  &lt;/style&gt;
 &lt;/head&gt;

 &lt;body&gt;

&lt;h1&gt;
s p u t n i k 7 . c o m Newsletter
&lt;/h1&gt;
&lt;h2&gt;
March 8, 2000 Vol.I, Issue 1
&lt;/h2&gt;
&lt;p&gt;
crap!
&lt;/p&gt;

&lt;i&gt;To unsubscribe, please email &lt;a
href=mailto:cow@aol.com&gt;us&lt;/a&gt;.&lt;/i&gt;

&lt;/body&gt;
&lt;/html&gt;</text>

 </page>

<!-- This page was served in 742 milliseconds by Cocoon 1.7 -->
----------------------------------------

and the xsl file is:
-----------------------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="page">
      <xsl:value-of select="text" />
  </xsl:template>

  <xsl:template match="text">
  </xsl:template>
</xsl:stylesheet>
-----------------------------

i have no clue as to why this is not showing...please, any suggestion will
be helpful...

***
K h o n d k e r RUmman A k h t e r
Programmer
sputnik7.com

kakhter@sputnik7.com