You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert McKinnon <rm...@alabanza.com> on 2001/06/27 14:22:34 UTC

work around for ?

Hello,

I am trying to dynamically build table rows from an xml file.  The solution
that I came across indicated that I would need to use <xsl:text
disable-output-escaping="yes">.  When I tried to apply this solution I
discovered that Cocoon does not support disable-output-escaping.  What would
be an alternative solution?  The following are example snippets:

[XML]
<parent>
	<child>
		<name>child1</name>
	</child>
	<child>
		<name>child2</name>
	</child>
	<child>
		<name>child3</name>
	</child>
	<child>
		<name>child4</name>
	</child>
	<child>
		<name>child5</name>
	</child>
	<child>
		<name>child6</name>
	</child>
</parent>

[OUTPUT DESIRED]
<tr>
	<td>child1</td>
	<td>child2</td>
</tr>
<tr>
	<td>child3</td>
	<td>child4</td>
</tr>
<tr>
	<td>child5</td>
	<td>child6</td>
</tr>

[RECOMMENDED XSL SOLUTION NOT SUPPORTED BY COCOON]
<tr>
<xsl:for-each select="parent/child">
	<td><xsl:value-of select="name"/></td>
	<xsl:if test="position() mod 2 = 0">
		<xsl:text disable-output-escaping="yes">
			<![CDATA[</tr><tr>]]>
		</xsl:text>
	</xsl:if>
</xsl:for-each>
</tr>



---------------------------------------------------------------------
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: C2: initialization error

Posted by java guru <ja...@yahoo.co.in>.
Hi Martin.,
   As you might already know., the way c2 works is  it
tries to compile the sitemap at the start-up..for some
reasons, the sitemap cannot get compiled and we would
encounter such errors. The description of error on
screen is so generalized 'coz for cocoon, the problem
is sitemap didnt get proper compilation. The cause
could be anything..which is probably described
somewhere in cocoon.log..

Best way to debug is 

1. Shutdown the cocoon and servlet engine.
2. Delete the cocoon.log
3. Restart cocoon
4. Try to access the url..it fails
5. Goto cocoon.log
6. Lots of messages there, but look for ones with some
error descriptions..you may get a clue
7. Still cannot figure out? attache the log(zip it if
needed) and send mail with very specifics of
everything to this mailing list.
8. Many people ask for specifics 'coz this error is so
generalized, its impossible to tell just from the
message..

Good luck


 --- Martin Mauri <mm...@profesi.com.ar> wrote: > Hi
Giacomo.
> 
> As the subject said, I'm using C2 over Tomcat 3.2.1
> and Windoes ME.
> This error happens when I point to
> http://localhost:8080/cocoon/ and though
> the servlet engine is working good, I get the error
> mentioned before. Any
> idea?
> 
> regards.
> 
> Martin
> 
> > There is a cocoon.log file somewhere created which
> would hold more
> > information. Please don't be sparse with
> information about your
> > problems. Tell us at least the cocoon version you
> are using, which
> > servlet engine, operation system and alike.
> >
> 
> >
> > > Hi Cocooners,
> > >
> > > Trying to startup cocoon 2 I get the following
> exception. I can't cop
> > > anymore with this error, any suggestion?
> > > It says it has to do something with the
> sitemap...
> > >
> >
> >
>
--------------------------------------------------------------------------
> --
> > > ------------------------------------------------
> > >
> > > type internal-server-error
> > >
> > > message The sitemap handler's sitemap is not
> available.
> > >
> > > description
> org.apache.cocoon.ProcessingException: The sitemap
> handler's
> > > sitemap is not available.
> > >
> > > sender org.apache.cocoon.servlet.CocoonServlet
> > >
> > > source Cocoon servlet
> > >
> > > request-uri
> > >
> > > /cocoon/
> > >
> > > exception
> > >
> > > org.apache.cocoon.ProcessingException: The
> sitemap handler's sitemap is
> not
> > > available.
> > >
> > > path-info
> > >
> > > stacktrace
> > >
> > > org.apache.cocoon.ProcessingException: The
> sitemap handler's sitemap is
> not
> > > available.
> > >  at
>
org.apache.cocoon.sitemap.Manager.setupProcessing(Manager.java:185)
> > >  at
>
org.apache.cocoon.sitemap.Manager.invoke(Manager.java:96)
> > >  at
> org.apache.cocoon.Cocoon.process(Cocoon.java:288)
> > >  at
>
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:442)
> > >  at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >  at
>
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> > >  at
>
org.apache.tomcat.core.Handler.service(Handler.java:286)
> > >  at
>
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > >  at
> > >
>
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> > > 7)
> > >  at
>
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > >  at
> > >
>
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> > > onnectionHandler.java:210)
> > >  at
> > >
>
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> > >  at
> > >
>
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> > >  at java.lang.Thread.run(Thread.java:484)
> > >
> >
> >
>
--------------------------------------------------------------------------
> --
> > > ------------------------------------------------
> > > thanks in advance.
> > >
> > > Martin
> > >
> > >
> > >
>
---------------------------------------------------------------------
> > > 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>
> > >
> > >
> > >
> > >
> >
> >
> >
>
---------------------------------------------------------------------
> > 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>
> 
> 
>
---------------------------------------------------------------------
> 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>
>  

