View XML file via XMLDOM & XSLT

Results 1 to 2 of 2

Thread: View XML file via XMLDOM & XSLT

  1. #1
    Join Date
    Dec 1969

    Default View XML file via XMLDOM & XSLT

    I have an XML file which i transform using an XSL file. In ASP i use the following code to change a couple of variables in the XML file before transforming it with the XSL file (the variables determine which parts of the xml are displayed); <BR><BR>" <BR>&#039;--Select Parameters element and amend according to querystring info <BR>set objNode = objXML.getElementsByTagName("parameters") <BR>call objNode.item(0).setAttribute("id_view",intIDView) <BR>call objNode.item(0).setAttribute("columns",intColumns) <BR><BR>&#039;--Load XSL <BR>set objXSL = Server.CreateObject("Microsoft.XMLDOM") <BR>objXSL.async = false <BR>objXSL.load(Server.MapPath(strXSLFile)) <BR><BR>&#039;--Transform file <BR>Response.Write(objXML.transformNode(objXSL)) <BR><BR>Set objXML = nothing <BR>Set objXSL = nothing <BR>Set objNode = nothing <BR>" <BR><BR>The xml file looks like this; <BR><BR>" <BR>&#060;?xml version=&#039;1.0&#039;?&#062; <BR><BR>&#060;gallery&#062; <BR><BR> &#060;!--Updated from view.asp page--&#062; <BR> &#060;parameters id_view="10" columns="1" id_image="dr0001"/&#062; <BR><BR>......all the other elements <BR>&#060;/gallery&#062; <BR>" <BR><BR>It works fine but I am not sure this is the best way to achieve my aim (which is to have an xml file which has the content details formatted by the XSL based on variables set on obtained from an .asp page). <BR><BR>Any advise would be gratefully accepted. <BR><BR>Yours <BR><BR>Wastlinger

  2. #2
    Join Date
    Dec 1969

    Default See if this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts