Home Page › Forums › BizTalk 2004 – BizTalk 2010 › xslt:Registry access within maps
- This topic has 4 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
November 23, 2006 at 4:46 AM #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.
-
November 23, 2006 at 12:31 PM #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>-
November 26, 2006 at 9:25 PM #16532
Hi,
Thanks for the fix. I will try it out.
-
November 26, 2006 at 9:25 PM #16533
Hi,
Thanks for the fix. I will try it out.
-
November 27, 2006 at 2:51 AM #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
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.