Extending XSLT

Bonekrusher

Active member
Joined
Jul 4, 2007
Messages
38
Programming Experience
1-3
Hi,

I am triyng to learn how to extend XSLT with VB.net. I have a simple example that I need help with.

How do I call the following class (dll) from XSLT?

VB.NET:
Namespace ACM
    Public Class testFunction

        Public Function returnDate(ByVal xslDate As String) As String
            Return xslDate
        End Function

    End Class
End Namespace

Here is my XSLT:

VB.NET:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ACM="urn:testFunction">
	<xsl:output method="html"/>
	<xsl:template match="/">
		<html>
			<head>				
			</head>
			<body>
				<xsl:for-each select="/root/member">
					<xsl:value-of select="ACM:returnDate(joiningdate)"/>
				</xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>

I need help declaring the namespace and calling the function.

Thanks
 
Hi,

Thanks for the reply. Unfortunitly I can not get any examples I found online working.

Can I use extensions with IE 6 (MSXML)?
 
No, these extensions work through XslCompiledTransform class. If you just link a Xml to a Xsl stylesheet and open it in browser the .Net Framework isn't present or an active component. You can do stuff like this from a windows client application or a ASP.Net server application, but not from client side Html(Xml) document.
 
Back
Top