____________________________________________________________
Do You Yahoo!?
For regular News updates go to http://in.news.yahoo.com

---------------------------------------------------------------------
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: C2: initialization error

Posted by Martin Mauri <mm...@profesi.com.ar>.
Hi Giacomo.

As the subject said, I'm using C2 over Tomcat 3.2.1 and Windoes ME.
This error happens when I point to http://localhost:8080/cocoon/ and though
the servlet engine is working good, I get the error mentioned before. Any
idea?

regards.

Martin

> There is a cocoon.log file somewhere created which would hold more
> information. Please don't be sparse with information about your
> problems. Tell us at least the cocoon version you are using, which
> servlet engine, operation system and alike.
>

>
> > Hi Cocooners,
> >
> > Trying to startup cocoon 2 I get the following exception. I can't cop
> > anymore with this error, any suggestion?
> > It says it has to do something with the sitemap...
> >
>
> --------------------------------------------------------------------------
--
> > ------------------------------------------------
> >
> > type internal-server-error
> >
> > message The sitemap handler's sitemap is not available.
> >
> > description org.apache.cocoon.ProcessingException: The sitemap handler's
> > sitemap is not available.
> >
> > sender org.apache.cocoon.servlet.CocoonServlet
> >
> > source Cocoon servlet
> >
> > request-uri
> >
> > /cocoon/
> >
> > exception
> >
> > org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is
not
> > available.
> >
> > path-info
> >
> > stacktrace
> >
> > org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is
not
> > available.
> >  at org.apache.cocoon.sitemap.Manager.setupProcessing(Manager.java:185)
> >  at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:96)
> >  at org.apache.cocoon.Cocoon.process(Cocoon.java:288)
> >  at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:442)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >  at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> >  at org.apache.tomcat.core.Handler.service(Handler.java:286)
> >  at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> >  at
> >
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> > 7)
> >  at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> >  at
> >
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> > onnectionHandler.java:210)
> >  at
> >
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> >  at
> >
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> >  at java.lang.Thread.run(Thread.java:484)
> >
>
> --------------------------------------------------------------------------
--
> > ------------------------------------------------
> > thanks in advance.
> >
> > Martin
> >
> >
> > ---------------------------------------------------------------------
> > 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>
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> 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>


---------------------------------------------------------------------
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: C2: initialization error

Posted by giacomo <gi...@apache.org>.
On Wed, 27 Jun 2001, Martin Mauri wrote:

There is a cocoon.log file somewhere created which would hold more
information. Please don't be sparse with information about your
problems. Tell us at least the cocoon version you are using, which
servlet engine, operation system and alike.

Giacomo

