You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Patrick van Kann <pa...@fortune-cookie.com> on 2000/10/30 12:25:11 UTC

xincluding
Hello,

Sorry for what must appear to be a fairly obvious/trivial problem, but I am 
having no success with getting <xincludes to, well, include anything. I 
have seen references to this problem in the archives but no solution...

The code fragment below shows what I am trying to achieve. Can anyone see 
the (no doubt blindingly obvious) mistake I am making? Embarrassingly, I 
have struggled with this for 2 days and it's got me beat.

Thanks, Patrick

<?xml version="1.0"?>
<?cocoon-process type="xinclude"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-logicsheet href="esql.xsl"?>
<?xml-stylesheet href="form4.xsl" type="text/xsl"?>

<xsp:page
   language="java"
   xmlns:esql="http://apache.org/cocoon/SQL/v2"
   xmlns:util="http://www.apache.org/1999/XSP/Util"
   xmlns:xsp="http://www.apache.org/1999/XSP/Core"
   xmlns:xinclude="http://www.w3.org/TR/xinclude"
 >

<page>

<esql:execute-query>
	<xinclude:include parse="xml" xinclude:href="dbconnect.xml"/>
<esql:results>

The dbconnect.xml just contains...

<esql:driver>My.database.driver</esql:driver>
<esql:dburl>my.database/URL</esql:dburl>
<esql:username>uname</esql:username>
<esql:password>pword</esql:password> 


Cocoon/Turbine/SQL Server (was Re: xincluding Posted by Patrick van Kann <pa...@fortune-cookie.com>.
Thanks for everyone's help... it was all useful, but I ended up sorting out 
connection pooling for MS SQL instead.

In return (and to avoid more gumbies like me wasting everybody's time), 
here are instructions for how to get Microsoft SQL Server 7.0 to work with 
the Turbine distribution in Cocoon 1.8.

Probably heresy on this list though ;-)

It relies on the fact that the Sybase DBadaptor and the MSSQL DBadaptor are 
identical... Oh, and I only tested this with the (heinously expensive) Inet 
software JDBC type 4 driver.... and not exhaustively... on Cocoon1.8/Tomcat 
3.1/Debian Linux.

Here goes.
1) Comment out the line in cocoon.properties that says (with a #)

processor.xsp.pool.database.adaptor.DBSybase=com.sybase.jdbc.SybDriver

2) and replace with

processor.xsp.pool.database.adaptor.DBSybase=com.inet.tds.TdsDriver

3) Then set some connection params up (like the oracle example there 
already) i.e. something like...

processor.xsp.pool.database.myexcitingwebproject.driver=com.inet.tds.TdsDriver
processor.xsp.pool.database.myexcitingwebproject.url=jdbc:inetdae:localhost:1433?database=myexcitingwebproject
processor.xsp.pool.database.myexcitingwebproject.username=uname
processor.xsp.pool.database.myexcitingwebproject.password=pword
processor.xsp.pool.database.myexcitingwebproject.maxConnections=3
processor.xsp.pool.database.myexcitingwebproject.expiryTime=3600000

4) Make sure that Sprinta2000.jar is in /jakarta-tomcat/lib/ and in yr. 
tomcat.bat if you have the misfortune of running windows... (3.1 on Linux 
picks it up automatically).

5) Stop Tomcat.

6) Start Tomcat.

7) If you are using the esql logic sheet (for example) simply replace yr 
params in the page with

<esql:use-connection>myexcitingwebproject</esql:use-connection>

et viola!

Sorry if this is too obvious... however at least now everyone can 
dismissively refer people to the archives if they ask the same question ;-)

Patrick

At 08:45 30/10/2000 -0500, you wrote:
>Your dbconnect.xml file isn't well-formed xml, and won't parse (no xml pi, no
>root element).  Why not just use an external entity to include your file?
>
>Best,
>Hugh
>
>Patrick van Kann wrote:
>
> > Hello,
> >
> > Sorry for what must appear to be a fairly obvious/trivial problem, but I am
> > having no success with getting <xincludes to, well, include anything. I
> > have seen references to this problem in the archives but no solution...
> >
> > The code fragment below shows what I am trying to achieve. Can anyone see
> > the (no doubt blindingly obvious) mistake I am making? Embarrassingly, I
> > have struggled with this for 2 days and it's got me beat.
> >
> > Thanks, Patrick
> >
> > <?xml version="1.0"?>
> > <?cocoon-process type="xinclude"?>
> > <?cocoon-process type="xsp"?>
> > <?cocoon-process type="xslt"?>
> > <?xml-logicsheet href="esql.xsl"?>
> > <?xml-stylesheet href="form4.xsl" type="text/xsl"?>
> >
> > <xsp:page
> >    language="java"
> >    xmlns:esql="http://apache.org/cocoon/SQL/v2"
> >    xmlns:util="http://www.apache.org/1999/XSP/Util"
> >    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> >    xmlns:xinclude="http://www.w3.org/TR/xinclude"
> >  >
> >
> > <page>
> >
> > <esql:execute-query>
> >         <xinclude:include parse="xml" xinclude:href="dbconnect.xml"/>
> > <esql:results>
> >
> > The dbconnect.xml just contains...
> >
> > <esql:driver>My.database.driver</esql:driver>
> > <esql:dburl>my.database/URL</esql:dburl>
> > <esql:username>uname</esql:username>
> > <esql:password>pword</esql:password>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>--
>/*
>* Hugh A. Cayless
>* Academic Web Developer, UNC College of Arts and Sciences
>* Project Manager, UNC Digital Library Project
>* 919-843-6260
>*/
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: xincluding Posted by Hugh Cayless <hc...@email.unc.edu>.
Your dbconnect.xml file isn't well-formed xml, and won't parse (no xml pi, no
root element).  Why not just use an external entity to include your file?

Best,
Hugh

Patrick van Kann wrote:

> Hello,
>
> Sorry for what must appear to be a fairly obvious/trivial problem, but I am
> having no success with getting <xincludes to, well, include anything. I
> have seen references to this problem in the archives but no solution...
>
> The code fragment below shows what I am trying to achieve. Can anyone see
> the (no doubt blindingly obvious) mistake I am making? Embarrassingly, I
> have struggled with this for 2 days and it's got me beat.
>
> Thanks, Patrick
>
> <?xml version="1.0"?>
> <?cocoon-process type="xinclude"?>
> <?cocoon-process type="xsp"?>
> <?cocoon-process type="xslt"?>
> <?xml-logicsheet href="esql.xsl"?>
> <?xml-stylesheet href="form4.xsl" type="text/xsl"?>
>
> <xsp:page
>    language="java"
>    xmlns:esql="http://apache.org/cocoon/SQL/v2"
>    xmlns:util="http://www.apache.org/1999/XSP/Util"
>    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>    xmlns:xinclude="http://www.w3.org/TR/xinclude"
>  >
>
> <page>
>
> <esql:execute-query>
>         <xinclude:include parse="xml" xinclude:href="dbconnect.xml"/>
> <esql:results>
>
> The dbconnect.xml just contains...
>
> <esql:driver>My.database.driver</esql:driver>
> <esql:dburl>my.database/URL</esql:dburl>
> <esql:username>uname</esql:username>
> <esql:password>pword</esql:password>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

--
/*
* Hugh A. Cayless
* Academic Web Developer, UNC College of Arts and Sciences
* Project Manager, UNC Digital Library Project
* 919-843-6260
*/