cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew C. Oliver" <acoli...@apache.org>
Subject ESQL && HTML
Date Sun, 12 May 2002 21:50:03 GMT
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message