> Hi Cocooners,
>
> Trying to startup cocoon 2 I get the following exception. I can't cop
> anymore with this error, any suggestion?
> It says it has to do something with the sitemap...
>
> ----------------------------------------------------------------------------
> ------------------------------------------------
>
> type internal-server-error
>
> message The sitemap handler's sitemap is not available.
>
> description org.apache.cocoon.ProcessingException: The sitemap handler's
> sitemap is not available.
>
> sender org.apache.cocoon.servlet.CocoonServlet
>
> source Cocoon servlet
>
> request-uri
>
> /cocoon/
>
> exception
>
> org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is not
> available.
>
> path-info
>
> stacktrace
>
> org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is not
> available.
>  at org.apache.cocoon.sitemap.Manager.setupProcessing(Manager.java:185)
>  at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:96)
>  at org.apache.cocoon.Cocoon.process(Cocoon.java:288)
>  at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:442)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
>  at org.apache.tomcat.core.Handler.service(Handler.java:286)
>  at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>  at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7)
>  at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>  at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:210)
>  at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>  at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
>  at java.lang.Thread.run(Thread.java:484)
>
> ----------------------------------------------------------------------------
> ------------------------------------------------
> thanks in advance.
>
> Martin
>
>
> ---------------------------------------------------------------------
> 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>
>
>
>
>


---------------------------------------------------------------------
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>


C2: initialization error

Posted by Martin Mauri <mm...@profesi.com.ar>.
Hi Cocooners,

Trying to startup cocoon 2 I get the following exception. I can't cop
anymore with this error, any suggestion?
It says it has to do something with the sitemap...

----------------------------------------------------------------------------
------------------------------------------------

type internal-server-error

message The sitemap handler's sitemap is not available.

description org.apache.cocoon.ProcessingException: The sitemap handler's
sitemap is not available.

sender org.apache.cocoon.servlet.CocoonServlet

source Cocoon servlet

request-uri

/cocoon/

exception

org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is not
available.

path-info

stacktrace

org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is not
available.
 at org.apache.cocoon.sitemap.Manager.setupProcessing(Manager.java:185)
 at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:96)
 at org.apache.cocoon.Cocoon.process(Cocoon.java:288)
 at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:442)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
 at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)

----------------------------------------------------------------------------
------------------------------------------------
thanks in advance.

Martin


---------------------------------------------------------------------
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>


C2: XSLT malfunction

Posted by Eduardo Yánez <ey...@eversystems.com>.
Hi all!

Im creating a simple menu, the xml code is:


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

<topFrame id="top">
  	<topMenu>
   	   <menuItem id="m1_services_" capt="services" href="/info/services.xml">
   	      <desc>Description of the Guanoco.com services.</desc>
   	   </menuItem>
   	   <menuItem id="m1_aboutus_" capt="about us" href="/info/about_us.xml">
   	      <desc>Who we are.</desc>
   	   </menuItem>
   	   <menuItem id="m1_profile_" capt="profile" href="/users/profile.xml">
   	      <desc>Registered users can review and update their personal data.</desc>
   	   </menuItem>
                 <menuItem id="m1_sitemap_" capt="site map" href="/info/sitemap.xml">
                    <desc>All the site's pages and their functions.</desc>
   	   </menuItem>
   	   <menuItem id="m1_job_" capt="job opportunities" href="/info/job_oportunities.xml">
   	      <desc>Job opportunities with &amp; at Guanoco.com.</desc>
   	   </menuItem>
   	</topMenu>
</topFrame>


and the xsl is:


<?xml version="1.0"?>

<xsl:stylesheet
   version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
   <html>
      <head>
         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
         <script src="js/utils.js"/>
      </head>
      <body bgcolor="#FFFFFF">
         <xsl:apply-templates/>
      </body>
   </html>
</xsl:template>

<xsl:template match="topMenu">
  <table width="750" border="0" cellspacing="0" cellpadding="0" bgcolor="#336666" height="15">
      <tr>
        <td valign="top" width="220">
           <img src="images/transp.gif" width="220" height="5"/>
        </td>
        <xsl:apply-templates/>
        <td valign="top" width="50">
           <img src="images/transp.gif" width="50" height="5"/>
        </td>
      </tr>
   </table>
</xsl:template>

<xsl:template match="menuItem">
   <xsl:variable name="widthList">095 080 090 080 135</xsl:variable>
   <xsl:variable name="width"><xsl:value-of select="substring($widthList, 4*(position()-1)+1, 3)"/></xsl:variable>
   <xsl:variable name="height">15</xsl:variable>
   <td valign="top" width="{$width}" height="{$height}">
      <a>
         <xsl:attribute name="onmouseover">javascript:rollover('<xsl:value-of select="@id"/>','on');</xsl:attribute>
         <xsl:attribute name="onmouseout">javascript:rollover('<xsl:value-of select="@id"/>','off');</xsl:attribute>
         <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
         <img width="{$width}" height="{$height}" border="0">
            <xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
            <xsl:attribute name="src">images/<xsl:value-of select="@id"/>off.gif</xsl:attribute>
            <xsl:attribute name="alt"><xsl:value-of select="@capt"/></xsl:attribute>
         </img>
      </a>
      <xsl:value-of select="position()"/>
   </td>
