Return-Path:
Delivered-To: apmail-xml-cocoon-users-archive@xml.apache.org
Received: (qmail 68321 invoked by uid 500); 26 Nov 2002 14:12:23 -0000
Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm
Precedence: bulk
list-help:
list-unsubscribe:
list-post:
Reply-To: cocoon-users@xml.apache.org
Delivered-To: mailing list cocoon-users@xml.apache.org
Received: (qmail 68309 invoked from network); 26 Nov 2002 14:12:23 -0000
Message-ID: <002701c29555$ceb93c00$a800000a@lisa>
From: "Anna Afonchenko"
To:
References: <20021125221439.36629.qmail@web40804.mail.yahoo.com>
Subject: Re: JavaScript problems in XSP
Date: Tue, 26 Nov 2002 16:11:55 +0200
Organization: UBAccess
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
Hi Geoff. Thanks for helping me.
If you don't mind, I want to ask you some more questions, cause I still
don't really understand what I have to do.
1. I didin't find any example of xsp using Rhino. Can you give me an
example, or a URL to the page with example? I am sorry, but I tried hard to
find examples, and I just didn't succeed. In Cocoon documentation it is
mentioned that Rhino can be used as an XSP scripting language, but they
don't give any example.
2. Can I use JSGenerator instead of ServerPagesGenerator on the pipeline?
All these things confuse me alot, and I'll be very happy if you gave me some
more clues.
Thank you very very much and sorry for attacking you with so many questions.
Anna
----- Original Message -----
From: "Geoff Howard"
To:
Sent: Tuesday, November 26, 2002 12:14 AM
Subject: Re: JavaScript problems in XSP
Ugh. This may spell bad news: see inline comments.
If you are comfortable in java as well as javascript
(at least reasonably so) you may want to look into
using a java based javascript interpreter - looking
into the cocoon javascript generator
(org.apache.cocoon.components.language.markup.xsp.JSGenerator)
and other JS related sources around there in the
source tree it looks like cocoon is using Rhino
(http://www.mozilla.org/rhino/). Then, you can write
your xsp in java (which has far more features and
users) but still execute arbitrary javascript code
when you find it. That said, I think you're on a
potentially very confusing path because of all the
places javascript can be in an html page, and all the
DOM objects it's likely to reference.
Still, this may work and I'd be very interested to
hear how it goes and help as I can - but I've never
touched Rhino and can't right now.
Geoff (more comments below)
--- Anna Afonchenko wrote:
> 1. First of all I tried to give the eval() function
> some simple string that
> I declared inside the tag: someStr =
> "document.write('Hello')";
> If I write this string inside the
> document.text, the
> output is:
>
>
>
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> xmlns:util="http://apache.org/xsp/util/2.0">
> Hello
>
>
> which is great, but when I looked in the source
> code, I found out that the
> Hello string
> is written using entities, e.g. it is not a node-set
> of the output xml
> document.
Right, sorry about that. I had seen in another email
that you were using so I left that
part out for simplicity but forgot to comment as such.
>
> Trying to enclose the tag inside the
> tag:
>
>
document.text
>
> the surprising output is:
>
>
>
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> xmlns:util="http://apache.org/xsp/util/2.0">
>
>
> Hello
>
>
>
> This is strange. Do
> you have any idea how
> can I avoid outputting the result as a string (with
> entities) rather that
> outputting it as a node-set?
Not surprising - just checked and javascript xsp's
have only request, response and session logicsheets.
I don't know if it's possible to recreate the include
expression functionality in javascript - you may want
to send a very specific question on that to this list,
making clear that you know it doesn't yet exist.
>
>
> 2. How can I retrieve the content of some html file
> from xsp with
> javascript?
I don't know if you can - you can't from a browser,
but that may be only because of the security
limitations imposed.
> And parse it?
See above.
> Is it possible that there are
> problem using util
> library from xsp with javascript?
Right. It doesn't exist in javascript.
Geoff
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting.
To unsubscribe, e-mail:
For additional commands, e-mail:
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting.
To unsubscribe, e-mail:
For additional commands, e-mail: