Hi there,
I'm using a style sheet to transform a xml document into another xml document. When I try to apply the style sheet into the xml I get an error:
>
This name may not contain the '$' character:
-->$<--node/*[1]/@name
<
This is the part of the style sheet that generates the error (full stylesheet as attachment):
Code:
<xsl:template name="mergeDocs">
<xsl:param name="node"/>
<xsl:for-each select="$node/*">
<xsl:element name="$node/*[1]/@name">
<xsl:copy-of select="./*"/>
</xsl:element>
</xsl:for-each>
</xsl:template>
I use this code in XMLSpy and it works well, I use the same xsl using libxslt (for use in C) and I never get this problem...
Is msxml different in any way from all the rest of the xslt libraries?
code used (
VB version):
Code:
Dim docResult As New MSXML2.DOMDocument
Set docResult = getDocAsXml2()
Dim xsltDoc As New MSXML2.FreeThreadedDOMDocument
result = xsltDoc.Load(path & "xml21.xsl")
If (Not result) Then
MsgBox "XSL file was not loaded correctly !!"
End If
Dim xslt As New MSXML2.XSLTemplate
Set xslt.stylesheet = xsltDoc ''' <-place where the error is returned
Dim proc As IXSLProcessor
proc = xslt.createProcessor
proc.input = docResult
proc.Transform
getAsXml = proc.output
Thank you for all the replies
LuÃs Pinho