You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jonny Pony <jo...@hotmail.com> on 2004/10/17 17:21:02 UTC

Return XML-nodes from logicsheet

Hi,

my aim is to return xml-nodes from a logicsheet, or more precise from the 
esql-logicsheet in my own logicsheet.

My logicsheet that doesn't work:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xsp="http://apache.org/xsp" xmlns:foo="http://foo.bar/esql" 
xmlns:esql="http://apache.org/cocoon/SQL/v2" version="1.0">
	<xsl:template match="xsp:page">
		<xsp:page>
			...
		</xsp:page>
	</xsl:template>

        ...

        <xsl:template match="foo:simplexmlreturn">
            <xsp:expr><returnnode/></xsp:expr>
        </xsl:template>

	<!--
	<xsl:template match="foo:esql">
            <xsp:expr>
		<esql:connection>
			<esql:pool>mysql-pool-test</esql:pool>
			<esql:execute-query>
				<esql:query>SELECT name From mytable</esql:query>
				<esql:results>
					<table>
						<esql:row-results>
							<name>
								<esql:get-string column="name"/>
							</name>
						</esql:row-results>
					</table>
				</esql:results>
				<esql:no-results>
					<error>Sorry, no results!</error>
				</esql:no-results>
			</esql:execute-query>
		</esql:connection>
             <xsp:expr>
	</xsl:template>
        -->
         ...

</xsl:stylesheet>

If I only use the foo:simplexmlreturn-template, I don't get any XML-output 
in my XSP-Page.
Question 1: How do I return XML? Couldn't find any documentation on this.

If I uncomment the foo:esql-template the logicsheet crashes.
Question 2: How can I use the esql-logicsheet in my own logicsheet and 
return the resulting xml?

Cheers
Jonny

_________________________________________________________________
Tun Sie Ihrem Rechner ’was Gutes. MSN Hotmail mit McAfee® Anti-Virus. 
http://www.msn.de/email/antivirus/ Jetzt kostenlos anmelden!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Return XML-nodes from logicsheet

Posted by Lars Huttar <la...@sil.org>.
Jonny Pony wrote:

> Hi,
>
> my aim is to return xml-nodes from a logicsheet, or more precise from 
> the esql-logicsheet in my own logicsheet.
>
> My logicsheet that doesn't work:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> xmlns:xsp="http://apache.org/xsp" xmlns:foo="http://foo.bar/esql" 
> xmlns:esql="http://apache.org/cocoon/SQL/v2" version="1.0">
>     <xsl:template match="xsp:page">
>         <xsp:page>
>             ...
>         </xsp:page>
>     </xsl:template>
>
>        ...
>
>        <xsl:template match="foo:simplexmlreturn">
>            <xsp:expr><returnnode/></xsp:expr>
>        </xsl:template>
>
>     <!--
>     <xsl:template match="foo:esql">
>            <xsp:expr>
>         <esql:connection>
>             <esql:pool>mysql-pool-test</esql:pool>
>             <esql:execute-query>
>                 <esql:query>SELECT name From mytable</esql:query>
>                 <esql:results>
>                     <table>
>                         <esql:row-results>
>                             <name>
>                                 <esql:get-string column="name"/>
>                             </name>
>                         </esql:row-results>
>                     </table>
>                 </esql:results>
>                 <esql:no-results>
>                     <error>Sorry, no results!</error>
>                 </esql:no-results>
>             </esql:execute-query>
>         </esql:connection>
>             <xsp:expr>

I assume you mean </xsp:expr> here.

>     </xsl:template>
>        -->
>         ...
>
> </xsl:stylesheet>
>
> If I only use the foo:simplexmlreturn-template, I don't get any 
> XML-output in my XSP-Page.
> Question 1: How do I return XML? Couldn't find any documentation on this.
>
> If I uncomment the foo:esql-template the logicsheet crashes.
> Question 2: How can I use the esql-logicsheet in my own logicsheet and 
> return the resulting xml?
>
> Cheers
> Jonny
>
Normally an XSP-page (with or without a logicsheet) does return XML, 
that is, it emits XML (as SAX events) that travel down the pipeline to 
the following transformer or serializer.
It seems like you don't need the <xsp:expr> wrappers in the above code. 
If you remove them, does it work?

Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org