• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

xsl variables to core set

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys,

I am completely new to this and I am still learning.

I need to pass a variable something like this

<xsl:variable name="test" select="description"/>
<c:set var="message" value="${test}" />

Is this at all possible or am I barking up the worng tree.
I need the set var as a string so I can pass it to another tag.

Thanks
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
xsl variable mixed with a c:set JSP file ?

XSL commands are part of a XSLT process. I am not sure I understand your question. How are the XML / XSLT / JSP files related ?
 
Rob Stan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well (still being new to this) it is all happening in the same file.

Deepak Bala wrote:xsl variable mixed with a c:set JSP file ?

XSL commands are part of a XSLT process. I am not sure I understand your question. How are the XML / XSLT / JSP files related ?

 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this a XML file ?

My best guess is that a XSL transformation rule runs on a XML file to produce a JSP which contains the c:set element. Is that the case ?
 
Rob Stan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I think that to be the case.
The <c:set> I have actually added.

I am using given code and I have not written it myself.

<xsl:variable name="test" select="description"/>

What I want to do is take the xsl variable which is in fact just a string of text
and pass it to and set it as a global so that I can use that global in another
taglib.

<c:set var="message" value="${test}" />

Mind you as I have said I am still new to this and I am sure
I understand the way to think yet.

Appreciate the help.

Deepak Bala wrote:Is this a XML file ?

My best guess is that a XSL transformation rule runs on a XML file to produce a JSP which contains the c:set element. Is that the case ?

 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the best thing to do is to step back and look at what you want to do.

You have a XML file that a XSLT works on a to give an output file. Is this output file a JSP or HTML ? What is your requirement ?
 
Rob Stan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think you are right. I need to learn more how this all works.

The output is in html to my understanding.

Deepak Bala wrote:I think the best thing to do is to step back and look at what you want to do.

You have a XML file that a XSLT works on a to give an output file. Is this output file a JSP or HTML ? What is your requirement ?

 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The output is in html to my understanding.



Cool. So what is the nature of the change that you want to make to this file ? Someone requested new data to become available in the view ?
 
Rob Stan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, yes and no (take into consideration that this is still all new to me).
Let's assume that it is suppose to be available in the view.
How would I do that?

Deepak Bala wrote:

The output is in html to my understanding.



Cool. So what is the nature of the change that you want to make to this file ? Someone requested new data to become available in the view ?

 
Ranch Hand
Posts: 88
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well Rob I am assuming here you are completely newbee, so I am stating some fundamentals here:

1. XSL is used as template to generate html document.
In XSL you have various place holders which specify dynamic data.
Now to use this template, a XML is mapped upon XSL for this tag hirarchy XML should correspond to XSL place holders.
The combined output is html. This whole api is availble in J2SE only, so you can generate html pages out of desktop application.

2. JSP technology is based upon java servlet api. It acts as template to produce html. It is part of J2EE.

Well, uptil here they seem to be compareable in terms of end result. But, they do not mix/gel togather as purposes of each is different.
A JSP/Servlet is equipped with servlet lifecycle. It has all the fundamental specifications to be developed as a full fleged, dynamic web application.
While, XSL is only for smaller roles like generating a html report from application or likewise.

In short below will nerver gel togather.
<xsl:variable name="test" select="description"/>
<c:set var="message" value="${test}" />

 
Rob Stan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys, I really appreciate the support.
I found a work around that I can use, I am sure I am breaking many paradigms though
And yes, I am still learning all this.

This is what I did, using some JavaScript

<%String myVar = "<xsl:variable name=\"test\" select=\"description\"/>"; %>
<%=myVar%>

Thanks agian guys!

Rob

Shashank Ag wrote:Well Rob I am assuming here you are completely newbee, so I am stating some fundamentals here:

1. XSL is used as template to generate html document.
In XSL you have various place holders which specify dynamic data.
Now to use this template, a XML is mapped upon XSL for this tag hirarchy XML should correspond to XSL place holders.
The combined output is html. This whole api is availble in J2SE only, so you can generate html pages out of desktop application.

2. JSP technology is based upon java servlet api. It acts as template to produce html. It is part of J2EE.

Well, uptil here they seem to be compareable in terms of end result. But, they do not mix/gel togather as purposes of each is different.
A JSP/Servlet is equipped with servlet lifecycle. It has all the fundamental specifications to be developed as a full fleged, dynamic web application.
While, XSL is only for smaller roles like generating a html report from application or likewise.

In short below will nerver gel togather.
<xsl:variable name="test" select="description"/>
<c:set var="message" value="${test}" />

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic