Modifying User Variables Through Watson Explorer Engine XML

User variables can easily be modified by the query-meta application by just setting them to different values. This is usually done in the main macro, which is processed each time query-meta is run (the script will save the user profile before terminating and destroying the Watson™ Explorer Engine object).

For example, imagine that you want to collect the users' emails from an active directory (rather than requiring the users to enter the emails in their profile). You can add the following code into the main macro (substituting appropriate authentication details for your organization):

  <set-var name="">
    <parse username="bindinguser" password="bindingpassword"
           cache-read="10000" cache-write="10000" >
      <attribute name="url">
        <value-of-var name=""/>
      <parser type="html-xsl">
        <xsl:output method="text"/>
        <xsl:template match="/">
          <xsl:value-of select="normalize-space(substring-after(str:tokenize(//text(), '&#10;')[contains(., 'mail:')],'mail:'))"/>