cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject FEATURE? SQL taglib <sql:tag-case> element...
Date Thu, 17 Aug 2000 22:18:31 GMT
Two observations about attribute names when using the SQL taglib.
Given the following SQL XSP snippet:

<?cocoon-process type="xsp"?>
<xsp:page
  language="java"
  xmlns:sql="http://www.apache.org/1999/SQL"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>
<sql:execute-query>
	...
	<sql:doc-element>tasks</sql:doc-element>
	<sql:row-element>task</sql:row-element>
	<sql:tag-case>lower</sql:tag-case>
	<sql:null-indicator>yes</sql:null-indicator>
	<sql:id-attribute>ID</sql:id-attribute>
	...
</sql:execute-query>


1. Even though the tag-case value is 'lower', the attribute name for ID in
the task row is still uppercase. An obvious mistake on my part, and it might
not be a bug since it's clearly 'tag-case' not 'attribute-case'. However...


2. The null indicator attribute name is 'NULL' and I have no control over
either its case or the name itself. That doesn't seem consistent to me (even
thought the doc page does say that the attribute will be NULL="yes"). I
might want to have it renamed to match other data/styles in my formatter.

Just having started with Cocoon it took me a day to figure out the problem
because I was looking at the results in IE5 in HTML form (e.g. I didn't know
about <?cocoon-format type="text/xml"?>). IE5 changes the ID tag to lower
case. Seeing the XML showed me the actual case of the attributes.


Suggestions:

- Let tag-case specify the attribute case as well -or- add an
<sql:attribute-case> element.

- Change the <sql:null-indicator> element to accept any value. If missing,
empty or 'Y' or 'yes', output NULL="yes". If anything else, use the element
value as the name.

Example:

The following add the attribute/value pair NULL="yes" to null items:
<sql:null-indicator/>
<sql:null-indicator>yes</sql:null-indicator>
<sql:null-indicator>Y</sql:null-indicator>
<sql:null-indicator>NULL</sql:null-indicator>

The following add the attribute/value pair xxx="yes" to null items:
<sql:null-indicator>xxx</sql:null-indicator>

If <sql:null-indicator> is not given, null items are skipped.

Per.


Mime
View raw message