You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Darren Scott <ds...@bluecheese.co.uk> on 2000/02/14 17:34:12 UTC

XML Query language

Hello members,

Glad to join the list. I've been keeping my eye on Cocoon since it's
launch (at the time, I was formulating something similar, but dropped it
to save replicating the good work already done by the Apache team), and
I have just decided it's time to start to seriously look at revamping
our content delivery model ala XSL/XML.

Cocoon's come quite a way already, and things are looking even better
with Cocoon 2!

I have a question - does Cocoon support some sort of query language like
XPath or XQL for selecting sub-trees of the XML source via the URL. (I
beleive XQL was designed to be usable in the resource part of a URL).

Specifically, I have an XML doc with multiple language translations,
which I would like to render using the same XSL document using something
like:

http://www.something.com/index.xml#en

If such support isn't already there, I'd be happy to do some
implementation since I think it would be a powerful feature to have -
the alternatives I've looked at to acheive the same effect in Cocoon
without querying seemed messy.

Regards,

Darren Scott
Technical Director
bluecheese.co.uk

Re: cocoon install question

Posted by William Kuhn <wk...@biostat.ufl.edu>.
Michele,

Awesome!  Thanks a lot for the help.

I guess I didn't understand the format of the parameter to pass.  I
tried -Xms 4000000 and other variations and I couldn't find
documentation on the java command line options.

Thanks again for the help.  I made the change to jserv.properties,
restarted apache, and cocoon registers the memory.

-Bill

Michele Bianchi wrote:
> 
> On Mon, 14 Feb 2000, William Kuhn wrote:
> 
> > In the meantime I managed to figure out that one problem was that cocoon
> > was complaining about not enough memory.  I'm running it on rh6.1.  I
> 
> i resolved the problem adding this line to jserv.properties (i use apache jserv
> 1.1)
> 
> wrapper.bin.parameters="-ms4M"
> 
> that sets 4mb to the virtual machine (1.1), if you have the 1.2 is -Xms4M
> 
> michele
> 
> -------------------------------------------------------------------------------
> michele bianchi - telcordia technologies               http://mic.aesthetica.it
> 445 south street, mcc 1d316r                                  t +1 973 829 4117
> morristown, nj 07960                                          f +1 973 829 5981

-- 
Bill Kuhn
Coordinator of Computer Applications
Division of Biostatistics
University of Florida

Re: cocoon install question

Posted by Michele Bianchi <mi...@research.telcordia.com>.
On Mon, 14 Feb 2000, William Kuhn wrote:

> In the meantime I managed to figure out that one problem was that cocoon
> was complaining about not enough memory.  I'm running it on rh6.1.  I

i resolved the problem adding this line to jserv.properties (i use apache jserv
1.1)

wrapper.bin.parameters="-ms4M"

that sets 4mb to the virtual machine (1.1), if you have the 1.2 is -Xms4M

michele

-------------------------------------------------------------------------------
michele bianchi - telcordia technologies               http://mic.aesthetica.it
445 south street, mcc 1d316r                                  t +1 973 829 4117
morristown, nj 07960                                          f +1 973 829 5981


Re: cocoon install question

Posted by William Kuhn <wk...@biostat.ufl.edu>.
Donald,

Thanks for the help.  I didn't realize that this wasn't the right
mailing list.  I guess in my mind my questions were cocoon related, but
as I got to the heart of the problems they turned out to be java and
jserv/apache related.  Another member of this list already responded
similarly with respect to my java related question.  Not that it matters
now, but I'm running sun's jdk1.2.2. :-)

Your Action/AddHandler suggestion worked perfectly.  Thanks.

Thanks for your assistance and sorry again to you and other members of
the list for introducing and irrelevant post.

