Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xsl variables to core set

 
Rob Stan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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 ?
 
Shashank Ag
Ranch Hand
Posts: 88
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • 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}" />

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic