?
Solved

Embedded code block in XSL doc

Posted on 2010-11-24
4
Medium Priority
?
410 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

801 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