xslt:Registry access within maps

Home Page Forums BizTalk 2004 – BizTalk 2010 xslt:Registry access within maps

Viewing 1 reply thread
  • Author
    Posts
    • #16509

      Hi,

      I am new to BizTalk. I have created a map using custom xsl. I am facing the need to access some registry key values and provide the respective values to the output nodes.I would like to know if it is possible to access registry keys using xslt.

      Thanks in advance.

       

       

       

       

    • #16515

      1. Create a file called Extension-Registry.xml, add to your project and add this xml:

      <ExtensionObjects>
      <ExtensionObject Namespace="
      http://schemas.microsoft.com/BizTalk/2003/Registry" AssemblyName="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ClassName="Microsoft.Win32.Registry" />
      </ExtensionObjects>

      2. Open your map file, select the grid and set the Custom Extension Xml property to the file above

      3. Add this namespace to the <xsl:stylesheet> node of your custom Xslt

      xmlns:Registry="http://schemas.microsoft.com/BizTalk/2003/Registry"

      4. Add this xslt code where appropriate:

      <xsl:element name="Value">
      <xsl:value-of select="Registry:GetValue(<keyName>, <valueName>, <defaultValue>)" />
      </xsl:element>

      • #16532

        Hi,

        Thanks for the fix. I will try it out.

      • #16533

        Hi,

        Thanks for the fix. I will try it out.

        • #16537

          Hi Greg,

          For the above method to providing registry:getvalue(), do we need to add a reference to any dll. I am getting an error : "Constructor on type 'Microsoft.Win32.Registry' not found". I am not able to figure out the error.

           I created a key named AccessKeyFolder under Regedit "MyComupter\HKEY_LOCAL_MACHINE\Software\AccessKeyFolder"

          Below that Key I created 2 keys AccessKey1 and AccessKey2.

          Path is "MyComputer\HKEY_LOCAL_MACHINE\Software\AccessKeyFolder\AccessKey1"

                     "MyComputer\HKEY_LOCAL_MACHINE\Software\AccessKeyFolder\AccessKey2"

          In the xsl style sheet:

          *****

          Defined <xsl:variable name="keyname" select="(concat'MyComputer','\','HKEY_LOCAL_MACHINE','\','Software','\','AccessKeyFolder','\','AccessKey1')"/>

          <variable1> <xsl:value-of select="Registry:GetValue($keyname,'Name',Nothing)"/></variable1> 

           ****** 'Name' is the property along with type(REG_SZ) and default value when a key is created.  

          Please do let me know where I might be going wrong.

          Thanks

           

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.