You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Brian <gi...@dipswitch.penguinpowered.com> on 2000/04/29 17:34:08 UTC

Questions about ant (a little off topic but..)

Hello all,

	I am a java developer and research scientist for the Human Genome
Project at MIT. I am using JRun+Servlets+Cocoon+other apache tools to set
up a web based tool to "view" some of the data that we generate. I have
a need for a build tool+CVS space, where the build tool is currently up
for grabs. Everyone is used to make, however I don't think I have to
mention the headaches that make can cause for the java developer. I would
like to propose ANT as our build tool of choice however, looking at the
source it is not completely obvious how to use it! Can someone point me to
a good overview of ANT or, lead me through making a project, project space
and build space? Thanks in advance!

						Sincerely, 

							Brian Gilman

---------------------------------
Brian Gilman		
Scientific Programmer
WhiteHead Institute 
MIT




Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
sudhi wrote:
> 
> If I change the name to resultp.xsl, then I see them in the code. Thats
> why it was complaining no style sheet found. This is a strange behaviour
> (Is it b'cos it has xsp in it ?)

Yeah, I think I had something like that, once.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by sudhi <su...@planet.net>.
I tried these things,
For the dynamically generated xml page, i applied a simple stylesheet(no
xsp in it). It works perfectly fine and very fast.
When I change the stylesheet to another stylesheet which has xsp in it,
there starts the problem.

I also did another thing, I displayed the dynamically generated xml, and
stored it in a file, Then applied the stylesheet which has xsp in it. It
worked fine.

The only problem I am seeing now is whenever both xml and xsl has xsp in
them, the problem starts.

~S

Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
sudhi wrote:
> 
> Its a simple page, i am executing one query, and the result set has max
> 30 elements. But its taking lot of time and I was not able to display
> the page, my browser times out :-(

You should do two things:

1.) comment out the reference to the stylesheet in your XML/XSP file
(that will send the XML unchanged to your browser, which will display an
empty page, but you can view the page source and see everything)

2.) increase the timeout of JServ in jserv.conf

Once you see the unadulterated XML you'll find the error quickly.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
sudhi wrote:
> 
> The style sheet used "result-xsp.xsl" also has XSP in it. Basically
> which transforms this xml into another xml.
> 
> which looks like this
> 
> ----------------------------------------------------------------------------------
> 
> <?xml version='1.0'?>
> <xsl:stylesheet version="1.0"
>        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >
> <xsl:template match="PAGE">
>   <xsl:processing-instruction
> name="cocoon-process">type="xslt"</xsl:processing-instruction><xsl:processing-instruction name="xml-stylesheet">href="result.xsl"
> type="text/xsl"</xsl:processing-instruction>        <xsl:copy>
>           <xsl:apply-templates/>
>         </xsl:copy>
> 
> </xsl:template>
> 
> <xsl:template match="*|@*|text()">
>  <xsl:copy-of select="."/>
> </xsl:template>
> </xsl:stylesheet>

This is definetely not an XSP, there is no XSP namespace declaration, no
<xsp:page> etc.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Fri, 19 May 2000, Ulrich Mayring wrote:

> Stefano Mazzocchi wrote:
> > 
> > Why don't you use XInclude?
> 
> Because it was nowhere announced that cocoon supports it? :)

Hrm, stefano beat me to all the suggestions today. I guess that's what I
get for waiting until 11:30pm to go through my mailing list mail. Yeah, I
threw together a minimal XInclude processor a week or two ago and
submitted it. I probably only made the announcement to the dev list (and
forgot to put it in changes.xml, shame on me). Please give it a whirl, I'd
like to know how useful people find both it and XInclude in general.

- donald


Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Stefano Mazzocchi wrote:
> 
> Why don't you use XInclude?

Because it was nowhere announced that cocoon supports it? :)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Jeremy Quinn wrote:
> 

[lots, and that just before I wanted to go home ;-]

> A Form TagLib would want to make use of a wide range of I/O TagLibs to read
> and write data; SQL, File, EMail, LDAP, FTP?, XML/RPC?, RMI?; the author
> would just use the one that makes the connection they want to make.

Wow, great vision.

> The difference between using an XInclude TagLib and the util:include...
> TagLib is that XInclude supports including document fragments using
> XPointer, it that correct? Are there other differences?

That's as far as I got as well. One difference is that XInclude uses
only URLs to locate a file (sensible), while <util:include-file> can
theoretically leave the document root.

