Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2017
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Applying XSLT to XML in the browser with developer tools or other means

    We have a vendor who provides a report in XML. We click the link and get a screenful of XML with no styling - so you can imagine - it is pretty much useless.

    I'm no web developer but I can put together an XSLT file to make the XML useful to me. The task that I am trying to achieve is not very difficult.

    However, the only way I know to do this is to save the XML file to my local computer, add the reference to the XSLT file in a text editor and then, open the XML again in a browser.

    Unfortunately, this process is too much for my co-workers.

    When we are at the screenful of XML data on our vendor's website, can anyone suggest a way to apply the styling that is a simple enough process for a "normal" person?

    The vendor will do NOTHING to assist.

    Let me know if my question isn't clear.
    Thanks for any suggestions.

  2. #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,495
    Thanks
    1
    Thanked 24 Times in 22 Posts
    How about a little Python or PHP to fetch the XML and insert the processing instruction you need?
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, ES7-Membrane project (Github Pages site)
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  3. #3
    Master Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    5,509
    Thanks
    22
    Thanked 567 Times in 560 Posts
    Quote Originally Posted by take_the_train View Post
    When we are at the screenful of XML data on our vendor's website, can anyone suggest a way to apply the styling that is a simple enough process for a "normal" person?
    The only ways I can think of is either a user script or a browser extension. they're not easy to create, but easy to use.

    A way around that is to use a proxy, where you do not access the files directly, but have a server side programming language to format the XML.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  4. Users who have thanked Dormilich for this post:

    take_the_train (10-31-2017)

  5. #4
    New to the CF scene
    Join Date
    Oct 2017
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I read about user scripts and it sounds like that may be a possibility. If I can figure out how to use a bookmark to apply a stylesheet to the page currently in the browser, that would be a fantastic solution.

    Thanks


 

Tags for this Thread

Posting Permissions

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