Using Javascript to call many xml files into xsl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nocturnal428
    New Member
    • Feb 2008
    • 6

    Using Javascript to call many xml files into xsl

    I am creating many xml files. I want each one to be shown in an xsl type sheet but my problem is that I would like to have a next button so that I can look at the next xml sheet. I have seen a few things that have said you can do this with javascript but I am unsure. The example would be these xml files in a folder
    xml_file001
    xml_file002
    xml_file003
    xml_file004
    and the xsl file would read the information on a single page, then click a link to go to the next page to read the next xml file. Any help with this would be greatly appreciated.

    Thanks.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    I don't know how you add JavaScript to xsl, but you can use JavaScript to load an XML file. Can you show some code, so we have a better idea of the setup.

    Comment

    • nocturnal428
      New Member
      • Feb 2008
      • 6

      #3
      Sorry, for the data I'm applying this to I really can't. I will go in more detail for you though.
      Lets say I have three xml files that all look like this

      <Information>
      <System>abc</System>
      <Model>xyz</Model>
      <Uptime>123</Uptime>
      <Information>

      I want to load a xsl type of file to show a web page with this information in a table from one xml file. I then would have a next link, or next button to click to reload the same information but with the next xml file in a folder. The only other way I have heard of doing something like this without Javascript is by merging all the xml files together and passing a position parameter in xsl but I am unsure if that would work. I would need the user of the script to be able to click a link to move on to the next xml file.

      Comment

      • nocturnal428
        New Member
        • Feb 2008
        • 6

        #4
        Thinking about it now would it be possible with javascript (I dont think you can use just html) to create a webpage with links to the xml files that I can just click on and open. They would all be linked back to one xsl file to open because they are all of the exact same format. So it would look something like

        xml_link1 (click on any of the three links to open up the xml file based on the xsl)

        xml_link2

        xml_link3

        Comment

        • nocturnal428
          New Member
          • Feb 2008
          • 6

          #5
          Sorry I guess it was as simple as using html to do what I wanted to do. I think that if I actually had the something like a next or prev link I would of had to embed the xml in html anyways. Thanks.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Well, that was simple. Glad to hear that you got it working and thanks for posting back to let us know.

            Comment

            Working...