Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Loading XSL Templates

Loading XSL Templates

Scheduled Pinned Locked Moved XML / XSL
xmlwpfsysadminbusinesstools
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thekcins
    wrote on last edited by
    #1

    I'm using an XML file to hold a bunch of links, each of these links also have a category assigned to them. Here is an example: - 57 Business Links Clark County Services http://www.co.clark.nv.us I use this .asp script that loads an XML file with an XSL file. The beauty of this ASP file was that you could pass the name of the XSL file, and it would load it. Now what I would like to do, is just have 1 xsl file, and use the .asp file to transform only a certain template in the .xsl file. (There would be several different teplates in there...) Is this possible? Below is the .asp file I'm using... sub dispXML(toCall) '------ Find out which XSL file needs to be called ------------ styleFile = Server.MapPath(toCall) '------ DISPLAY THE XML DATA ------------ ' Linking XML and XSL together sourceFile = Server.MapPath("linkList.xml") set source = Server.CreateObject("Microsoft.XMLDOM") source.async = false source.load(sourceFile) set style = Server.CreateObject("Microsoft.XMLDOM") style.async = false style.load(styleFile) Response.Write source.transformNode(style) end sub Any help would be great. Thanks.

    P 1 Reply Last reply
    0
    • T thekcins

      I'm using an XML file to hold a bunch of links, each of these links also have a category assigned to them. Here is an example: - 57 Business Links Clark County Services http://www.co.clark.nv.us I use this .asp script that loads an XML file with an XSL file. The beauty of this ASP file was that you could pass the name of the XSL file, and it would load it. Now what I would like to do, is just have 1 xsl file, and use the .asp file to transform only a certain template in the .xsl file. (There would be several different teplates in there...) Is this possible? Below is the .asp file I'm using... sub dispXML(toCall) '------ Find out which XSL file needs to be called ------------ styleFile = Server.MapPath(toCall) '------ DISPLAY THE XML DATA ------------ ' Linking XML and XSL together sourceFile = Server.MapPath("linkList.xml") set source = Server.CreateObject("Microsoft.XMLDOM") source.async = false source.load(sourceFile) set style = Server.CreateObject("Microsoft.XMLDOM") style.async = false style.load(styleFile) Response.Write source.transformNode(style) end sub Any help would be great. Thanks.

      P Offline
      P Offline
      Philip Fitzsimons
      wrote on last edited by
      #2

      yes use xsl:param


      "When the only tool you have is a hammer, a sore thumb you will have."

      T 1 Reply Last reply
      0
      • P Philip Fitzsimons

        yes use xsl:param


        "When the only tool you have is a hammer, a sore thumb you will have."

        T Offline
        T Offline
        thekcins
        wrote on last edited by
        #3

        ah - yes. My only problem has been passing something TO an XSL file? Any ideas? Ideally, I'd call it from a .asp file... :confused:

        B 1 Reply Last reply
        0
        • T thekcins

          ah - yes. My only problem has been passing something TO an XSL file? Any ideas? Ideally, I'd call it from a .asp file... :confused:

          B Offline
          B Offline
          Brandon Haase
          wrote on last edited by
          #4

          I have seen this done using xsl:param directly under the xsl:stylesheet declaration to pass in parameters, but I have only seen this work with command-line processors like Saxon, Xalan. Unfortunately, MSXML does not support top-level parameters. The workaround would be to append the data you want to pass through a parameter in the XML to be transformed and read it into a top-level variable.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups