You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Andrew C. Oliver" <ac...@apache.org> on 2002/05/12 23:50:03 UTC

ESQL && HTML

Hi All,

I'm working on a sample webapp for cocoon based on www.bringmethis.com.
The sources will be released to the cocoon community (with a different
skin) and the site will be converted and used as a live example.  (its
currently in PERL).  Contributers to this effort are welcome.  I hope
to try and compile a set of *suggested practices* and accompany this
with full documentation.

Now for my Question.  I'm working on some basic load scripts to create
the tables and the such.  This method allows me to distribute these and
users to easily load their tables into whatever database.

In order to do this I need to insert some html, and then I need to get
out some html.  Unfortunately, so far I'm getting coded HTML.  &gt; and 
the likes.  Can someone point me to a method based on the below pages
that would accomplish this?  Its okay if another transformation is
required.  (generally this stuff will be entered by the
enduser-siteadmin hence why its xhtml instead of xml->xsl->xhtml but an
initial set will be provided with the load script)

Thanks,

Andy

current output--------------------------------------------------

<pagecontents xmlns:xsp="http://apache.org/xsp"
xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
xmlns:esql="http://apache.org/cocoon/SQL/v2">                
<pagecontent>
                       
<name>Home</name>
                       
<content>&lt;p&gt;Main Page Content&lt;/p&gt;&lt;p&gt;various stuff
here&lt;/p&gt;</content>
                
</pagecontent>
</pagecontents>

Load script-----------------------------------------------------

<?xml version='1.0' encoding='ISO-8859-1'?>

<xsp:page language='java'
          xmlns:xsp='http://apache.org/xsp'
          xmlns:esql='http://apache.org/cocoon/SQL/v2'>

  <page>
   <title>Categories</title>

   <content>

   <esql:connection>
     <esql:pool>personnel</esql:pool>
        <esql:execute-query>
              <!-- ignore below failure-ok="true" Patch 9004 enables
this feature -->
          <esql:query failure-ok="true">
               DROP TABLE PAGECONTENT
          </esql:query>
        </esql:execute-query>
        <esql:execute-query>
          <esql:query>
                CREATE TABLE PAGECONTENT(ID INTEGER IDENTITY PRIMARY
KEY,
                  NAME VARCHAR NOT NULL, CONTENT VARCHAR NOT NULL,
                  UNIQUE(NAME))
          </esql:query>
          <esql:query>
             <![CDATA[
            INSERT INTO PAGECONTENT(ID,NAME,CONTENT)
                       VALUES(0,'Home','<p>Main Page
Content</p><p>various stuff here</p>')

              ]]>
          </esql:query>

        </esql:execute-query>

      </esql:connection>

   </content>
  </page>
</xsp:page>

displayscript-------------------------------------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

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

   <pagecontents>
   <esql:connection>
     <esql:pool>personnel</esql:pool>

        <esql:execute-query>
          <esql:query>
            SELECT * FROM pagecontent
          </esql:query>
          <esql:results>
             <esql:row-results>
                <pagecontent>
                       <name><esql:get-string column='name'/></name>
                       <content><esql:get-string
column='content'/></content>
                </pagecontent>
             </esql:row-results>
          </esql:results>
        </esql:execute-query>

      </esql:connection>
     </pagecontents>

</xsp:page>

-- 
http://www.superlinksoftware.com - software solutions for business
http://jakarta.apache.org/poi - Excel/Word/OLE 2 Compound Document in
Java                            
http://krysalis.sourceforge.net/centipede - the best build/project
structure
		    a guy/gal could have! - Make Ant simple on complex Projects!
The avalanche has already started. It is too late for the pebbles to
vote.
-Ambassador Kosh


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ESQL && HTML

Posted by "Andrew C. Oliver" <ac...@apache.org>.
Christian Haul wrote:

>On 12.May.2002 -- 05:50 PM, Andrew C. Oliver wrote:
>  
>
>>In order to do this I need to insert some html, and then I need to get
>>out some html.  Unfortunately, so far I'm getting coded HTML.  &gt; and 
>>the likes.  Can someone point me to a method based on the below pages
>>that would accomplish this?  Its okay if another transformation is
>>    
>>
>
>Andy, you want to shove html to / from the database? If it was xhtml
><esql:get-xml/> and the util logicsheet <util:include-expr/> provides
>the functionality.
>
>If it is no xhtml, it needs to be converted e.g. by tidy.
>
>	Chris.
>
>  
>
Awesome, thanks!



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ESQL && HTML

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 12.May.2002 -- 05:50 PM, Andrew C. Oliver wrote:
> In order to do this I need to insert some html, and then I need to get
> out some html.  Unfortunately, so far I'm getting coded HTML.  &gt; and 
> the likes.  Can someone point me to a method based on the below pages
> that would accomplish this?  Its okay if another transformation is

Andy, you want to shove html to / from the database? If it was xhtml
<esql:get-xml/> and the util logicsheet <util:include-expr/> provides
the functionality.

If it is no xhtml, it needs to be converted e.g. by tidy.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>