Using EXSLT in BizTalk
we need to create a xml that has EXSLT assembly like for example below
<?xml version="1.0" encoding="utf-8"?>
<ExtensionObjects>
<ExtensionObject
Namespace="http://exslt.org/dates-and-times"
AssemblyName="Mvp.Xml,
Version=2.3.0.0, Culture=neutral,
PublicKeyToken=6ead800d778c9b9f"
ClassName="Mvp.Xml.Exslt.ExsltDatesAndTimes"/>
</ExtensionObjects>
and now if you want to you EXSLT date funtion in your custom xslt, then mention like below
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:S1="http://ExtendedMapping.Schema1"
xmlns:S2="http://ExtendedMapping.Schema2"
xmlns:exslt="http://exslt.org/dates-and-times"
version="1.0">
<xsl:template match="/">
<S2:Root>
<Field>
<xsl:value-of select="exslt:dateTime()"/>
</Field>
</S2:Root>
</xsl:template>
</xsl:stylesheet>
And to loop through each distict node (faster grouping) in fast way,
you can use Distinct() function of EXSLT like below
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:set="http://exslt.org/sets">
<xsl:output indent="yes"/>
<xsl:key name="countryKey" match="orders" use="ID"/>
<xsl:template match="root">
<table border="1">
<tr>
<th>Order ID</th>
<th>Ship City</th>
</tr>
<xsl:for-each select="set:distinct(orders/ID)/..">
<tr>
<th colspan="2">
<xsl:value-of select="ID/text()"/>
</th>
</tr>
<xsl:for-each select="key('countryKey',ID)">
<tr>
<td>
<xsl:value-of select="@OrderID"/>
</td>
<td>
<xsl:value-of select="@ShipCity"/>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
and don’t forget to read below URLs
http://www.richardhallgren.com/how-the-extend-a-custom-xslt-in-biztalk-using-exslt-and-the-mvpxml-project/
http://msdn.microsoft.com/en-us/library/aa302297.aspx#xmlindexing_topic3
For loop in xslt
<xsl:template name="for.loop">
<!-- for loop templates starts here-->
<!-- for loop index variable-->
<xsl:param name="i" />
<!-- for loop end variable-->
<xsl:param name="count" />
<!--begin_: Line_by_Line_Output -->
<xsl:if test="$i <= $count">
<!-- This $i variable gives the increment value -->
<xsl:value-of select="$i"/>
</xsl:if>
<!--begin_: RepeatTheLoopUntilFinished-->
<xsl:if test="$i <= $count">
<xsl:call-template name="for.loop">
<xsl:with-param name="i">
<xsl:value-of select="$i + 1"/>
</xsl:with-param>
<xsl:with-param name="count">
<xsl:value-of select="$count"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
Source from http://blog.logiclabz.com/xml-xslt/for-loop-in-xslt.aspx
Reset Outlook Connection
This is a well hidden trick in Outlook. Not sure why this needs to be hidden. You can open Connection Status window by holding CTRL + right-clicking on the Outlook system tray icon on the Task Bar.
reconnect the disconnected connections
http://blogs.msdn.com/b/esiu/archive/2007/09/22/reset-outlook-connections-without-restart.aspx
Validate incoming message in xml default pipeline
1) Open BizTalk Server Administration Console
2) Click on the application contain the receive location
3) Click on “Receive Locations”
4) Double click the particular receive location on the right hand side
5) Click the button next to the drop down list entitled “Receive pipeline”
6) Change “ValidateDocument” to true
7) set the DocumentSpecName
You can get the DocumentSpecName of a schema information by clicking on the schema node inside the
biztalk application by doing the Combination of Name + “,” + Assembly
Biztalk orchestration patterns
http://patternwizard.codeplex.com/
Grouping in xslt
http://blogs.msdn.com/b/chrisromp/archive/2008/07/31/muenchian-grouping-and-sorting-in-biztalk-maps.aspx
http://blogs.msdn.com/b/skaufman/archive/2005/12/19/505654.aspx
for multilevel grouping concate the fields to create unique key like here
http://www.biglist.com/lists/xsl-list/archives/200101/msg00070.html
while creating keys in xsl, if you want to create keys based on some filed value, use like below
<xsl:key name="UniquePhoneHomeGroups" match="HorizonEdExtract[PhoneHome/text() != '']" use="concat(ID,PhoneHome)"/>
the above key matches againt all non empty PhoneHome nodes under HorizonEdExtract record.
if you want compare attribute of a node you can use below
<xsl:key name="bookByLanguage" match="book[@isenglish="Yes"]" use="id"/> or you can use multiple conditions like below <xsl:key name="booksEnglishNoPub" match="book[@isenglish='Yes' and @pub-id='']" use="id"/> (This multiple condition is not tested)
http://p2p.wrox.com/xslt/66290-giving-two-conditions-match-xsl-key.html
why do we need to call pipeline from orchestration and how do we do it?
http://geekswithblogs.net/sthomas/archive/2005/06/16/44023.aspx
http://geekswithblogs.net/arnoudlems/articles/69521.aspx
BizTalk Aggregation Pattern for Large Batches
http://blogs.msdn.com/b/richardbpi/archive/2006/05/08/592476.aspx
Get Uniques values from a list through XSLT
Get Unique values for a list of values
xxxx
yyyy
xxxx
The desired output is:
xxxx
yyyy
so use this
<xsl:variable name="unique-list" select="//state[not(.=following::state)]" /> for example like below <xsl:variable name="unique-list" select="s4:AdTermID[not(.=following::s4:AdTermID)]" />
the above statement will get the unique values in to that variable (just like it is an array)
if you want to make a for each loop based on this unique values use below code
<xsl:for-each select="$unique-list"> your logic here </xsl:for-each>
if you want to compare any value to this array element use below code where AdTermID is the elemnt
<xsl:if test="your elment here=s4:AdTermID[not(.=following::s4:AdTermID/text())]">
when you try to compare a value with thes values in the array you should use /text()
source of article
http://www.bernzilla.com/item.php?id=333
see the comments of Abhinav Maheshwari
Virtual PC console not showing up
VPC stored it’s configuration in the following file:
%APPDATA%\Microsoft\Virtual PC\Options.xml
Within that XML file, I found the following nodes: “left_position” and “top_position”
Reset “left_position” and “top_position” to 0 fixed the issue.
-
Recent
- Using EXSLT in BizTalk
- For loop in xslt
- Reset Outlook Connection
- Validate incoming message in xml default pipeline
- Biztalk orchestration patterns
- Grouping in xslt
- why do we need to call pipeline from orchestration and how do we do it?
- BizTalk Aggregation Pattern for Large Batches
- Get Uniques values from a list through XSLT
- Virtual PC console not showing up
- Directly querying the BizTalk database for suspended messages
- Project Reference Errors in BizTalk
-
Links
-
Archives
- January 2012 (2)
- November 2011 (1)
- July 2011 (3)
- June 2011 (12)
- May 2011 (1)
- April 2011 (1)
- March 2011 (1)
- November 2010 (1)
- October 2010 (10)
- September 2010 (7)
- July 2010 (1)
- June 2010 (4)
-
Categories
-
RSS
Entries RSS
Comments RSS