473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

xslt transformation into html and javascript

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
Jul 20 '05 #1
2 2364
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 |
-----------------------
Jul 20 '05 #2
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

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
8
by: David Dorward | last post by:
I'm looking for an XSLT that I can use to transform XHTML 1.0 Strict into HTML 4.01. Does anyone know of a nice prewritten one? -- David Dorward ...
6
by: RC | last post by:
Hello World, I am try do call a JavaScript function from XSLT, but I got function not avaible error. See "????" below. Would someone out there tell me how? Thank Q! <xsl:stylesheet...
4
by: Stephen | last post by:
I have the following that outputs an xml file to a div using ajax: <script type="text/javascript"> function ajaxXML(url,control_id){ if (document.getElementById) { var x =...
5
by: shauldar | last post by:
Is there a way (tool, hack...) to create an XSL:FO from an XSLT + XML files? My motivation is that we want to use a tool to design reports, and from that "design" generate both HTML (via XSLT)...
2
by: RJN | last post by:
Hi Can XSLT be applied for transforming .txt files or are they applicable only for xml to xml transformation. Currently all the clients send file to a server in one particular format. The...
4
by: Philipp Reiss | last post by:
Hello group, I'm new in this topic and I run into problems where google can't help me. I have a XML-file, wich is bound to a XSLT-file, and this works fine in a browser. How do I show the same...
3
by: RC | last post by:
Let's say: if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { // Now I got an XML object here var xmlDocument = XMLHttpRequestObject.responseXML; // next I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.