BizTalk 2009 XSLT and Attribute Value Templates
Posted
by amok
on Stack Overflow
See other posts from Stack Overflow
or by amok
Published on 2010-05-28T12:13:46Z
Indexed on
2010/05/28
13:02 UTC
Read the original article
Hit count: 322
I'm trying to make use of attribute value type in a BizTalk XSL transformation to dynamically setting attribute or other element names.
Read more here: http://www.w3.org/TR/xslt#dt-attribute-value-template
The following code is an example of an XSL template to add an attribute optionally.
<xsl:template name="AttributeOptional">
<xsl:param name="value"/>
<xsl:param name="attr"/>
<xsl:if test="$value != ''">
<xsl:attribute name="{$attr}">
<xsl:value-of select="$value"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
Running this script in BizTalk results in "Exception from HRESULT: 0x80070002)"
An alternative I was thinking of was to call a msxsl:script function to do the same but i cannot get a handle on the XSL output context from within the function.
An ideas?
© Stack Overflow or respective owner