webMethods

webMethods

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.

 View Only
Expand all | Collapse all

a form input value as a variable for html form handler

  • 1.  a form input value as a variable for html form handler

    Posted Fri March 09, 2007 10:44 PM

    More search form grief (I keep trying). :frowning:

    I have searched everywhere and have not found a way to make this happen. I’m trying to take the value of a text input form element and turn it into a variable I can place in a hidden input form element value. I need to do this becuase I am creating a full text search form which should only search through certain files in multiple doctypes.

    For example:

    search keyword = ‘somekeyword’

    Get me all docs in //Procedure[@ID = ‘1’ or @ID =‘2’] | //Concept[@ID = ‘5’] | //Process[@ID = ‘1’ or @ID =‘2’] with ‘somekeyword’ in text of all nodes.

    I know the xquery would be:

    http://hsicomp01/tamino/mydb/mycollection?_xql=//Procedure[@ID = '1' or @ID ='2' and //*='somekeyword'] | //Concept[@ID = '5' and //*='somekeyword'] | //Process[@ID = '1' or @ID ='2' and //*='somekeyword']

    But all I can seem to create using the Tamino form handler is something like (xql url vs. HTMLreq url):

    http://hsicomp01/tamino/mydb/mycollection?_xql=//Procedure[@ID = '1' or @ID ='2'] | //Concept[@ID = '5'] | //Process[@ID = '1' or @ID ='2'][//*='somekeyword']

    So I figured if I could just grab the value of a text input and include it in a variable that makes up the XQLNode value, I could get what I want. But no dice.

    Here’s what I have so far:

    I have a form in an xsl styelsheet (simplified version):

    <form id="search" name="search" action="http://hsicomp01/tamino/mydb/mycollection">
    <input>
    <xsl:attribute name="type">text</xsl:attribute>
    <xsl:attribute name="size">20</xsl:attribute>		
    <xsl:variable name="keyword" select="@value"/>	
    </input>
    <xsl:variable name="XQLNode">
    //Procedure[//@ID="<xsl:value-of select="$ProcedureIDArray"/>" and //*="<xsl:value-of select="$keyword/*"/>"] | //Concept[//@ID="<xsl:value-of select="$ConceptIDArray"/>" and //*="<xsl:value-of select="$keyword/*"/>"] | //Process[//@ID="<xsl:value-of select="$ProcessIDArray"/>" and //*="<xsl:value-of select="$keyword/*"/>"]
    </xsl:variable>
    <input>
    <xsl:attribute name="type">hidden</xsl:attribute>
    <xsl:attribute name="name">_HTMLreq</xsl:attribute>
    <xsl:attribute name="value">_XQL//tamino/mydb/mycollection/xsl:stylesheet/searchResults.xslt</xsl:attribute>
    </input>
    <input>
    <xsl:attribute name="type">hidden</xsl:attribute>
    <xsl:attribute name="name">XQLNode</xsl:attribute>
    <xsl:attribute name="value"><xsl:value-of select="$XQLNode"/></xsl:attribute>
    </input>
    <input type="submit" value="process"/>
    </form>

    Is there any way I can do this?


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: a form input value as a variable for html form handler

    Posted Mon March 12, 2007 01:47 AM

    I think I’m going to look into using XForms. From what Ive read it seems like a solution to make my search form problems easier to manage. I realize I am also confusing the Pass-Thru Servlet with the Form Handler.

    http://www.orbeon.com is open source and works with Tamino. 8=)


    #webMethods
    #API-Management
    #Tamino