You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephen Greene <sg...@tssg.org> on 2003/06/27 12:09:07 UTC

XSP page - dynamic link generation

Hi all,

I'm trying to create a dynamic link generated by a xsp page.
Inside the html code:
	<a href="<insert link>">Link to some page</a>
I want to replace the <insert link> with a value passed back by a object
method.

E.g. This is what I trying at the moment
<xsp:logic>
	//get someObject from somewhere
	<xsp:content>
		<a href="<xsp:expr>someObject.getURL()</xsp:expr>">Link
to some page</a>
	</xsp:content>
</xsp:logic>
I get back a error from cocoon complaining about the '<' of the
<xsp:expr> tag.
"Original Exception: org.xml.sax.SAXParseException: The value of
attribute "href" must not contain the '<' character"

Any one any ideas how to solve this.

Thanks

Stephen Greene

RE: XSP page - dynamic link generation

Posted by Stephen Greene <sg...@tssg.org>.
It works a treat.

Thanks Markus

Stephen

-----Original Message-----
From: Markus Heussen [mailto:heussen@rheinland-online.com] 
Sent: 27 June 2003 13:37
To: cocoon-users@xml.apache.org
Subject: AW: XSP page - dynamic link generation


Hi Stephen,

when you set the link in the following way

<a>
<xsp:attribute name="href">
         <xsp:expr>...</xsp:expr>
</xsp:attribute>
</a>

you will probably get <a
href="%0A%09%09%09%09%09%20somepage%0A%09%09%09%09%09">

try:

<a><xsp:attribute
name="href"><xsp:expr>...</xsp:expr></xsp:attribute></a>

Greetings,

Markus


-----Ursprungliche Nachricht-----
Von: Stephen Greene [mailto:sgreene@tssg.org]
Gesendet: Freitag, 27. Juni 2003 12:31
An: cocoon-users@xml.apache.org
Betreff: RE: XSP page - dynamic link generation


It's getting there but I'm getting some junk in the link aswell. The
method getURL() returns a string which is a single word. But I'm
getting:
	<a href="%0A%09%09%09%09%09%20somepage%0A%09%09%09%09%09">

How do I get rid of all the junk before and after the "somepage" text in
the href attribute?

Thanks

Stephen


-----Original Message-----
From: Alexandre Victoor [mailto:alexandre.victoor@fr.adp.com]
Sent: 27 June 2003 11:17
To: cocoon-users@xml.apache.org
Subject: Re: XSP page - dynamic link generation


Hello
If think you should use xsp:attribute :
<a>
<xsp:attribute name="href">
         <xsp:expr>...</xsp:expr>
</xsp:attribute>
</a>

Alex

At 11:09 27/06/2003 +0100, you wrote:

>Hi all,
>
>I'm trying to create a dynamic link generated by a xsp page. Inside the

>html code:
>         <a href="<insert link>">Link to some page</a>
>I want to replace the <insert link> with a value passed back by a 
>object method.
>
>E.g. This is what I trying at the moment
><xsp:logic>
>         //get someObject from somewhere
>         <xsp:content>
>                 <a 
>href="<xsp:expr>someObject.getURL()</xsp:expr>">Link
> to some page</a>
>         </xsp:content>
></xsp:logic>
>I get back a error from cocoon complaining about the '<' of the
<xsp:expr>
>tag.
>"Original Exception: org.xml.sax.SAXParseException: The value of
attribute
>"href" must not contain the '<' character"
>
>Any one any ideas how to solve this.
>
>Thanks
>
>Stephen Greene


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


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


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


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


AW: XSP page - dynamic link generation

Posted by Markus Heussen <he...@rheinland-online.com>.
Hi Stephen,

when you set the link in the following way

<a>
<xsp:attribute name="href">
         <xsp:expr>...</xsp:expr>
</xsp:attribute>
</a>

you will probably get <a
href="%0A%09%09%09%09%09%20somepage%0A%09%09%09%09%09">

try:

<a><xsp:attribute name="href"><xsp:expr>...</xsp:expr></xsp:attribute></a>

Greetings,

Markus


-----Ursprungliche Nachricht-----
Von: Stephen Greene [mailto:sgreene@tssg.org]
Gesendet: Freitag, 27. Juni 2003 12:31
An: cocoon-users@xml.apache.org
Betreff: RE: XSP page - dynamic link generation