-Bill
Donald Ball wrote:
> 
> On Mon, 14 Feb 2000, William Kuhn wrote:
> 
> > In the meantime I managed to figure out that one problem was that cocoon
> > was complaining about not enough memory.  I'm running it on rh6.1.  I
> > read the documentation that addressed this condition and was even more
> > confused.  It said the preferred method of solving this problem is to
> > pass command line options to the java interpreter.  I tracked down the
> > correct property in one of the jserv configuration files, but prior to
> > adding the options (-Xms and -Xmx) I figured I'd try the options on the
> > command line.  I'm not sure what units the memory are to be given in
> > (bytes, kb, or mb??) so I tried sensible options for all three with no
> > success.  What I mean by sensible is that the minimum initial (-Xms)
> > needs to be less than the max (-Xmx).  In all cases, however, I received
> > an error message that said that the minimum must be less than the
> > maximum which didn't make any sense since I had set the minimum less
> > than the maximum.
> 
> These parameters are JVM specific. You don't say in this post what JVM
> you're using, nor is this necessary the appropriate forum for such
> questions. You will almost certainly have better luck going through the
> docs for your JVM or posting to a list for your JVM. That being said,
> however, if you're using JDK-1.2.x for Linux, you can type:
> 
> java -X
> 
> for a list of nonstandard options. Likely you want something like this:
> 
> java -Xms16m -Xmx64m
> 
> minimum 16m, maximum 64m.
> 
> > So, then I tried to *increase* the memory in cocoon.properties to 2x10^6
> > (from the default of 2x10^5) and that didn't help.  Reading the
> > documentation a little further it appeared that *decreasing* this
> > setting might help get cocoon working (albeit not optimally) so I
> > dropped it to 2000.  Cocoon seemed to work then.  I'm not satisfied with
> > this approach and would like some advice on how to set up cocoon
> > properly for production use.  Any help would be appreciated.
> 
> The store.memory property apparantly is just a sanity check - it's the
> number of bytes that must be free what cocoon starts or else there's a
> good chance that we'll run out of memory at some point. I think this is an
> ugly hack, myself. Upping the maximum amount of memory allowed for your
> JVM should help.
> 
> > Okay, so now cocoon is running but when I request .xml documents my web
> > server returns the .xml file rather than passing the request to the
> > cocoon servlet.  I followed the instructions and added the ApJservAction
> > line to jserv.conf.  I saw mention on a message board that Action and
> > AddHandler could somehow be used to overcome this problem, but what I
> > read didn't give specifics.  I could use any help I can get.  The only
> > way I can run cocoon currently is to request (for example)
> > http://localhost/servlets/cocoon/somepath/somefile.xml.
> 
> in your .htaccess files:
> 
> Action cocoonparse /servlets/cocoon
> AddHandler cocoonparser .xml
> 
> That's what I use. More questions regarding this likely oughta be taken to
> the apache-jserv-users list - you'll get faster better answers. :)
> 
> - donald

-- 
Bill Kuhn
Coordinator of Computer Applications
Division of Biostatistics
University of Florida

Re: cocoon install question

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 14 Feb 2000, William Kuhn wrote:

> In the meantime I managed to figure out that one problem was that cocoon
> was complaining about not enough memory.  I'm running it on rh6.1.  I
> read the documentation that addressed this condition and was even more
> confused.  It said the preferred method of solving this problem is to
> pass command line options to the java interpreter.  I tracked down the
> correct property in one of the jserv configuration files, but prior to
> adding the options (-Xms and -Xmx) I figured I'd try the options on the
> command line.  I'm not sure what units the memory are to be given in
> (bytes, kb, or mb??) so I tried sensible options for all three with no
> success.  What I mean by sensible is that the minimum initial (-Xms)
> needs to be less than the max (-Xmx).  In all cases, however, I received
> an error message that said that the minimum must be less than the
> maximum which didn't make any sense since I had set the minimum less
> than the maximum.

These parameters are JVM specific. You don't say in this post what JVM
you're using, nor is this necessary the appropriate forum for such
questions. You will almost certainly have better luck going through the
docs for your JVM or posting to a list for your JVM. That being said,
however, if you're using JDK-1.2.x for Linux, you can type:

