László Monda
László Monda

Reputation: 1753

How can I make Chrome and Firefox show badly formed XML fully?

I want Chrome and Firefox to show badly formed XML in full plaintext format instead of telling me that it's badly formed and showing the first few characters of the offending plaintext.

This could potentially be useful for any web developer when dumping variables and such.

Upvotes: 1

Views: 439

Answers (2)

Paul Sweatte
Paul Sweatte

Reputation: 24617

Use a processing instruction to wrap the malformed XML:

<?xml version="1.0" encoding="utf-8"?>
  <test>
    <good>Me &amp; my dad</good>
      <?_borderline 

      <bad>Me & my matches</bad>

      ?>
  </test>

Upvotes: 0

Mike West
Mike West

Reputation: 5143

I can't speak for Firefox, but this is simply the way that XML is handled in Chrome; the parser is draconian, and error messages in parsing are raised to the user via the UI that you're unhappy with. :)

A quick search of the bug database doesn't show any similar requests to point you to, so I'd suggest filing a bug with your feature suggestion via http://new.crbug.com/ I can't promise that anyone will implement it quickly (especially given view-source as a viable workaround), but at least the suggestion will be tracked in the system for others to find and vote for via stars.

Upvotes: 1

Related Questions