• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 412
  • Last Modified:

Embedded code block in XSL doc

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
itsthunt
Asked:
itsthunt
  • 2
  • 2
1 Solution
 
Geert BormansCommented:
in the XSLT put

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

Open in new window

0
 
itsthuntAuthor Commented:
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
 
Geert BormansCommented:
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
 
itsthuntAuthor Commented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now