xslt transformation into html and javascript

Discussion in 'XML' started by Jon Martin Solaas, Jun 14, 2004.

  1. 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
     
    Jon Martin Solaas, Jun 14, 2004
    #1
    1. Advertising

  2. 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 |
    -----------------------
     
    Philippe Poulard, Jun 14, 2004
    #2
    1. Advertising

  3. 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
     
    Jon Martin Solaas, Jun 15, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF0Qw==?=

    Xslt Transformation getting &lt; and &gt;

    =?Utf-8?B?UGF0Qw==?=, May 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    879
    Steven Cheng[MSFT]
    May 19, 2004
  2. Blue Gecko
    Replies:
    1
    Views:
    463
    Blue Gecko
    Oct 3, 2005
  3. Kevin Brown
    Replies:
    3
    Views:
    581
    Kevin Brown
    Aug 28, 2004
  4. Mathieu

    XSLT Transformation into String

    Mathieu, Jun 1, 2006, in forum: Java
    Replies:
    2
    Views:
    624
    Mathieu
    Jun 1, 2006
  5. Tom Cole

    XSLT Transformation in Javascript

    Tom Cole, Aug 29, 2006, in forum: Javascript
    Replies:
    4
    Views:
    144
    Martin Honnen
    Aug 30, 2006
Loading...

Share This Page