It's getting there but I'm getting some junk in the link aswell.
The method getURL() returns a string which is a single word.
But I'm getting:
	<a href="%0A%09%09%09%09%09%20somepage%0A%09%09%09%09%09">

How do I get rid of all the junk before and after the "somepage" text in
the href attribute?

Thanks

Stephen


-----Original Message-----
From: Alexandre Victoor [mailto:alexandre.victoor@fr.adp.com]
Sent: 27 June 2003 11:17
To: cocoon-users@xml.apache.org
Subject: Re: XSP page - dynamic link generation


Hello
If think you should use xsp:attribute :
<a>
<xsp:attribute name="href">
         <xsp:expr>...</xsp:expr>
</xsp:attribute>
</a>

Alex

At 11:09 27/06/2003 +0100, you wrote:

>Hi all,
>
>I'm trying to create a dynamic link generated by a xsp page. Inside the

>html code:
>         <a href="<insert link>">Link to some page</a>
>I want to replace the <insert link> with a value passed back by a
>object
>method.
>
>E.g. This is what I trying at the moment
><xsp:logic>
>         //get someObject from somewhere
>         <xsp:content>
>                 <a
>href="<xsp:expr>someObject.getURL()</xsp:expr>">Link
> to some page</a>
>         </xsp:content>
></xsp:logic>
>I get back a error from cocoon complaining about the '<' of the
<xsp:expr>
>tag.
>"Original Exception: org.xml.sax.SAXParseException: The value of
attribute
>"href" must not contain the '<' character"
>
>Any one any ideas how to solve this.
>
>Thanks
>
>Stephen Greene


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


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


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


RE: XSP page - dynamic link generation

Posted by Stephen Greene <sg...@tssg.org>.
It's getting there but I'm getting some junk in the link aswell. 
The method getURL() returns a string which is a single word. 
But I'm getting:
	<a href="%0A%09%09%09%09%09%20somepage%0A%09%09%09%09%09"> 

How do I get rid of all the junk before and after the "somepage" text in
the href attribute?

Thanks

Stephen


-----Original Message-----
From: Alexandre Victoor [mailto:alexandre.victoor@fr.adp.com] 
Sent: 27 June 2003 11:17
To: cocoon-users@xml.apache.org
Subject: Re: XSP page - dynamic link generation


Hello
If think you should use xsp:attribute :
<a>
<xsp:attribute name="href">
         <xsp:expr>...</xsp:expr>
</xsp:attribute>
</a>

Alex

At 11:09 27/06/2003 +0100, you wrote:

>Hi all,
>
>I'm trying to create a dynamic link generated by a xsp page. Inside the

>html code:
>         <a href="<insert link>">Link to some page</a>
>I want to replace the <insert link> with a value passed back by a 
>object
>method.
>
>E.g. This is what I trying at the moment
><xsp:logic>
>         //get someObject from somewhere
>         <xsp:content>
>                 <a 
>href="<xsp:expr>someObject.getURL()</xsp:expr>">Link
> to some page</a>
>         </xsp:content>
></xsp:logic>
>I get back a error from cocoon complaining about the '<' of the
<xsp:expr> 
>tag.
>"Original Exception: org.xml.sax.SAXParseException: The value of
attribute 
>"href" must not contain the '<' character"
>
>Any one any ideas how to solve this.
>
>Thanks
>
>Stephen Greene


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


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


Re: XSP page - dynamic link generation

Posted by Alexandre Victoor <al...@fr.adp.com>.
Hello
If think you should use xsp:attribute :
<a>
<xsp:attribute name="href">
         <xsp:expr>...</xsp:expr>
</xsp:attribute>
</a>

Alex

At 11:09 27/06/2003 +0100, you wrote:

>Hi all,
>
>I'm trying to create a dynamic link generated by a xsp page.
>Inside the html code:
>         <a href="<insert link>">Link to some page</a>
>I want to replace the <insert link> with a value passed back by a object 
>method.
>
>E.g. This is what I trying at the moment
><xsp:logic>
>         //get someObject from somewhere
>         <xsp:content>
>                 <a href="<xsp:expr>someObject.getURL()</xsp:expr>">Link 
> to some page</a>
>         </xsp:content>
></xsp:logic>
>I get back a error from cocoon complaining about the '<' of the <xsp:expr> 
>tag.
>"Original Exception: org.xml.sax.SAXParseException: The value of attribute 
>"href" must not contain the '<' character"
>
>Any one any ideas how to solve this.
>
>Thanks
>
>Stephen Greene


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