You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Frank Ridderbusch <fr...@gmx.de> on 2001/02/06 00:10:11 UTC

[C1.8.2] ESQL question in particular

Hi folks,

I'm doing my first steps with Cocoon and esql and I'm trying to port
something I created with Oracles xsql utility to esql.

I'm retrieving the results of the query with the <esql:get-columns/>
tag. 

First of all I would like to ask, how I can achieve a more vertical
formating of the resulting xml. Instead of 

<rowset>
  <row><col1>...</col1><col2>...</col2><col3>...</col3>...</row>
</rowset>

I would like

<rowset>
  <row>
    <col1>...</col1>
    <col2>...</col2>
    <col3>...</col3>
    ...
  </row>
</rowset>

I simply find the more vertical format easier on the eye, when I'm in
the need to directly look at the XML. 

Second, I like to ask, how I can suppress null columns? For instance,
my query returns 27 columns and sometime more than half of them are
empty. After the XSL transformation I alway see 'null' in the
resulting HTML.  I tried to suppress the null columns at the XSL
stage, but was unsuccessful.

The XSQl utility (servlet) from Oracle works this way. Only non empty
columns produce any XML nodes, empty columns are suppressed by
default.

-- 
MfG/Regards

     /====
    /    Ridderbusch        / ,
   /                       /./   Frank Kahmen Str. 15
  /=== /,== ,===/  /,==,  //    33104 Paderborn, Germany
 /    //   /   /  //   / / \   Tel.: (49) 5254-939284
/    /     `==/\ /    / /   \ Email: frank.ridderbusch@freenet.de

Since I have taken all the Gates out of my computer, it finally works!!

Re: ESQL: password-less xml

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 6 Feb 2001, Erikjan wrote:

>   Is it possible to have no user/password in xml pages (and also not
> 'imported' from other urls) with esql + connectionpool, and only give
> a connection-name for a the xml page, and let cocoon do a lookup of
> this connection in the properties file? Something like this:
>
>  <esql:connection name="default">
>   <esql:execute-query>
>     <esql:query>select name,type from sysobjects</esql:query>
>     <esql:results>
>       <esql:row-results>
>       	<name><esql:get-string column="name"/></name>
>       	<type><esql:get-string column="type"/></type>
>       </esql:row-results>
>     </esql:results>
>   </esql:execute-query>
>  </esql:connection>
>
> I have not been able to get this to work with the connection pool, without
> having the password in the xml file.

many others have reported success using connection pools in this
situation, you might post your configuration and ask for help. otherwise,
you could do something like this:

<esql:connection>
  ...
  <esql:password><xsp:expr>StaticObject.getPassword()</xsp:expr></esql:password>
  ...
</esql:connection>

or you could apply your own logicsheet to your xsp pages to add the esql
connection parameters on the fly. many, many options.

- donald


ESQL: password-less xml

Posted by Erikjan <er...@xs4all.nl>.
  Is it possible to have no user/password in xml pages (and also not 'imported' 
from other urls) with esql + connectionpool, and only give a connection-name for 
a  the xml page, and let cocoon do a lookup of this connection in the properties 
file? Something like this:

 <esql:connection name="default">
  <esql:execute-query>
    <esql:query>select name,type from sysobjects</esql:query>
    <esql:results>
      <esql:row-results>
      	<name><esql:get-string column="name"/></name>
      	<type><esql:get-string column="type"/></type>
      </esql:row-results>
    </esql:results>
  </esql:execute-query>
 </esql:connection>

I have not been able to get this to work with the connection pool, without 
having the password in the xml file. 


Thanks for your help


Erikjan

Re: [C1.8.2] ESQL question in particular

Posted by Kessler <ke...@balcab.ch>.
----- Original Message -----
From: "Frank Ridderbusch" <fr...@gmx.de>

> The XSQl utility (servlet) from Oracle works this way. Only non empty
> columns produce any XML nodes, empty columns are suppressed by
> default.

If you activate the "null-indicator" option in  xsql:query, such columns are
not simply suppressed, but signaled as empty elements with a
NULL="YES" attribute. I find this a very elegant solution that I
would love to see in esql too.

Regards,
Nicolas Kessler


Re: [C1.8.2] ESQL question in particular

Posted by Frank Ridderbusch <fr...@gmx.de>.
Donald Ball writes:
 > On Tue, 6 Feb 2001, Frank Ridderbusch wrote:
 > 
 > > Hi folks,
 > >
 > > I'm doing my first steps with Cocoon and esql and I'm trying to port
 > > something I created with Oracles xsql utility to esql.
 > >
 > > I'm retrieving the results of the query with the <esql:get-columns/>
 > > tag.
 > >
 > > First of all I would like to ask, how I can achieve a more vertical
 > > formating of the resulting xml. Instead of
 > >
 > > <rowset>
 > >   <row><col1>...</col1><col2>...</col2><col3>...</col3>...</row>
 > > </rowset>
 > >
 > > I would like
 > >
 > > <rowset>
 > >   <row>
 > >     <col1>...</col1>
 > >     <col2>...</col2>
 > >     <col3>...</col3>
 > >     ...
 > >   </row>
 > > </rowset>
 > >
 > > I simply find the more vertical format easier on the eye, when I'm in
 > > the need to directly look at the XML.
 > 
 > look at the formatter options in cocoon.properties.

Well, I tried and included these lines in cocoon.properties

  # XML
  formatter.text/xml.encoding = iso-8859-1
  formatter.text/xml.indent = 1
  formatter.text/xml.line-width = 72

The encoding line showed effect, however the line-width had no effect
at all.

My particular XML file starts with these lines:

   <?xml version="1.0"?>

   <?cocoon-process type="xsp"?>
   <?cocoon-format type="text/xml"?>

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

-- 
MfG/Regards

     /====
    /    Ridderbusch        / ,
   /                       /./   Frank Kahmen Str. 15
  /=== /,== ,===/  /,==,  //    33104 Paderborn, Germany
 /    //   /   /  //   / / \   Tel.: (49) 5254-939284
/    /     `==/\ /    / /   \ Email: frank.ridderbusch@freenet.de