> Would it make more sense to add write functionality to to the XInclude
> TagLib, muddying the waters?

It's hairy due to the XInclude processor being an implementation of the
XInclude W3C spec. I don't think W3C-compliance should be sacrificed.

> Or would it be better to start again with a full read/write XPointer savvy
> FileTagLib in parallel to the read/write functionality in the SQLTagLib?

What read/write functionality in the SQLTagLib are you referring to? I
think we should have a generic I/O taglib, that could receive an XPath
expression and move that data to wherever. For reading that data the
XInclude processor could be employed, for writing it we need something
else.

> Or write a FileWriteWithXPointer/util:save TagLib to complement
> XInclude/util:include?

Ummm... what? :)

> How important is the ability to read and write document fragments using
> XPointer in a Form Handling TagLib?

Can't say. I guess you don't absolutely need doc fragments, you can
always write to a temporary file and rename later. But that's not very
clean.

> I think the Form TagLib would need it's own way of defining how to modify a
> fragment in an existing document/query. I don't see that getting the whole
> document to work with instead of a fragment using XPointer makes much
> difference, all the data still has to be parsed. No?

ermm... I'm in high waters here... :)

Basically, for serialization we can use the Xerces serializers as shown
in Donald's XMLForm. Perhaps it would be enough to have a serialization
taglib, instead of a generic I/O taglib.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 23/5/00 at 9:55 am, ulim@denic.de (Ulrich Mayring) wrote:

>Donald Ball wrote:
>> 
>> Hmm. Logically speaking, your idea makes perfect sense, though I wonder
>> how efficient an XML file editor that worked like this would be... don't
>
>I think for applications, where you read the document 9 times and write
>it only one time, it would be sufficient. The Xerces serializers, that
>XMLForm uses, are also very sluggish when saving data.
>
>> care too much, myself, i'm more interested in working code than efficient
>> code. I wonder how this would tie into Jeremy's form taglib stuff...
>
>I didn't know Jeremy was onto that. But I always suspected he rules :)

I suspect not :) I am largly in the dark about how to actually implement this stuff, it's all I can manage at the moment to try and work out what it should be.

>But strictly speaking Forms and Include/Outclude are two different
>things. Forms provide a GUI for dealing with XML data - and there are
>many important things that a Form taglib could do. However, I think it
>should not read and write XML data, just as I/O should not model a user
>interface.
>
>Very frequently you need I/O without forms - any place where you've been
>using <util:include-uri> or <util:include-file>.
>
>And also very frequently you need forms without I/O (e.g. database query
>forms).

+1

A Form TagLib would need to serialise modified Document objects to XML files on disk, the same as other applications and TagLibs. It makes sense to seperate out this functionality rater than incorporate it into the Form TagLib as would have been the case.

A Form TagLib would want to make use of a wide range of I/O TagLibs to read and write data; SQL, File, EMail, LDAP, FTP?, XML/RPC?, RMI?; the author would just use the one that makes the connection they want to make.

The difference between using an XInclude TagLib and the util:include... TagLib is that XInclude supports including document fragments using XPointer, it that correct? Are there other differences?

Would it make more sense to add write functionality to to the XInclude TagLib, muddying the waters?

Or would it be better to start again with a full read/write XPointer savvy FileTagLib in parallel to the read/write functionality in the SQLTagLib?

Or write a FileWriteWithXPointer/util:save TagLib to complement XInclude/util:include?

How important is the ability to read and write document fragments using XPointer in a Form Handling TagLib? 

This ability won't be available from a Form TagLib for users of SQL (etc.) I/O will it?

I think the Form TagLib would need it's own way of defining how to modify a fragment in an existing document/query. I don't see that getting the whole document to work with instead of a fragment using XPointer makes much difference, all the data still has to be parsed. No?



reagrds Jeremy

      ____________________________________________________________________

      Jeremy Quinn                                             media.demon
                                                           webSpace Design
     <ma...@media.demon.co.uk>       <http://www.media.demon.co.uk>
      <phone:+44.[0].20.7737.6831>          <pa...@sms.genie.co.uk>



Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Donald Ball wrote:
> 
> Hmm. Logically speaking, your idea makes perfect sense, though I wonder
> how efficient an XML file editor that worked like this would be... don't

I think for applications, where you read the document 9 times and write
it only one time, it would be sufficient. The Xerces serializers, that
XMLForm uses, are also very sluggish when saving data.

