
10/03/2009, 12:01
|
| | Fecha de Ingreso: marzo-2009
Mensajes: 16
Antigüedad: 16 años, 1 mes Puntos: 0 | |
Respuesta: Desarrollar Web Service _Tengo esta funcion y no se mucho de asp;
quisiera que se adaptara a que en la variable xmlfile me acepte un valor como este xmlResponseDetalle.documentElement.text, que tendría que hacer o agregar, explico la razon de esta funcion, esta recibe estos parametros de un xml, un xsl y produce la transformacion para verla en la web, pero me pasa que este dato xmlfile es una variable que recibo de un webservice y la recibo en mi script asi, si en esta función asigno directamente el nombre del archivo xml si me lo muestra, gracias a quien pueda responderme.
Function xsltransform(xmlfile,xslfile,strOptionalParam1,str OptionalParam2)
dim objXML
dim objXSL
dim templates
dim transformer
Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocumen t.3.0")
objXML.async = false
Set objXSL = Server.CreateObject("MSXML2.FreeThreadedDOMDocumen t.3.0")
objXSL.async = false
'set the parser properties
objXML.ValidateOnParse = True
objXSL.ValidateOnParse = True
'load the source XML document and check for errors
objXML.load Server.MapPath(xmlfile)
if objXML.parseError.errorCode <> 0 Then
'error found so show error message and stop
Response.End
end if
'load the XSL stylesheet and check for errors
objXSL.load Server.MapPath(xslfile)
if objXSL.parseError.errorCode <> 0 Then
'error found so show error message and stop
Response.End
end if
Set templates = Server.CreateObject("Msxml2.XSLTemplate.3.0")
templates.stylesheet = ObjXSL
Set transformer = templates.createProcessor()
if len(strOptionalparam1) then
transformer.addParameter "param1", strOptionalParam1
end if
if len(strOptionalparam2) then
transformer.addParameter "param2", strOptionalParam2
end if
transformer.input = objXML
transformer.transform()
xsltransform = transformer.output
end function |