java -X

for a list of nonstandard options. Likely you want something like this:

java -Xms16m -Xmx64m

minimum 16m, maximum 64m.

> So, then I tried to *increase* the memory in cocoon.properties to 2x10^6
> (from the default of 2x10^5) and that didn't help.  Reading the
> documentation a little further it appeared that *decreasing* this
> setting might help get cocoon working (albeit not optimally) so I
> dropped it to 2000.  Cocoon seemed to work then.  I'm not satisfied with
> this approach and would like some advice on how to set up cocoon
> properly for production use.  Any help would be appreciated.

The store.memory property apparantly is just a sanity check - it's the
number of bytes that must be free what cocoon starts or else there's a
good chance that we'll run out of memory at some point. I think this is an
ugly hack, myself. Upping the maximum amount of memory allowed for your
JVM should help.

> Okay, so now cocoon is running but when I request .xml documents my web
> server returns the .xml file rather than passing the request to the
> cocoon servlet.  I followed the instructions and added the ApJservAction
> line to jserv.conf.  I saw mention on a message board that Action and
> AddHandler could somehow be used to overcome this problem, but what I
> read didn't give specifics.  I could use any help I can get.  The only
> way I can run cocoon currently is to request (for example)
> http://localhost/servlets/cocoon/somepath/somefile.xml.

in your .htaccess files:

Action cocoonparse /servlets/cocoon
AddHandler cocoonparser .xml

That's what I use. More questions regarding this likely oughta be taken to
the apache-jserv-users list - you'll get faster better answers. :)

- donald


cocoon install question

Posted by William Kuhn <wk...@biostat.ufl.edu>.
I posted some questions/problems I was having getting cocoon installed,
but never got any replies.

In the meantime I managed to figure out that one problem was that cocoon
was complaining about not enough memory.  I'm running it on rh6.1.  I
read the documentation that addressed this condition and was even more
confused.  It said the preferred method of solving this problem is to
pass command line options to the java interpreter.  I tracked down the
correct property in one of the jserv configuration files, but prior to
adding the options (-Xms and -Xmx) I figured I'd try the options on the
command line.  I'm not sure what units the memory are to be given in
(bytes, kb, or mb??) so I tried sensible options for all three with no
success.  What I mean by sensible is that the minimum initial (-Xms)
needs to be less than the max (-Xmx).  In all cases, however, I received
an error message that said that the minimum must be less than the
maximum which didn't make any sense since I had set the minimum less
than the maximum.

So, then I tried to *increase* the memory in cocoon.properties to 2x10^6
(from the default of 2x10^5) and that didn't help.  Reading the
documentation a little further it appeared that *decreasing* this
setting might help get cocoon working (albeit not optimally) so I
dropped it to 2000.  Cocoon seemed to work then.  I'm not satisfied with
this approach and would like some advice on how to set up cocoon
properly for production use.  Any help would be appreciated.

Okay, so now cocoon is running but when I request .xml documents my web
server returns the .xml file rather than passing the request to the
cocoon servlet.  I followed the instructions and added the ApJservAction
line to jserv.conf.  I saw mention on a message board that Action and
AddHandler could somehow be used to overcome this problem, but what I
read didn't give specifics.  I could use any help I can get.  The only
way I can run cocoon currently is to request (for example)
http://localhost/servlets/cocoon/somepath/somefile.xml.

I'd be very appreciative if someone could take a couple of minutes to
help me.  I think that cocoon is a powerful tool and I have several
applications for it that are on hold until I can get it working
properly.

Thanks in advance for whoever answers.

-Bill
-- 
Bill Kuhn
Coordinator of Computer Applications
Division of Biostatistics
University of Florida

Re: XML Query language

Posted by Darren Scott <ds...@bluecheese.co.uk>.
Stefano Mazzocchi wrote:
> 
> I would strongly discouradge the implementation of such a addressing
> space. URLs are contracts and they should not change nor include
> information that trigger some dynamic content processing on the server
> side.
> 