</xsl:template>

</xsl:stylesheet>


The values returned by the XPath "position()" function are 2, 4, 6, 8, 10!!!!!! so the "substring" function fails to compute 
the bitmap width for each link and the menu presentation is damaged :-(

What is the problem here? is this the mail list for this question?

Regards, 
Eduardo Yanez.

---------------------------------------------------------------------
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: work around for ?

Posted by Gustavo Mejia <gm...@infotec.com.mx>.
Hi,

I think you can use Xalan extention, (Redirect) somethink like :

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt"
    xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
    extension-element-prefixes="redirect">
...
...
...
<redirect:write select="Your_file">
...
...
...
</redirect:write>
</xsl:stylesheet>


Robert McKinnon wrote:

> Hello,
>
> I am trying to dynamically build table rows from an xml file.  The solution
> that I came across indicated that I would need to use <xsl:text
> disable-output-escaping="yes">.  When I tried to apply this solution I
> discovered that Cocoon does not support disable-output-escaping.  What would
> be an alternative solution?  The following are example snippets:
>
> [XML]
> <parent>
>         <child>
>                 <name>child1</name>
>         </child>
>         <child>
>                 <name>child2</name>
>         </child>
>         <child>
>                 <name>child3</name>
>         </child>
>         <child>
>                 <name>child4</name>
>         </child>
>         <child>
>                 <name>child5</name>
>         </child>
>         <child>
>                 <name>child6</name>
>         </child>
> </parent>
>
> [OUTPUT DESIRED]
> <tr>
>         <td>child1</td>
>         <td>child2</td>
> </tr>
> <tr>
>         <td>child3</td>
>         <td>child4</td>
> </tr>
> <tr>
>         <td>child5</td>
>         <td>child6</td>
> </tr>
>
> [RECOMMENDED XSL SOLUTION NOT SUPPORTED BY COCOON]
> <tr>
> <xsl:for-each select="parent/child">
>         <td><xsl:value-of select="name"/></td>
>         <xsl:if test="position() mod 2 = 0">
>                 <xsl:text disable-output-escaping="yes">
>                         <![CDATA[</tr><tr>]]>
>                 </xsl:text>
>         </xsl:if>
> </xsl:for-each>
> </tr>
>
> ---------------------------------------------------------------------
> 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: work around for ?

Posted by Robert McKinnon <rm...@alabanza.com>.
Perry,

Thanks for the information, I thought that it was pretty clever.  However,
I did run into another issue applying this technique.  If the number of
elements that we are trying to iterate through is not divisible evenly by
the number we are trying to mod with, it will not display the last elements.
For example, if I have 7 elements and I apply mod 4; the last three elements
would not be displayed.  I was wondering if you or anyone would have a work
around for this.

Thanks,

Rob
  -----Original Message-----
  From: Perry Molendijk [mailto:perry@inflexions.com]
  Sent: Wednesday, June 27, 2001 7:39 PM
  To: cocoon-users@xml.apache.org
  Subject: Re: work around for <xsl:text disable-output-escaping="yes">?


  Try this:

  <xsl:for-each select="parent/child[position() mod 2 = 0]">
  <tr>
  <td><xsl:value-of select="preceding-sibling::child/name"/></td>
  <td><xsl:value-of select="name"/></td>
  </tr>
  </xsl:for-each>

  and as you can see you can make this work for any number of columns:

  <xsl:for-each select="parent/child[position() mod 4 = 0]">
  <tr>
  <td><xsl:value-of select="preceding-sibling::child[3]/name"/></td>
  <td><xsl:value-of select="preceding-sibling::child[2]/name"/></td>
  <td><xsl:value-of select="preceding-sibling::child[1]/name"/></td>
  <td><xsl:value-of select="name"/></td>
  </tr>
  </xsl:for-each>

  Just be aware that the preceding-sibling:: axis is a reverse axis so
counting is reverse document order.

  Perry
    ----- Original Message -----
    From: Robert McKinnon
    To: cocoon-users@xml.apache.org
    Sent: Wednesday, June 27, 2001 8:22 PM
    Subject: work around for <xsl:text disable-output-escaping="yes">?


    Hello,

    I am trying to dynamically build table rows from an xml file.  The
solution
    that I came across indicated that I would need to use <xsl:text
    disable-output-escaping="yes">.  When I tried to apply this solution I
    discovered that Cocoon does not support disable-output-escaping.  What
would
    be an alternative solution?  The following are example snippets:

    [XML]
    <parent>
    <child>
    <name>child1</name>
    </child>
    <child>
    <name>child2</name>
    </child>
    <child>
    <name>child3</name>
    </child>
    <child>
    <name>child4</name>
    </child>
    <child>
    <name>child5</name>
    </child>
    <child>
    <name>child6</name>
    </child>
    </parent>

    [OUTPUT DESIRED]
    <tr>
    <td>child1</td>
    <td>child2</td>
    </tr>
    <tr>
    <td>child3</td>
    <td>child4</td>
    </tr>
    <tr>
    <td>child5</td>
    <td>child6</td>
    </tr>

    [RECOMMENDED XSL SOLUTION NOT SUPPORTED BY COCOON]
    <tr>
    <xsl:for-each select="parent/child">
    <td><xsl:value-of select="name"/></td>
    <xsl:if test="position() mod 2 = 0">
    <xsl:text disable-output-escaping="yes">
    <![CDATA[</tr><tr>]]>
    </xsl:text>
    </xsl:if>
    </xsl:for-each>
    </tr>




    ---------------------------------------------------------------------
    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: work around for ?

Posted by Perry Molendijk <pe...@inflexions.com>.
Try this:

<xsl:for-each select="parent/child[position() mod 2 = 0]">
<tr>
<td><xsl:value-of select="preceding-sibling::child/name"/></td>
<td><xsl:value-of select="name"/></td>
</tr>
</xsl:for-each>

and as you can see you can make this work for any number of columns: 

<xsl:for-each select="parent/child[position() mod 4 = 0]">
<tr> 
<td><xsl:value-of select="preceding-sibling::child[3]/name"/></td>
<td><xsl:value-of select="preceding-sibling::child[2]/name"/></td>
<td><xsl:value-of select="preceding-sibling::child[1]/name"/></td>
<td><xsl:value-of select="name"/></td>
</tr>
</xsl:for-each>

Just be aware that the preceding-sibling:: axis is a reverse axis so counting is reverse document order.

Perry
  ----- Original Message ----- 
  From: Robert McKinnon 
  To: cocoon-users@xml.apache.org 
  Sent: Wednesday, June 27, 2001 8:22 PM
  Subject: work around for <xsl:text disable-output-escaping="yes">?


  Hello,

  I am trying to dynamically build table rows from an xml file.  The solution
  that I came across indicated that I would need to use <xsl:text
  disable-output-escaping="yes">.  When I tried to apply this solution I
  discovered that Cocoon does not support disable-output-escaping.  What would
  be an alternative solution?  The following are example snippets:

  [XML]
  <parent>
  <child>
  <name>child1</name>
  </child>
  <child>
  <name>child2</name>
  </child>
  <child>
  <name>child3</name>
  </child>
  <child>
  <name>child4</name>
  </child>
  <child>
  <name>child5</name>
  </child>
  <child>
  <name>child6</name>
  </child>
  </parent>

  [OUTPUT DESIRED]
  <tr>
  <td>child1</td>
  <td>child2</td>
  </tr>
  <tr>
  <td>child3</td>
  <td>child4</td>
  </tr>
  <tr>
  <td>child5</td>
  <td>child6</td>
  </tr>

  [RECOMMENDED XSL SOLUTION NOT SUPPORTED BY COCOON]
  <tr>
  <xsl:for-each select="parent/child">
  <td><xsl:value-of select="name"/></td>
  <xsl:if test="position() mod 2 = 0">
  <xsl:text disable-output-escaping="yes">
  <![CDATA[</tr><tr>]]>
  </xsl:text>
  </xsl:if>
  </xsl:for-each>
  </tr>




  ---------------------------------------------------------------------
  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>