xslt transformation into html and javascript

J

Jon Martin Solaas

For java programmers there exist a framework called Millstone
(www.millstone.org) for programming web user-interfaces in a component
oriented way. Millstone uses xslt transformations to render components
as html. I'm trying to modify millstone so that it can display a html
editor widget called HTMLArea instead of the usual html <textarea>
tag. But I need a little help with the xslt transformation. Especially
there is a construct, {wa:resource('script/htmlarea.js')} that makes a
relative path absolute within the web-application context. I use this
to reference a javascript file like this:

<script type="text/javascript"
src="{wa:resource('script/htmlarea.js')}"></script>

My problem is that when I use the wa:resource construct outside a tag
parameter it's ignored by the processor, so that I can't use a
relative path, and hence have to hardcode an application specific path
into the library, which is not what I want:

<script type="text/javascript">
_editor_url = "/PaddaWeb/AdminGUI/RES/default/script/";
//_editor_url = "{wa:resource('script/')}";
_editor_lang = "en";
</script>

What I'd like to do is to use wa:resource somehow inside the
javascript, like I've tried in the codeline that's commented out.
Obviously the syntax is not correct as the xslt-transformer just
ignores it. If someone know how to do this I'd be very grateful.

Jon Martin Solaas
jonmartin.solaas$hotmail.com
 
P

Philippe Poulard

Jon said:
For java programmers there exist a framework called Millstone
(www.millstone.org) for programming web user-interfaces in a component
oriented way. Millstone uses xslt transformations to render components
as html. I'm trying to modify millstone so that it can display a html
editor widget called HTMLArea instead of the usual html <textarea>
tag. But I need a little help with the xslt transformation. Especially
there is a construct, {wa:resource('script/htmlarea.js')} that makes a
relative path absolute within the web-application context. I use this
to reference a javascript file like this:

<script type="text/javascript"
src="{wa:resource('script/htmlarea.js')}"></script>

this XSLT stuff is an "attribute value template"
as indicated by its name, it works only within attribute values
My problem is that when I use the wa:resource construct outside a tag
parameter it's ignored by the processor, so that I can't use a
relative path, and hence have to hardcode an application specific path
into the library, which is not what I want:

<script type="text/javascript">
_editor_url = "/PaddaWeb/AdminGUI/RES/default/script/";
//_editor_url = "{wa:resource('script/')}";
_editor_lang = "en";
</script>

try this instead (don't forget to remove { and } !!!) :

<script type="text/javascript">
//_editor_url = "/PaddaWeb/AdminGUI/RES/default/script/";
_editor_url = "<xsl:value-of select="wa:resource('script/')"/>";
_editor_lang = "en";
What I'd like to do is to use wa:resource somehow inside the
javascript, like I've tried in the codeline that's commented out.
Obviously the syntax is not correct as the xslt-transformer just
ignores it.

it is text : a text encountered in input creates a text in output

If someone know how to do this I'd be very grateful.
Jon Martin Solaas
jonmartin.solaas$hotmail.com


--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
 
J

Jon Martin Solaas

Philippe Poulard wrote:

try this instead (don't forget to remove { and } !!!) :

<script type="text/javascript">
//_editor_url = "/PaddaWeb/AdminGUI/RES/default/script/";
_editor_url = "<xsl:value-of select="wa:resource('script/')"/>";
_editor_lang = "en";
</script>

Thanks a bunch, now it works just like it should. I'd also like to take
the opportunity to recommend Millstone to any java-programmers that
might read this, have a look at www.millstone.org.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top