Hello again,

Thank you, thank you and thank you. With correct usage of esql:get-xml
I got it working.

I attached the original letter with solution for anyone who may seek for
similar help in future.

Cya

-- 
 Saulius @ 2005.01.04 00:13
--- Begin Message ---
hi saulius

1.take a look at this thread

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=108211213006410&w=2

2. here is how i get html (xhtml) fragment for database

xsp:
...
<esql:execute-query>
<esql:query>SELECT * FROM tblTextBlocks WHERE 
id_TextBlocks=<xsp-request:get-parameter name="id"/></esql:query>
  <esql:results>
    <esql:row-results>
       <block>
                                                        
<id_TextBlocks><esql:get-string column="id_TextBlocks" 
root="id_TextBlocks"/></id_TextBlocks>                                          
 
<textBlock_Title><esql:get-string column="textBlock_Title" 
root="textBlock_Title"/></textBlock_Title>                                      
             
<esql:get-xml column="textBlock_Description" root="textBlock_Description"/>

       </block>
    </esql:row-results>
 </esql:results>
<esql:no-results>
                no record was found
</esql:no-results>

...


tectBlock_Description column contains xhtml fragment

serialize this as xml and you will get your content in xhtlm format

-- stavros



On Mon, 3 Jan 2005, [ISO-8859-1] Saulius Grigaliϋnas wrote:

> Hello cocoon users,
> 
>       I'm giving up after searching google and cocoon mailing list for four
>       days. I need to fetch user input from db and show it as-is (it
>       may contain html tags).
> 
>       My sitemap looks like this:
>       <map:pipeline>
>               <map:match pattern="test/">
>                      <map:generate type="serverpages" 
> src="share/xsp/news.xml"/>
>                      <map:transform type="xslt" src="share/xsl/news.xsl"/>
>                      <map:serialize type="xhtml" />
>               </map:match>
>       </map:pipeline>
> 
>       with:
>       
>       <map:transformer name="xslt" 
> src="org.apache.cocoon.transformation.TraxTransformer" pool-max="32" 
> pool-min="16" pool-grow="4" />
>       
>       and
>       
>       <map:serializer name="xhtml" mime-type="text/html" 
> src="org.apache.cocoon.serialization.XMLSerializer">
>                      <doctype-public>-//W3C//DTD XHTML 1.0 
> Strict//EN</doctype-public>
>                      
> <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
>                      <encoding>UTF-8</encoding>
>                      <indent>yes</indent>
>                      <omit-xml-declaration>yes</omit-xml-declaration>
>       </map:serializer>
>       <map:serializer name="xml" 
> src="org.apache.cocoon.serialization.XMLSerializer" mime-type="text/xml" 
> logger="sitemap.serializer.xml"  pool-grow="4" pool-max="32" pool-min="4">
>                      <encoding>UTF-8</encoding>
>                      <cdata-section-elements>body</cdata-section-elements>
>       </map:serializer>
> 
>       news.xml content: http://dev.vzg.lt/news.xsp/source
>       news.xml result, after serverpages generation:
>       http://dev.vzg.lt/news.xsp/result
>       xsl source: http://dev.vzg.lt/news.xsl/source
>       the result : http://dev.vzg.lt/test/
>       it should look like this : http://dev.vzg.lt/goodone.html
> 
>       I've seen a few similar problems in the list, but I couldn't
>       find a real working solution. Please, help me if you can, I'm
>       starting to lose the hope.
> 
> 


--- End Message ---
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to