Closed Bug 813441 Opened 12 years ago Closed 12 years ago

xml parser issue

Categories

(Core :: DOM: Serializers, defect, P5)

15 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 788444

People

(Reporter: srvskprakash, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1
Build ID: 20120713134347

Steps to reproduce:

when trying to parse xml data content using innerHTML, I am getting a parse error.
I am using DomParser and parseFromString to do it.
I am having the following content in my XML
<test><val attr="<popo>" /></test>


Actual results:

in firefox 15 innerHTML is generated as
<test><val attr="<popo>" /></test>
But in the older versions it is
<test><val attr="&lt;popo&lt;" /></test>

hence getting the parse error.


Expected results:

it should be same as the older version.

Any solution for this is greatly appreciated. Application is in production now and many customers are being affected. Need to provide a quicker solution. Is there anything that can be done in FF ?
Severity: normal → critical
Component: Untriaged → Webapp Runtime
OS: Windows 7 → Linux
Priority: -- → P5
Version: 14 Branch → 15 Branch
Blocks: 744830
maybe dup Bug 788444
can i know the difference of implementation of innerHTML in previous versions of firefox and firefox 15, and how can that be handled.
(In reply to Alice0775 White from comment #1)
> maybe dup Bug 788444

Even I am facing the same issue...
I have a page in my application that is loaded with XML data. I am also using innerHTML and parsing it using DomParser.
I have a part of content where i am loading different operators < > = etc. my content will be like <operator value="<" name="LESS THAN" >, I am getting a parse error "not well-formed" in this line.
I dint face the issue in previous versions,why am i facing this in FF15? as mentioned in the description in older versions it is generating as <operator value="&lt;" name="LESS THAN" >

I would like to know whether there is any change change in innerHTML implementation in FF15? if so what is it? Will that be fixed? Is it a bug with FF or it should be handled in the application? If we have to fix in application level we need to provide the reason as to why innerHTML is behaving differently. 

I dont find any answers for my questions in the duplicated bug?Can any1 answer my question?
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Component: Webapp Runtime → Serializers
OS: Linux → All
Product: Firefox → Core
Hardware: x86 → All
Resolution: --- → DUPLICATE
The answers to the questions from comment 3 are in fact in the duplicated bug.  The new behavior is what the spec calls for, and other browsers already have it.  So any application that doesn't handle it is already broken in other browsers.

That bug report also discusses why the behavior changed and so forth.
Can you please relate the answers here, because I am really confused with the long discussion that went on in the other bug.]?

(In reply to Boris Zbarsky (:bz) from comment #5)
> The answers to the questions from comment 3 are in fact in the duplicated
> bug.  The new behavior is what the spec calls for, and other browsers
> already have it.  So any application that doesn't handle it is already
> broken in other browsers.
> 
> That bug report also discusses why the behavior changed and so forth.
> why am i facing this in FF15?

Because the behavior changed.

> whether there is any change change in innerHTML implementation in FF15?

Yes.

> if so what is it?

We now implement the algorithm at http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#html-fragment-serialization-algorithm for innerHTML, as required by http://domparsing.spec.whatwg.org/#innerhtml

> Is it a bug with FF or it should be handled in the application?

It needs to be fixed in the application.  Getting .innerHTML on an HTML element in a non-XML document does not produce well-formed XML.  It never has, actually; it only worked in a very narrow set of cases.

If you want to produce well-formed XML, use XMLSerializer.
Thanks a lot Boris, this helped me...


(In reply to Boris Zbarsky (:bz) from comment #7)
> > why am i facing this in FF15?
> 
> Because the behavior changed.
> 
> > whether there is any change change in innerHTML implementation in FF15?
> 
> Yes.
> 
> > if so what is it?
> 
> We now implement the algorithm at
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.
> html#html-fragment-serialization-algorithm for innerHTML, as required by
> http://domparsing.spec.whatwg.org/#innerhtml
> 
> > Is it a bug with FF or it should be handled in the application?
> 
> It needs to be fixed in the application.  Getting .innerHTML on an HTML
> element in a non-XML document does not produce well-formed XML.  It never
> has, actually; it only worked in a very narrow set of cases.
> 
> If you want to produce well-formed XML, use XMLSerializer.
You need to log in before you can comment on or make changes to this bug.