Solved

Embedded code block in XSL doc

Posted on 2010-11-24
4
407 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

860 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