You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ajit Bhave <ab...@yahoo.com> on 2006/02/06 20:39:52 UTC

XSP: How to create elements dynamically

Hi,

I am trying to creating elements dynamically in an XSP page. The
XSP documentation has an example using  xspParentNode. xspCurrentNode
variables. But, when I use them in XSP page, I get
unresolved symbols error. What is the recommended method for
doing this in Cocoon 2.1?

My environment is Cocoon 2.1 + JDK 1.5 + Redhat 7.2.

Any help will be appreciated.

Regards,
Ajit.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


How to use cocoon servlet only for rendering documents?

Posted by Peter Neu <pe...@gmx.net>.
Hello,

I have the use case that I want to combine Cocoon with another framework say
Struts. I want to do all the web front end work with Struts and do the
rendering of pdf, xml, excel etc with Cocoon. Thus I want pass parameters 
to the Cocoon servlet and then let cocoon query data from the database and
then render the stuff. I would only need the functionality to render the
documents and then use the SQLTransformer. Is this possible?

I heared some talk about the Paranoid cocoon servlet but I don't really
understand how this fits in. Can somebody please explain or tell me where to

find information on this?

Cheers,
Pete



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XSP: How to create elements dynamically

Posted by Ajit Bhave <ab...@yahoo.com>.
Hi David,

Fixed element names with dynamic attributes works for me. Thanks
for your help. After looking around in Cocoon code, I found that
dynamic element name creation is also supported! Here's a sample:
    <xsp:element>
        <xsp:param name="name">
            <esql:get-column-name column="1"/>
        </xsp:param>
        <esql:get-string column="1"/>
    </xsp:element>

The above example would create an element which has the name
of first column of the query.

Ajit.

--- David Bishop <d....@waypointsystems.co.uk> wrote:

> Hi,
> 
> I struggled with this one myself, I ended up having to use fixed  
> element names, but being able to assign attributes dynamically using 
> 
> the following code.
> 
> <xsp:element name="table">
> 	<xsp:attribute name="name"><esql:get-string column="relname"/></ 
> xsp:attribute>
> 		<xsp:element name="column">
> 			<xsp:attribute name="index"><esql:get-string column="attnum"/></ 
> xsp:attribute>
> 			...
> 		</xsp:element>
> 	</xsp:attribute>
> </xsp:element>
> 
> My original aim was to query PostgreSQL to create an XML document  
> describing the database schema of the database which would describe  
> the relationships of the database for me to allow me to create forms 
> 
> more dynamically. The structure I ended up using which is created  
> from the above is..
> 
> <table name="author>
> 	<column name="index">1</column>
>         ...
> </table>
> 
> This gets the information out and then of course if you needed it as
> 
> <author>
> 	<index>1</index>
> </author>
> 
> You could throw in a custom XSL transformation in the pipeline to  
> achieve it.
> 
> Don't know if this helps,
> 
> David.
> 
> 
> 
> On 6 Feb 2006, at 19:39, Ajit Bhave wrote:
> 
> > Hi,
> >
> > I am trying to creating elements dynamically in an XSP page. The
> > XSP documentation has an example using  xspParentNode.
> xspCurrentNode
> > variables. But, when I use them in XSP page, I get
> > unresolved symbols error. What is the recommended method for
> > doing this in Cocoon 2.1?
> >
> > My environment is Cocoon 2.1 + JDK 1.5 + Redhat 7.2.
> >
> > Any help will be appreciated.
> >
> > Regards,
> > Ajit.
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XSP: How to create elements dynamically

Posted by David Bishop <d....@waypointsystems.co.uk>.
Hi,

I struggled with this one myself, I ended up having to use fixed  
element names, but being able to assign attributes dynamically using  
the following code.

<xsp:element name="table">
	<xsp:attribute name="name"><esql:get-string column="relname"/></ 
xsp:attribute>
		<xsp:element name="column">
			<xsp:attribute name="index"><esql:get-string column="attnum"/></ 
xsp:attribute>
			...
		</xsp:element>
	</xsp:attribute>
</xsp:element>

My original aim was to query PostgreSQL to create an XML document  
describing the database schema of the database which would describe  
the relationships of the database for me to allow me to create forms  
more dynamically. The structure I ended up using which is created  
from the above is..

<table name="author>
	<column name="index">1</column>
        ...
</table>

This gets the information out and then of course if you needed it as

<author>
	<index>1</index>
</author>

You could throw in a custom XSL transformation in the pipeline to  
achieve it.

Don't know if this helps,

David.



On 6 Feb 2006, at 19:39, Ajit Bhave wrote:

> Hi,
>
> I am trying to creating elements dynamically in an XSP page. The
> XSP documentation has an example using  xspParentNode. xspCurrentNode
> variables. But, when I use them in XSP page, I get
> unresolved symbols error. What is the recommended method for
> doing this in Cocoon 2.1?
>
> My environment is Cocoon 2.1 + JDK 1.5 + Redhat 7.2.
>
> Any help will be appreciated.
>
> Regards,
> Ajit.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org