Solved

Embedded code block in XSL doc

Posted on 2010-11-24
4
404 Views
Last Modified: 2013-11-08
Hi am creating a dynamic form from xml transform with xsl.
I need to have a codeblock in the xsl file which pulls data from the codebehind.
ex <%= score %>

Can someone tell me do I need to escape this character? or how do I implement this?

Thanks!
0
Comment
Question by:itsthunt
  • 2
  • 2
4 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
Comment Utility
in the XSLT put

<xsl:text>&lt;%= score %&gt;</xsl:text>

Open in new window

0
 

Author Comment

by:itsthunt
Comment Utility
UNfortunately all this does is display <%= score %> on the webpage, and asp.net does not recognize it as a server tag.

Any other suggestions?
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 250 total points
Comment Utility
well, you asked to put that block there and escape the characters.
What did you expect?

The ASP calls the XSLT and sends the result to the client.
ASP does not touch the result of the transform afterwards.

If you want to execute some logic directly at a certain point in the XSLT transform.
You will need to use an extension function likely
(depends on what you expect te <%= score %> to do)

what is the logic behind this?
Why do you need this
and what do you want to happen exactly?
0
 

Author Closing Comment

by:itsthunt
Comment Utility
I would have assumed that needing a codeblock such as <%= score %> obviously states that it needed to be functional with codebehind and not just read as text. I didn't ask to escape the characters, I asked if it was necessary to achieve my goal.
I will accept your answer, only because there is no other answer.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now