Since I have taken all the Gates out of my computer, it finally works!!

Re: [C1.8.2] ESQL question in particular

Posted by Ulrich Mayring <ul...@denic.de>.
Donald Ball wrote:
> 
> dammit, i didn't want get-columns to support all the options i had in the
> sql processor. but i guess i was wrong. but you're wrong here, uli - you
> _can't_ simply filter them out in xslt - how can you distinguish a null
> string from an empty string?

Hmm... there's a <NULL> tag generated by the null-indicator attribute,
at least in SQL processor.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Line break in cocoon-html-output

Posted by Andy Bosch <an...@is-development.de>.
Hi,

I have a strange error in my html-output.

I create a xml and a xsl file. Via a
java-servlet cocoon starts the processing
and shows the output in the browser. Perfect!

But when I look into the generated source,
the resulting html is absolutely strange.
Line breaks are in the middle of tags and
some lines are very very long.
Like this:

<html><head><title>Test</title></head><body
background="FFFFFF"><p
align="left"> ...

How can a force a cr or a line break
in the resulting html that it looks like this:

<html>
<head>
<title>Test</title>
</head>
<body background="FFFFFF">
<p align="left"> ...

Thanks in advance 
Andy


Re: [C1.8.2] ESQL question in particular

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 6 Feb 2001, Ulrich Mayring wrote:

> Donald Ball wrote:
> >
> > what do folks think? should we suppress null columns by default?
>
> NO!!! :-)
>
> Seriously, you used to have a null-indicator attribute in the SQL
> processor and taglib, I didn't find that in esql. That was IMHO a good
> way to do it. Anyway, you can always filter them out in XSL.

dammit, i didn't want get-columns to support all the options i had in the
sql processor. but i guess i was wrong. but you're wrong here, uli - you
_can't_ simply filter them out in xslt - how can you distinguish a null
string from an empty string?

- donald


Re: [C1.8.2] ESQL question in particular

Posted by Ulrich Mayring <ul...@denic.de>.
Donald Ball wrote:
> 
> what do folks think? should we suppress null columns by default?

NO!!! :-)

Seriously, you used to have a null-indicator attribute in the SQL
processor and taglib, I didn't find that in esql. That was IMHO a good
way to do it. Anyway, you can always filter them out in XSL.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: [C1.8.2] ESQL question in particular

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 6 Feb 2001, Frank Ridderbusch wrote:

> Hi folks,
>
> I'm doing my first steps with Cocoon and esql and I'm trying to port
> something I created with Oracles xsql utility to esql.
>
> I'm retrieving the results of the query with the <esql:get-columns/>
> tag.
>
> First of all I would like to ask, how I can achieve a more vertical
> formating of the resulting xml. Instead of
>
> <rowset>
>   <row><col1>...</col1><col2>...</col2><col3>...</col3>...</row>
> </rowset>
>
> I would like
>
> <rowset>
>   <row>
>     <col1>...</col1>
>     <col2>...</col2>
>     <col3>...</col3>
>     ...
>   </row>
> </rowset>
>
> I simply find the more vertical format easier on the eye, when I'm in
> the need to directly look at the XML.

look at the formatter options in cocoon.properties.

> Second, I like to ask, how I can suppress null columns? For instance,
> my query returns 27 columns and sometime more than half of them are
> empty. After the XSL transformation I alway see 'null' in the
> resulting HTML.  I tried to suppress the null columns at the XSL
> stage, but was unsuccessful.
>
> The XSQl utility (servlet) from Oracle works this way. Only non empty
> columns produce any XML nodes, empty columns are suppressed by
> default.

what do folks think? should we suppress null columns by default?

- donald