I sorta agree in principle, but then that is exactly what Cocoon does,
particularly when using the media type negotiation. Also, I can't find
the actual RFC (damn it) but I remember reading that the # part of a URL
is left open to interpretation by the server, but that it should
generally be for locating specific parts (or nodes) of the resource,
which is what I propose it be used as.

If there is an argument against it, then it would be from either a
security standpoint - i.e. a user may be able to access parts of a
document to which he/she should not be able to, although this could
easily be avoided by the author. The other argument surely should be
from a compatibility standpoint - in that because browsers choose to
interpret the # part themselves, that has become the norm.

> As far as localization goes, a getter way to do it would be to clone
> apache functionalities on this side... but you need a sitemap for
> that... which means you need Cocoon2 functionalities.
> 
> > If such support isn't already there, I'd be happy to do some
> > implementation since I think it would be a powerful feature to have -
> > the alternatives I've looked at to acheive the same effect in Cocoon
> > without querying seemed messy.
> 
> In Cocoon 1.x? Totally agreed. But once you have a sitemap in place, I
> see much better ways of doing things like these....

I don't know about sitemaps, is there more info on xml.apache.org? Can
you give me an indication of the better ways.

> At the end, more and more people think at XML as a data-storage
> facility. And XPath as a good way of replacing queries and get a hold on
> the required data. Also, some want to add Persistent-DOM capabilities to
> totally eliminate database requirements...

I think it is becoming a given that XML data storage engines like
Excelon will enventually replace RDBMS' - XPath was designed to cope
with this very fundmental shift from an orientation towards applications
to an orientation towards documents.

> Well, this is _exactly_ one scary thing about XML: it's too flexible.
> Many don't see (yet!) the problems that lay ahead.

I agree. I don't want to appear argumentative (I love a debate), but I
am unconvinced. Have you considered this issue before? What were your
conclusions? Have the W3C reconsidered their position on using XPath in
a URL (I think it was called XQL at the time).

Regards,

Darren Scott
Technical Director
bluecheese.co.uk

Re: XML Query language

Posted by Stefano Mazzocchi <st...@apache.org>.
Darren Scott wrote:
> 
> Hello members,
> 
> Glad to join the list. I've been keeping my eye on Cocoon since it's
> launch (at the time, I was formulating something similar, but dropped it
> to save replicating the good work already done by the Apache team), and
> I have just decided it's time to start to seriously look at revamping
> our content delivery model ala XSL/XML.
> 
> Cocoon's come quite a way already, and things are looking even better
> with Cocoon 2!
> 
> I have a question - does Cocoon support some sort of query language like
> XPath or XQL for selecting sub-trees of the XML source via the URL. (I
> beleive XQL was designed to be usable in the resource part of a URL).
> 
> Specifically, I have an XML doc with multiple language translations,
> which I would like to render using the same XSL document using something
> like:
> 
> http://www.something.com/index.xml#en

I would strongly discouradge the implementation of such a addressing
space. URLs are contracts and they should not change nor include
information that trigger some dynamic content processing on the server
side.

As far as localization goes, a getter way to do it would be to clone
apache functionalities on this side... but you need a sitemap for
that... which means you need Cocoon2 functionalities.

> If such support isn't already there, I'd be happy to do some
> implementation since I think it would be a powerful feature to have -
> the alternatives I've looked at to acheive the same effect in Cocoon
> without querying seemed messy.

In Cocoon 1.x? Totally agreed. But once you have a sitemap in place, I
see much better ways of doing things like these....

At the end, more and more people think at XML as a data-storage
facility. And XPath as a good way of replacing queries and get a hold on
the required data. Also, some want to add Persistent-DOM capabilities to
totally eliminate database requirements...

Well, this is _exactly_ one scary thing about XML: it's too flexible.
Many don't see (yet!) the problems that lay ahead.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------