> care too much, myself, i'm more interested in working code than efficient
> code. I wonder how this would tie into Jeremy's form taglib stuff...

I didn't know Jeremy was onto that. But I always suspected he rules :)

But strictly speaking Forms and Include/Outclude are two different
things. Forms provide a GUI for dealing with XML data - and there are
many important things that a Form taglib could do. However, I think it
should not read and write XML data, just as I/O should not model a user
interface.

Very frequently you need I/O without forms - any place where you've been
using <util:include-uri> or <util:include-file>.

And also very frequently you need forms without I/O (e.g. database query
forms).

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Jeremy Quinn wrote:
> 
> But please, just don't call it "outclude" :-p  <yeck! phht! bleh!>

Sorry, I'm just following the model the W3C set with XInclude ;-)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 23 May 2000, Jeremy Quinn wrote:

> On 22/5/00 at 1:43 pm, balld@webslingerZ.com (Donald Ball) wrote:
> 
> >Hmm. Logically speaking, your idea makes perfect sense, though I wonder
> >how efficient an XML file editor that worked like this would be... don't
> >care too much, myself, i'm more interested in working code than efficient
> >code. I wonder how this would tie into Jeremy's form taglib stuff...
> 
> It could tie in very nicely.
> 
> It would make sense in this context to have a writing counterpart to
> XInclude.
> 
> I hope to abstract the form taglib, so that any I/O TagLib (SQL, LDAP,
> file, etc.) can be dropped in to handle whichever data source you need
> to read or write.

