xml source

  • I have a system that serves xml content and use it on a regular basis to extract certain data from it. When I use Opera 12 and select "source", I get this: "<?xml version="1.0" encoding="utf-8"?>
    <d2p1:Items ...", but when I use Vivaldi and select "view page source", I get this: "{"Items":[],"AppliedFilter":{"TopN":null,"All":false,"AmountMin"...", which does not contain any of the real data and is totally unusable. I can get the real source by selecting "inspect" from the context menu and then "sources", but this is too complicated to do often.
    Is there a better way to get the pure xml served and not this json interpretation.
    Thank you in advance for any hints!

  • Moderator

    @ditomov Do you happen to have a publicly available example showing this issue?

  • @lonm No, i don't and I don't know how to reproduce it. The page is served by an .aspx.
    When I open the link with Opera, Vivaldi or Edge, they show just a long string, created from the text enclosed in xml tags (without the tags themselves), space separated. Internet explorer shows almost exactly the xml content. But all, except Vivaldi give me the correct xml document as source of the page.

  • Moderator

    @ditomov Try using this extension: https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg (User Agent Switcher) and setting it to a different browser, to see if that clears up the issue.

  • @lonm Thanks! I tried, but it makes no difference. I believe the contents is served the same, regardless of the user agent (as I said, I can get the pure source with vivaldi, just not using the simpler "view page source", but the developer console's "sources"). Why would vivaldi prefer to transform the source, is beyond me.

  • Moderator

    @ditomov Thats all very odd. Internally, vivaldi is the same as chrome. Would you be able to take some screenshots showing the steps vivaldi is doing wrong?

  • Moderator

    @ditomov Which mimetype is used in HTTP header sent back from server?
    Do you have a test URL?
    Or source code sent by the server?

  • @gwen-dragon No, I cannot provide url. Is this of any help?0_1510864482723_v_h.jpg

  • Moderator

    @ditomov As i see your visited webserver does not send the correct mimetype for XML it sends the wrong for HTML.
    I guess thats why you get wrong display of source.

  • @gwen-dragon Yes, obviously and that explains why browsers (including vivaldi) show the page as one line of text. But still, the source of the page should not be transformed into something completely different (I include a screenshot). Shouldn't the page source and the devtools' source be the same, anyway?
    I do not use any extensions. I thought maybe there is a hidden setting that will allow me to disable this transformation, or maybe a way to save the original page source.


  • Moderator

    @ditomov said in xml source:

    Shouldn't the page source and the devtools' source be the same, anyway?

    If XSLT is used with XML the browser ouput of XML may be formatted specially.
    I do not know really what your server does.

    And there is a bug in Vivaldi view-source which reloads to a new request.
    That new reuqest may change the displayed content.

    My daily work as a programmer and webdev shows me: correct way for webdevelopment is to inspect the source in developer tools.
    And the HTML and XML source in Devtools Sources does not always reflect what is rendered in browser display.

    Perhaps Vivaldi is misdetected and gets JSON; server only send Opera 12 the XML code.
    And the response may contain JS which changes content.

    It is not easy to check it, looking at screenhsots is exhausting for me. 👓 👵

  • @gwen-dragon I believe the problem is the bug with "view-source which reloads to a new request". I discovered that the link only "works" once - on second load it returns the json output that I receive via "view source". Is this double loading planned to be corrected?

  • Moderator

    @ditomov said in xml source:

    Is this double loading planned to be corrected?

    I asked for a fix.
    The related bug is VB-32735 "'View Source' refetches the source which can be reliant on post data"

Log in to reply

Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.