0

I have a XML and XSLT like this:

XML

<process id="1"> 
  <task id="task1">
  </task>
  <task id="task2">
  </task> 
  ...
</process>

XSLT

<msxsl:script language="C#" implements-prefix="user">

    <![CDATA[
      public string GetStartTask(int ProcessID)
       {         
          return StartTask(ProcessID);
        }
    ]]>

</msxsl:script>

...
<xsl:if test="@id = user:GetStartTask(<xsl:value-of select="/../@id"/>)">
   ...
</xsl:if>
...

(StartTask is method that return string.)

In code above I try to pass process id to GetStartTask function by this:

<xsl:value-of select="/../@id"/>

But this code is incorrect. I read many post but I don't find syntax for this issue.

It would be very helpful if someone could explain solution for this issue.

2 Answers 2

1

I think you meant to write:

<xsl:if test="@id = user:GetStartTask(../@id)">

This is assuming you're in the context of task and you want to compare the value of the current task's idwith the value returned by the GetStartTask() function with the parent process id as the argument.

Sign up to request clarification or add additional context in comments.

Comments

0

If your current context is <task>, you should try

<xsl:value-of select="../@id" />

as an XSLT expression.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.