cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurt Heston <kurthes...@yahoo.com>
Subject RE: Processing XML output from CGI Programs with XSP
Date Wed, 24 Jan 2001 00:31:02 GMT
I’ve done a little more experimenting.

Here’s my xsp code:

//-----------------------------
<?xml version="1.0"?>

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="stylesheet.xsl" type="text/xsl"?>

<xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core"
      xmlns:util="http://www.apache.org/1999/XSP/Util">

	<page>
		<util:include-uri
href="http://userid:password@web.server.com:83/cgi-bin/codegen.exe?_FRM%3D75
%26_OUT%3DXML"/>
		<!--<util:include-uri href="http://web.server.com:83/sampleout.xml"/> -->
		<!--<util:href>
			<xsp:expr>"http://web.server.com:83/sampleout.xml"</xsp:expr>
		</util:href> -->
	</page>
</xsp:page>
//------------------------------

You can see I’ve tried a number of different methods.  The best I can get
for output is:

	Warning: can't output text before document element!

Isn't this the same error I would get if I had an empty doc?  I’m wondering
if <util:include-uri> is really doing anything.  Any clues?

"stylesheet.xsl" works fine when I use it with a static xml doc.


-----Original Message-----
From: Donald Ball [mailto:balld@webslingerZ.com]
Sent: Tuesday, January 23, 2001 3:04 PM
To: Kurt Heston
Subject: RE: Processing XML output from CGI Programs with XSP


On Tue, 23 Jan 2001, Kurt Heston wrote:

> Donald,
>
> I already have XSLT code that transforms the CGI output and it works fine.
> However, when I use <util:include>, etc. I get:
>
> "Can't output text before document element!"
>
> I think that the problem is in the processing of the root node.  Do you
know
> of a way to make the included document, the only document, such that my
CGI
> produced XML root is the final root node?

wrap the call to <util:include> in a root node:

<page>
  <util:include ... />
</page>

and see what happens. i'm willing to bet that the util:include you're
using isn't parsing the data as xml. there's something else in the util
namespace that you need to add or use instead, can't remember. grep for
parse or -xml or something.

- donald


Mime
View raw message