Is there a way to create custom tag extending XSLT in a similar way to custom function?
ie (in my xslt file):
<xsl:template match="/">
<div>
<my:customTag items="3" classname="foo"/>
</div>
</xsl:template>
expected output:
<div>
<ul class="foo">
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
<div>
Currently I'm doing this:
<xsl:template match="/">
<div>
<xsl:copy-of select="my:customFunc(3,'foo')" />
</div>
</xsl:template>
and my customFunc in vb code do something like this:
Public Function customFunc(ByVal n As Integer, ByVal classname as String) As System.Xml.XmlNode
Dim newNode As System.Xml.XmlNode
Dim doc As System.Xml.XmlDocument = New System.Xml.XmlDocument()
Dim xmlContent As String = "<ul class=""" + classname + """>"
For v As Integer = 0 To n
xmlContent += "<li>" + someComplicatedCalc(n) + "</li>"
Next
xmlContent += "</ul>"
doc.LoadXml(xmlContent)
newNode = doc.DocumentElement
Return newNode
End Function
but I want to use tags instead of functions.