If you're getting this complex, you would do well to examine castor
(http://castor.exolab.org/) for inspiration. I think you'll find that it
makes some things very easy. I am using it for my new database editor
package.

- donald


Re: XSP problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 22/5/00 at 1:43 pm, balld@webslingerZ.com (Donald Ball) wrote:

>Hmm. Logically speaking, your idea makes perfect sense, though I wonder
>how efficient an XML file editor that worked like this would be... don't
>care too much, myself, i'm more interested in working code than efficient
>code. I wonder how this would tie into Jeremy's form taglib stuff...

It could tie in very nicely.

It would make sense in this context to have a writing counterpart to XInclude.

I hope to abstract the form taglib, so that any I/O TagLib (SQL, LDAP, file, etc.) can be dropped in to handle whichever data source you need to read or write.


But please, just don't call it "outclude" :-p  <yeck! phht! bleh!>


regards Jeremy

      ____________________________________________________________________

      Jeremy Quinn                                             media.demon
                                                           webSpace Design
     <ma...@media.demon.co.uk>       <http://www.media.demon.co.uk>
      <phone:+44.[0].20.7737.6831>          <pa...@sms.genie.co.uk>



Re: XSP problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 22 May 2000, Ulrich Mayring wrote:

> Donald Ball wrote:
> > 
> > Sorry, yeah, look in the /samples/xinclude directory in CVS. I'd meant to
> > check 'em in a while back. A zip is attached for those without CVS. Oh,
> > yeah, you'll need to edit your cocoon.properties file and add this line:
> 
> Ok, I got it. It looks like I can specify what to include with an XPath
> expression - this is of course pretty powerful and I see no reason why
> it shouldn't solve the SQL taglib connection data inclusion problem.
> 
> This has set me off on another track, however: As it stands the XInclude
> processor does half of what XMLForm does, i.e. I can specify an XPath
> expression and whatever it selects is sent to another XML document for
> further manipulation. For taking that data and putting it into edit
> fields on an HTML form I don't strictly need XMLForm, I can write a
> taglib for that. So there's just one piece of the puzzle missing and
> that's writing out the changed XML. Perhaps we'd need an XOutclude
> processor (yeah, stupid name, but there it is ;-)  This processor takes
> an XPath expression and writes what it selects to a new file. We don't
> need to replace data in an existing file, like XMLForm does, because
> with XOutclude and XInclude we could do everything we want:
> 
> <xoutclude:outclude parse="xml" href="newfoo.xml#xpointer(//message)">
> 	<xinclude:include parse="xml"
> href="tmpfoo.xml#xpointer(//message[id='3'])"/>
> 	<xinclude:include parse="xml"
> href="oldfoo.xml#xpointer(//message[not(id='3')])"/>
> </xoutclude:outclude>
> 
> This example means that the user changed the message with ID 3 and in
> the first step these changes are written to a tmpfoo.xml. In the example
> above you can see that from tmpfoo.xml it is selected and written to
> newfoo.xml, whereas all unchanged messages (those with ID != 3) are
> taken from oldfoo.xml and added to newfoo.xml. We could add another
> option to rename newfoo.xml to oldfoo.xml at the end.
> 
> Perhaps the whole thing could also be encapsulated in a taglib and use
> xinclude/xoutclude only internally.

Hmm. Logically speaking, your idea makes perfect sense, though I wonder
how efficient an XML file editor that worked like this would be... don't
care too much, myself, i'm more interested in working code than efficient
code. I wonder how this would tie into Jeremy's form taglib stuff...

- donald


Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Donald Ball wrote:
> 
> Sorry, yeah, look in the /samples/xinclude directory in CVS. I'd meant to
> check 'em in a while back. A zip is attached for those without CVS. Oh,
> yeah, you'll need to edit your cocoon.properties file and add this line:

Ok, I got it. It looks like I can specify what to include with an XPath
expression - this is of course pretty powerful and I see no reason why
it shouldn't solve the SQL taglib connection data inclusion problem.

This has set me off on another track, however: As it stands the XInclude
processor does half of what XMLForm does, i.e. I can specify an XPath
expression and whatever it selects is sent to another XML document for
further manipulation. For taking that data and putting it into edit
fields on an HTML form I don't strictly need XMLForm, I can write a
taglib for that. So there's just one piece of the puzzle missing and
that's writing out the changed XML. Perhaps we'd need an XOutclude
processor (yeah, stupid name, but there it is ;-)  This processor takes
an XPath expression and writes what it selects to a new file. We don't
need to replace data in an existing file, like XMLForm does, because
with XOutclude and XInclude we could do everything we want:

<xoutclude:outclude parse="xml" href="newfoo.xml#xpointer(//message)">
	<xinclude:include parse="xml"
href="tmpfoo.xml#xpointer(//message[id='3'])"/>
	<xinclude:include parse="xml"
href="oldfoo.xml#xpointer(//message[not(id='3')])"/>
</xoutclude:outclude>

This example means that the user changed the message with ID 3 and in
the first step these changes are written to a tmpfoo.xml. In the example
above you can see that from tmpfoo.xml it is selected and written to
newfoo.xml, whereas all unchanged messages (those with ID != 3) are
taken from oldfoo.xml and added to newfoo.xml. We could add another
option to rename newfoo.xml to oldfoo.xml at the end.

Perhaps the whole thing could also be encapsulated in a taglib and use
xinclude/xoutclude only internally.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Fri, 19 May 2000, Jeremy Quinn wrote:

> On 19/5/00 at 2:54 pm, stefano@apache.org (Stefano Mazzocchi) wrote:
> 
> >Why don't you use XInclude?
> 
> Has anyone got any examples?
> 
> cheers
> 
> Jeremy

Sorry, yeah, look in the /samples/xinclude directory in CVS. I'd meant to
check 'em in a while back. A zip is attached for those without CVS. Oh,
yeah, you'll need to edit your cocoon.properties file and add this line:

processor.type.xinclude = org.apache.cocoon.processor.xinclude.XIncludeProcessor

- donald

Re: XSP problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 19/5/00 at 2:54 pm, stefano@apache.org (Stefano Mazzocchi) wrote:

>Why don't you use XInclude?

Has anyone got any examples?

cheers

Jeremy

      ____________________________________________________________________

      Jeremy Quinn                                             media.demon
                                                           webSpace Design
     <ma...@media.demon.co.uk>       <http://www.media.demon.co.uk>
      <phone:+44.[0].207.737.6831>          <pa...@sms.genie.co.uk>




Re: XSP problem

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Kevin Sonney wrote:
> >
> > Ah-ha. This uses XSP then calls the SQL Processor. Why not use the SQL
> > TagLib instead :
> 
> [deleted convoluted query syntax]
> 
> Perhaps I'm dumb and don't see the light, but the sql taglib is too
> verbose to be useful for me. I have many, many queries in many, many XML
> files. With the SQL Processor I just define my connection parameters
> once and re-use them for every query. With the SQL taglib the code
> becomes unmaintainable - what if the database user changes or the
> password or ... ? I have to edit every query in every XML file I have.
> Folks: this was yesterday, today is cocoon :)

Why don't you use XInclude?
 
