cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Cordes" <mcord...@maine.edu>
Subject Re: Need a special formatting associated to the Sql TagLib.
Date Sat, 11 Nov 2000 20:35:12 GMT
You need to read the sql/esql page.  This is already done for you

<sql:execute-query>
    <sql:query>
        select field1, field2 from sometable where some condtion
    </sql:query>
    <sql:row-element>row</sql:row-element>
    <sql:tab-case>lower</sql:tag-case>
</sql:execute-query>

produces the following xml:

<row>
    <field1>value1</field1>
    <field2>value2</field2>
</row>
<row>
    <field1>...</field1>
    <field2>...</field2>
</row>
....

you are probably doing

<xsl:value-of select="databaseField"/>

which concatentates its text child elements ( normalizing ) before
displaying,
thus the values appear together.

instead do:

    Field1: <xsl:value-of select="databaseField/field1"/>

or in my example above:

    Field1: <xsl:value-of select="row/field1"/>


Hope that  helps.  This really is an XSLT problem ( your understanding of
child elements ) and more questions like this should be sent to the
www.mulberrytech.com list.

-matt


----- Original Message -----
From: Mario Guzzi
To: cocoon-users@xml.apache.org
Sent: Saturday, November 11, 2000 12:53 PM
Subject: Need a special formatting associated to the Sql TagLib.


Hello guys!

I've got the following problem. I've to access a database table and get a
few field values back!

Let's suppose the fields are called "Field1" and "Field2" and that their
values are "Value1" and "Value2".

I know that the Sql TagLib lets me put a database row inside a single
row-element like this:

<row-element>
databaseField
</row-element>

The problem is that if I select both values I get something like:

<row-element>
Value1Value2
</row-element>

What I need is a kinda formatting like the following one:

<row-element>
<Field1>Value1</Field1>
<Field2>Value2</Field2>
<row-element>

Can you show me any sort of formatting to solve this problem, that is to put
every single database
 value selected by a (multi-fields) query between two generic tags?

Thank you. Regards!!!


Mime
View raw message