Salve a tutti, problema forse stupido, ho il seguente file xml
codice:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:param name="lng">IT</xsl:param>
<xsl:variable name="lingua"><xsl:value-of select="$lng" /></xsl:variable>
<xsl:output method="html" />
<xsl:template name="menu" match="lang[@id=$lingua]">
<ul class="menu">
<xsl:for-each select="item">
<xsl:sort select="@idorder" data-type="number" order="ascending"/>
[*]
<a>
<xsl:attribute name="href">
<xsl:value-of select="@url" />
</xsl:attribute>
<xsl:attribute name="accesskey">
<xsl:value-of select="@accesskey" />
</xsl:attribute>
<xsl:attribute name="target">
<xsl:value-of select="@trg" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@alt" />
</xsl:attribute>
<xsl:value-of select="@name" />
</a>
</xsl:for-each>
[/list]
</xsl:template>
</xsl:stylesheet>
Se richiamo la pagina xml dal browser mi estrae correttamente i nodi e li formatta secondo il file XSL, se invece lo richiamo da asp non restituisce alcun valore:
codice:
Dim MyXML, MyXSL
Set MyXML = Server.CreateObject("Microsoft.XMLDOM")
MyXML.Async = False
MyXML.Load sourcexml
Set MyXSL = Server.CreateObject("Microsoft.XMLDOM")
MyXSL.Async = False
MyXSL.Load sourcexsl
Response.Write MyXML.transformNode(MyXSL)
Set MyXML = Nothing
Set MyXSL = Nothing
Premetto che se levo:
<xsl:template name="menu" match="lang[@id=$lingua]">
e metto:
<xsl:template name="menu" match="lang[@id='IT']">
Funziona sia da ASP che da browser....
AIUTATEMI!!!!