Solved

Embedded code block in XSL doc

Posted on 2010-11-24
4
405 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
ID: 34212343
in the XSLT put

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

Open in new window

0
 

Author Comment

by:itsthunt
ID: 34212449
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
ID: 34212598
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
ID: 34312811
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

895 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

14 Experts available now in Live!

Get 1:1 Help Now