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>
<html>
<head>
<title> s p u t n i k 7 . c o m Newsletter </title>
<style>
h1 {text-align:center;background:black;color:green;font: normal 24pt
"Ariel", "Helvetica"}
h2 {text-align:center;background:black;color:green;font: normal 18pt
"Ariel", "Helvetica"}
p {text-align:justify;backgorund:silver;text-indent:8pt;font: normal
10pt/14pt "Ariel", "Helvetica"}
</style>
</head>
<body>
<h1>
s p u t n i k 7 . c o m Newsletter
</h1>
<h2>
March 8, 2000 Vol.I, Issue 1
</h2>
<p>
crap!
</p>
<i>To unsubscribe, please email <a
href=mailto:cow@aol.com>us</a>.</i>
</body>
</html></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