IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  variables in expressions

    Posted 10/06/04 05:26 AM

    Sorry about all the questions. Ah, the joys of being new to xslt :stuck_out_tongue:

    What I am trying to accomplish this time is output dependent upon presence of an attribute matching a variable. Here is roughly what I am trying to accomplish. Obvously, it doesn’t work, so this hinges on being able to understand theoretical, rather than actual, xslt.

    <xsl:template>
    <xsl:variable name="page" select="1" />
    . . .
    <xsl:apply-templates select="question[@page='$pg']" />
    </xsl:template>
    </pre><BR><BR>and in the xml<BR><BR><pre class="ip-ubbcode-code-pre">
    <question page="1"> ... </question>
    <question page="2"> ... </question>
    ...



    Of course, it works when I replace @page=‘$pg’ with @page=‘1’ , or if I change the value in the xml to , the idea being that it will only display s with the correct page specified.

    Ultimately, I’d really like to replace the variable with a param, because it is going to be set from outside the xslt (ASP.net), so the same xml file can be used and, based on the page param set from ASP.net, display elements corresponding to the current page.

    What do I need to do to make it work with the variable, assuming the variable matches? What to make a param work?

    Thanks in advance, sorry if it’s a lot of trouble for a simple answer. We all gotta start somewhere.

    -Term


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: variables in expressions

    Posted 10/06/04 05:31 AM

    Nevermind.

    I dont know why it all-of-a-sudden decided to work, but I must have made some small change I don’t notice to make it work. It works now for params (local and global) as well as variables.

    Sorry for the useless post.

    -Term


    #webMethods
    #API-Management
    #Tamino


  • 3.  RE: variables in expressions

    Posted 10/13/04 03:34 PM

    Hi

    omitting the quotes, i.e. using
    select=“question[@page=$pg]”
    instead of
    select=“question[@page=‘$pg’]”
    should work

    Uli


    #Tamino
    #API-Management
    #webMethods


  • 4.  RE: variables in expressions

    Posted 10/13/04 11:18 PM

    Yeah, I think that’s what the problem was. When I fixed it, i didn’t realize what I’d done, but now that I’ve repeated it, I’m sure thats what it was. Thanks.

    -Term


    #Tamino
    #API-Management
    #webMethods