Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xslt transformation into html and javascript

Reply
Thread Tools

xslt transformation into html and javascript

 
 
Jon Martin Solaas
Guest
Posts: n/a
 
      06-14-2004
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
 
Reply With Quote
 
 
 
 
Philippe Poulard
Guest
Posts: n/a
 
      06-14-2004
Jon Martin Solaas wrote:
> 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";
</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.


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 |
-----------------------
 
Reply With Quote
 
 
 
 
Jon Martin Solaas
Guest
Posts: n/a
 
      06-15-2004
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.

--
Jon Martin Solaas
jonmartin.solaas$h0tm4i1

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT Transformation in Javascript Tom Cole Javascript 4 08-30-2006 01:06 PM
XSLT Transformation into String Mathieu Java 2 06-01-2006 05:07 PM
JAXP - Fusing XSLT transformation results into a single XML file Blue Gecko Java 1 10-03-2005 09:39 AM
XSLT XML-HTML Transformation using grouping Kevin Brown XML 3 08-28-2004 03:39 PM
Xslt Transformation getting &lt; and &gt; =?Utf-8?B?UGF0Qw==?= ASP .Net 2 05-19-2004 12:15 AM



Advertisments