Grazie mille per la risposta,
ora il mio codice si è trasformato così, ma continua a non funzionare: sembra che il parametro non arrivi al foglio XSL, di fatti la pagia visualizzata è vuota.
codice:
<%
Dim xmldoc
Dim xsldoc
Dim xslTemplate
Dim xslProcessor
'Use the MSXML 4.0 Version dependent PROGID
'MSXML2.DOMDocument.4.0 if you wish to create
'an instance of the MSXML 4.0 DOMDocument object
Set xmldoc = Server.CreateObject("MSXML2.DOMDocument.4.0")
xmldoc.Load Server.MapPath(Request.QueryString("xml"))
'Check for a successful load of the XML Document.
if xmldoc.parseerror.errorcode <> 0 then
Response.Write "Error loading XML Document :" & "
"
Response.Write "----------------------------" & "
"
Response.Write "Error Code : " & xmldoc.parseerror.errorcode & "
"
Response.Write "Reason : " & xmldoc.parseerror.reason & "
"
Response.End
End If
Set xsldoc = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")
xsldoc.async = False
xsldoc.resolveExternals = true
xsldoc.Load Server.MapPath(Request.QueryString("xsl"))
'Check for a successful load of the XSL Document.
if xsldoc.parseerror.errorcode <> 0 then
Response.Write "Error loading XSL Document :" & "
"
Response.Write "----------------------------" & "
"
Response.Write "Error Code : " & xsldoc.parseerror.errorcode & "
"
Response.Write "Reason : " & xsldoc.parseerror.reason & "
"
Response.End
End If
'-----------
'Passo il parametro
set xslTemplate = Server.CreateObject("MSXML2.XSLTemplate.4.0")
xslTemplate.stylesheet = xsldoc
set xslProcessor = xslTemplate.createProcessor()
par1 = Request.QueryString("show_gallery")
xslProcessor.addParameter "show_gallery", ""&par1&""
'Eseguo la trasformazione
xslProcessor.input = xmldoc
xslProcessor.transform()
Response.Write(xslProcessor.output)
'------------
'Response.Write xmldoc.TransformNode(xsldoc)
%>
Dove sbaglio? Qi ti metto anche il codice XSL
codice:
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="html"
indent="yes"
encoding="iso-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<xsl:template match="/">
<xsl:param name="show_gallery"/>
<xsl:variable name="path_img_small">opere/preview/</xsl:variable>
<xsl:variable name="path_img_large">opere/</xsl:variable>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="style/standard.css" />
<style type="text/css">
@import url(style/gallery2.css);
</style>
<title>Daniele Sangermani - Galleria: <xsl:value-of select="$show_gallery"/></title>
</head>
<body>
<div id="main_section">
<div class="gallery_title"><h1><xsl:value-of select="$show_gallery" /></h1></div>
<div class="navbar">
<div class="navbar_left">Vai alla Galleria</div>
<div class="navbar_right" >Vai alla Presentazione</div>
</div>
<div id="preview_container" >
<ul id="gallery">
<xsl:for-each select="paints/paint">
<xsl:if test=" gallery=$show_gallery ">
<xsl:if test=" hide='NO' ">
[*]
<div class="thumb">
<a href="{$path_img_large}{large_pic}" target="_new">
[img]{$path_img_small}{small_pic}[/img]</a>
</div>
<div class="title"><xsl:value-of select="title" /></div>
<div class="description"><xsl:value-of select="info" /> - <xsl:value-of select="size" /> </div>
<div class="year"><xsl:value-of select="year" /></div>
</xsl:if>
</xsl:if>
</xsl:for-each>
[/list]
</div>
<div class="navbar">
<div class="navbar_left">Vai alla Galleria</div>
<div class="navbar_right" >Vai alla Presentazione</div>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I parametri li passo con questo link nella pagina chiamante
codice:
href="TransformXml.asp?xml=gallery.xml&xsl=gallery.xsl&show_gallery=A"
Grazie