> With the SQLProcessor I can have one connection.xml file and that gets
> included in every XML page that has queries. That also means I can give
> my files to other users to edit, because they contain no
> username/password for the database.

See above.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Rob Parker wrote:
> 
> Agree - so does this mean you need to define your own cutom tag where
> you specify just the dynamic parts of your SQL, ie the query and a
> stylesheet
> to fill in the static parts, ie, user/password etc etc.

Basically I want just placeholders in my XML and store their values
centrally in one place. The SQLProcessor does this nicely.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 22 May 2000, Ulrich Mayring wrote:

> Donald Ball wrote:
> > 
> > Again - can you give me a good reason why you couldn't use the XInclude
> > processor to give you this? Note I may well be overruled here, but I'd
> > like you to at least give it a shot...
> 
> Yes, the good reason is: I don't know how to use this thing and I don't
> know where to find docs.

docs, docs - the XInclude working draft is here

http://www.w3.org/TR/xinclude

I have some samples in cocoon CVS (maybe in 1.7.4, can't remember) -
samples/xinclude/*

- donald


Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Donald Ball wrote:
> 
> Again - can you give me a good reason why you couldn't use the XInclude
> processor to give you this? Note I may well be overruled here, but I'd
> like you to at least give it a shot...

Yes, the good reason is: I don't know how to use this thing and I don't
know where to find docs.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Fri, 19 May 2000, Rob Parker wrote:

> ----- Original Message -----
> From: Ulrich Mayring <ul...@denic.de>
> >
> > Perhaps I'm dumb and don't see the light, but the sql taglib is too
> > verbose to be useful for me. I have many, many queries in many, many XML
> > files. With the SQL Processor I just define my connection parameters
> > once and re-use them for every query. With the SQL taglib the code
> > becomes unmaintainable - what if the database user changes or the
> > password or ... ? I have to edit every query in every XML file I have.
> > Folks: this was yesterday, today is cocoon :)
> >
> Agree - so does this mean you need to define your own cutom tag where
> you specify just the dynamic parts of your SQL, ie the query and a
> stylesheet
> to fill in the static parts, ie, user/password etc etc.

Again - can you give me a good reason why you couldn't use the XInclude
processor to give you this? Note I may well be overruled here, but I'd
like you to at least give it a shot...

- donald


Re: XSP problem

Posted by Rob Parker <ro...@webcybernetics.com>.
----- Original Message -----
From: Ulrich Mayring <ul...@denic.de>
>
> Perhaps I'm dumb and don't see the light, but the sql taglib is too
> verbose to be useful for me. I have many, many queries in many, many XML
> files. With the SQL Processor I just define my connection parameters
> once and re-use them for every query. With the SQL taglib the code
> becomes unmaintainable - what if the database user changes or the
> password or ... ? I have to edit every query in every XML file I have.
> Folks: this was yesterday, today is cocoon :)
>
Agree - so does this mean you need to define your own cutom tag where
you specify just the dynamic parts of your SQL, ie the query and a
stylesheet
to fill in the static parts, ie, user/password etc etc.



Re: XSP problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 22 May 2000, Ulrich Mayring wrote:

> Donald Ball wrote:
> > 
> > Can you try out the XInclude processor and see if the functionality it
> > gives you is good enough for your purposes?
> 
> I'd love to, what is it? Where can I find it?

org.apache.cocoon.processor.xinclude.XIncludeProcessor. Just add this line
to your cocoon.properties file:

processor.type.xinclude = org.apache.cocoon.processor.xinclude.XIncludeProcessor

and give it a whirl.

- donald


Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Donald Ball wrote:
> 
> Can you try out the XInclude processor and see if the functionality it
> gives you is good enough for your purposes?

I'd love to, what is it? Where can I find it?

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Fri, 19 May 2000, Ulrich Mayring wrote:

> Kevin Sonney wrote:
> > 
> > Ah-ha. This uses XSP then calls the SQL Processor. Why not use the SQL
> > TagLib instead :
> 
> [deleted convoluted query syntax]
> 
> Perhaps I'm dumb and don't see the light, but the sql taglib is too
> verbose to be useful for me. I have many, many queries in many, many XML
> files. With the SQL Processor I just define my connection parameters
> once and re-use them for every query. With the SQL taglib the code
> becomes unmaintainable - what if the database user changes or the
> password or ... ? I have to edit every query in every XML file I have.
> Folks: this was yesterday, today is cocoon :)
> 
> With the SQLProcessor I can have one connection.xml file and that gets
> included in every XML page that has queries. That also means I can give
> my files to other users to edit, because they contain no
> username/password for the database.

Can you try out the XInclude processor and see if the functionality it
gives you is good enough for your purposes?

- donald


Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
Kevin Sonney wrote:
> 
> Ah-ha. This uses XSP then calls the SQL Processor. Why not use the SQL
> TagLib instead :

[deleted convoluted query syntax]

Perhaps I'm dumb and don't see the light, but the sql taglib is too
verbose to be useful for me. I have many, many queries in many, many XML
files. With the SQL Processor I just define my connection parameters
once and re-use them for every query. With the SQL taglib the code
becomes unmaintainable - what if the database user changes or the
password or ... ? I have to edit every query in every XML file I have.
Folks: this was yesterday, today is cocoon :)

With the SQLProcessor I can have one connection.xml file and that gets
included in every XML page that has queries. That also means I can give
my files to other users to edit, because they contain no
username/password for the database.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by sudhi <su...@planet.net>.
> *SNIP*
> 
> Ah-ha. This uses XSP then calls the SQL Processor. Why not use the SQL
> TagLib instead :
> 

I changed all cocoon PI orders.

> 
> The last stylesheet didn't have anything xsp in it, just regular XSLT. You
> cannot run a second XSP pass on a single document. I wish you could,
> some days, but...
> 

Yeah, the style sheet dont have any xsp in it. That was just a test xsl.

When I first posted this question , that was what I was asking. Can I
run a sesconf XSP pass on a single document.

Thanks for the help 
:-(
~S

Re: XSP problem

Posted by Kevin Sonney <ke...@webslingerz.com>.
On Thu, 18 May 2000, sudhi wrote:
> Here is the snippet
> 
> I have an xml page (result.xml), part of it is generated by xsp.
> here is the snippet..
> ----------------------------------------------------------------------------------
> 
> <?xml version="1.0" standalone="no"?>
> <?cocoon-process type="xsp"?>
> <?cocoon-process type="sql"?>
> <?cocoon-process type="xslt"?>
*SNIP*

Ah-ha. This uses XSP then calls the SQL Processor. Why not use the SQL
TagLib instead :

------- begin Doc ---------
<?xml version="1.0" standalone="no"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="result-xsp.xsl" type="text/xsl"?>

<xsp:page 
language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:sql="http://www.apache.org/1999/SQL"
>

<PAGE>
   <TITLE>Search result</TITLE>
   <CONTENT>
   <xsp:logic>
     ... build the sql query dynamically based on some criteria ....
   </xsp:logic>
   <sql:execute-query>
	<sql:max-rows>10</sql:max-rows>
	<sql:update-rows-attribute>updated</sql:update-rows-attribute>
	<sql:driver>org.jgt.mm.mysql.Driver</sql:driver>
	<sql:dburl>jdbc:mysql://servername/database</sql:dburl>
	<sql:username>username</sql:username>
	<sql:password>password</sql:password>
	<sql:skip-rows>0</sql:skip-rows>
	<sql:tag-case>lower</sql:tag-case>
	<sql:doc-element>rowset</sql:doc-element>
	<sql:row-element>row</sql:row-element>
	<sql:query><xsp:logic>...stuff...</xsp:logic></sql:query>
   </sql:execute-query>
   </CONTENT>
 </PAGE>
</xsp:page>

-------End Doc---------

The last stylesheet didn't have anything xsp in it, just regular XSLT. You
cannot run a second XSP pass on a single document. I wish you could,
some days, but...

-- 
- Kevin Sonney
  kevin@webslingerZ.com


Re: XSP problem

Posted by sudhi <su...@planet.net>.
Here is the snippet

I have an xml page (result.xml), part of it is generated by xsp.
here is the snippet..
----------------------------------------------------------------------------------

<?xml version="1.0" standalone="no"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="sql"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="result-xsp.xsl" type="text/xsl"?>

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

<PAGE>
 <connectiondefs>
  <connection name="foo_connection">
   <driver>org.gjt.mm.mysql.Driver</driver>
   <dburl>jdbc:mysql://my.domain.com/my_database</dburl>
   <username>user</username>
   <password>password</password>
  </connection>
 </connectiondefs> 

  <TITLE>Search result</TITLE>
  <CONTENT>
  <xsp:logic>
    ... build the sql query dynamically based on some criteria ....
  </xsp:logic>
  <query connection="foo_connection">
      <xsp:expr>query</xsp:expr> 
  </query>
  </CONTENT>
</PAGE>
</xsp:page>
----------------------------------------------------------------------------------

The style sheet used "result-xsp.xsl" also has XSP in it. Basically
which transforms this xml into another xml.

which looks like this

----------------------------------------------------------------------------------
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="PAGE">
  <xsl:processing-instruction
name="cocoon-process">type="xslt"</xsl:processing-instruction>  
  <xsl:processing-instruction name="xml-stylesheet">href="result.xsl"
type="text/xsl"</xsl:processing-instruction>  
  
        <xsl:copy>
          <xsl:apply-templates/>
        </xsl:copy> 

</xsl:template>

<xsl:template match="*|@*|text()">
 <xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
----------------------------------------------------------------------------------

~S

Re: XSP problem

Posted by Kevin Sonney <ke...@webslingerz.com>.
On Thu, 18 May 2000, sudhi wrote:
> > I usually see this when I'm executing a *LOT* of queries in a single page,
> > or I'm gettin a lot of results back from the server. Especially if I'm
> > apssing dynamic data to the xsp sheet.
> 
> Its a simple page, i am executing one query, and the result set has max
> 30 elements. But its taking lot of time and I was not able to display
> the page, my browser times out :-(

Hmm. Can you show us a sample of the code? usernames and passwords changed
to protect the innocent, of course *grin*.

-- 
- Kevin Sonney
  kevin@webslingerZ.com


Re: XSP problem

Posted by sudhi <su...@planet.net>.
> 
> I usually see this when I'm executing a *LOT* of queries in a single page,
> or I'm gettin a lot of results back from the server. Especially if I'm
> apssing dynamic data to the xsp sheet.
> 

Its a simple page, i am executing one query, and the result set has max
30 elements. But its taking lot of time and I was not able to display
the page, my browser times out :-(


~S

Re: XSP problem

Posted by Kevin Sonney <ke...@webslingerz.com>.
On Thu, 18 May 2000, sudhi wrote:
> Yeah...
> I have the same root element in both of them. 
> One more thing was, the first xsl stylesheet name was result-xsp.xsl. If
> I have this style sheet inserted into the document, i dont see these
> lines in the converted java file.
> -----------------------------
> document.appendChild(
>             document.createProcessingInstruction(
>               "xml-stylesheet",
>               "href=\"resultp.xsl\" type=\"text/xsl\""
>             )
>           );
>         
> -------------------------------------------------
> 
> If I change the name to resultp.xsl, then I see them in the code. Thats
> why it was complaining no style sheet found. This is a strange behaviour
> (Is it b'cos it has xsp in it ?)

That's weird. I ahve no idea.

> When i change this, it wont complain but it takes too long to get the
> result back. Most of the time the browser times out.

I usually see this when I'm executing a *LOT* of queries in a single page,
or I'm gettin a lot of results back from the server. Especially if I'm
apssing dynamic data to the xsp sheet.  

-- 
- Kevin Sonney
  kevin@webslingerZ.com


Re: XSP problem

Posted by sudhi <su...@planet.net>.
Yeah...
I have the same root element in both of them. 
One more thing was, the first xsl stylesheet name was result-xsp.xsl. If
I have this style sheet inserted into the document, i dont see these
lines in the converted java file.
-----------------------------
document.appendChild(
            document.createProcessingInstruction(
              "xml-stylesheet",
              "href=\"resultp.xsl\" type=\"text/xsl\""
            )
          );
        
-------------------------------------------------

If I change the name to resultp.xsl, then I see them in the code. Thats
why it was complaining no style sheet found. This is a strange behaviour
(Is it b'cos it has xsp in it ?)

When i change this, it wont complain but it takes too long to get the
result back. Most of the time the browser times out.

So strange :-(

~S

Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
sudhi wrote:
> 
> If my PI's are wrong how does it works fine for a static xml file.
> Can I use xsp in both xml and xsl at the same time ?

Yes, you can use XSP in an XSL stylesheet as well.

One other thing that comes to my mind is: do you have a single root
element in the XSP page and in the page you create from your XSP page?

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSP problem

Posted by sudhi <su...@planet.net>.
If my PI's are wrong how does it works fine for a static xml file.
Can I use xsp in both xml and xsl at the same time ?

Ulrich Mayring wrote:
> 
> sudhi wrote:
> >
> > But when i try to view this, I get an error message saying that
> > " Could not associate stylesheet to document:  no matching stylesheet
> > for: netscape "
> >
> > What am I doing wrong here ?
> 
> This means there is a problem with your PIs, it has nothing to do with
> XSLT templates or XSP code.
> 
> Ulrich
> 
> --
> Ulrich Mayring
> DENIC eG, Systementwicklung
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Re: XSP problem

Posted by Ulrich Mayring <ul...@denic.de>.
sudhi wrote:
> 
> But when i try to view this, I get an error message saying that
> " Could not associate stylesheet to document:  no matching stylesheet
> for: netscape "
> 
> What am I doing wrong here ?

This means there is a problem with your PIs, it has nothing to do with
XSLT templates or XSP code.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

XSP problem

Posted by sudhi <su...@planet.net>.
Hi,
I don't know what I am doing is right or wrong.
Here is what I am doing.
I have an xml page (result.xml), part of it is generated by xsp.
here is the snippet..
----------------------------------------------------------------------------------

<?xml version="1.0" standalone="no"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="sql"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="result-xsp.xsl" type="text/xsl"?>

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

<PAGE>
 <connectiondefs>
  <connection name="foo_connection">
   <driver>org.gjt.mm.mysql.Driver</driver>
   <dburl>jdbc:mysql://my.domain.com/my_database</dburl>
   <username>user</username>
   <password>password</password>
  </connection>
 </connectiondefs> 

  <TITLE>Search result</TITLE>
  <CONTENT>
  <xsp:logic>
    ... build the sql query dynamically based on some criteria ....
  </xsp:logic>
  <query connection="foo_connection">
      <xsp:expr>query</xsp:expr> 
  </query>
  </CONTENT>
</PAGE>
</xsp:page>
----------------------------------------------------------------------------------

The style sheet used "result-xsp.xsl" also has XSP in it. Basically
which transforms this xml into another xml.

which looks like this

----------------------------------------------------------------------------------
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="PAGE">
  <xsl:processing-instruction
name="cocoon-process">type="xslt"</xsl:processing-instruction>  
  <xsl:processing-instruction name="xml-stylesheet">href="result.xsl"
type="text/xsl"</xsl:processing-instruction>  
  
  	<xsl:copy>
  	  <xsl:apply-templates/>
  	</xsl:copy> 

</xsl:template>

<xsl:template match="*|@*|text()">
 <xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
----------------------------------------------------------------------------------

The stylesheet specified in the above xsl transforms xml into html.

But when i try to view this, I get an error message saying that
" Could not associate stylesheet to document:  no matching stylesheet
for: netscape "

What am I doing wrong here ?

The same thing works if I have the first document as static.

Thanks in advance for any help
~Sudhi

Re: Questions about ant (a little off topic but..)

Posted by Darryl Stoflet <ds...@calweb.com>.
Brian,

There is an Ant user manual here:
http://jakarta.apache.org/cvsweb/index.cgi/~checkout~/jakarta-ant/docs/index.html?rev=1.17&content-type=text/html
Also, when you download Ant this file is under the docs directory.
If you download the Ant sources you can even persue the build.xml file
that is used to build Ant to see a fairly complicated build file to 
learn from.
It does not take long at all to get up to speed on creating build.xml
files and it is totally extensible, if there is not a task within
Ant that does what you need you can write one yourself. For instance
we have an ejbc and ejbdeploy task to automate creating ejb jars
and deploying them to our ejb server.

/Darryl Stoflet

Brian wrote:
> 
> Hello all,
> 
>         I am a java developer and research scientist for the Human Genome
> Project at MIT. I am using JRun+Servlets+Cocoon+other apache tools to set
> up a web based tool to "view" some of the data that we generate. I have
> a need for a build tool+CVS space, where the build tool is currently up
> for grabs. Everyone is used to make, however I don't think I have to
> mention the headaches that make can cause for the java developer. I would
> like to propose ANT as our build tool of choice however, looking at the
> source it is not completely obvious how to use it! Can someone point me to
> a good overview of ANT or, lead me through making a project, project space
> and build space? Thanks in advance!
> 
>                                                 Sincerely,
> 
>                                                         Brian Gilman
> 
> ---------------------------------
> Brian Gilman
> Scientific Programmer
> WhiteHead Institute
> MIT
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

-- 
Darryl Stoflet
http://dstoflet.calweb.com