Comments (8)
I don't have a copy of IE8 lying around, so I can't test this behavior. It looks as though the xmlns option is being set differently. Can you verify that in each case, the xmlToJson configuration options are the same?
from xmltojson.
I've tested with the default values, so without any custom settings.
from xmltojson.
Try setting the xmlns option to false. This should force consistent behavior between the two browsers. It looks as though IE 8 doesn't properly support the namespaceURI attribute. If so, it's forcing the evaluation to false. Let me know.
from xmltojson.
After setting xmlns = fase
the difference between Firebox and IE will be:
Firefox:
"_attr": {
"xmlns:xsi": {"_value": "http://www.w3.org/2001/XMLSchema-instance"},
"noNamespaceSchemaLocation": {"_value": "../xsd/HTMLVideoMapper.xsd"}
},
IE8:
"_attr": {
"xmlns:xsi": {"_value": "http://www.w3.org/2001/XMLSchema-instance"},
"noNamespaceSchemaLocation": {
"_value": "../xsd/HTMLVideoMapper.xsd",
"_ns": "http://www.w3.org/2001/XMLSchema-instance"
}
},
So in fact setting the xmlns
will not affect changes between those browsers
from xmltojson.
It looks as though the output is consistent. IE added the _ns value, but the object naming and values are otherwise identical which should give consistent and predictable behavior between browsers. I will update the documentation to indicate that the library is intended for IE9+ and close this issue.
from xmltojson.
Well, that's open source and you have the right to change requirements. But for me, that means a huge problem since I already started to implement your plugin today. Each XML2JSON-converter plugin will use different ways to handle attributes, texts, values and namespaces. So I will need to complete develop the enhancement again.
My target browser is IE 8 since it is a customer requirement. So for me that would mean, you are switching from IE7+ to IE9+ and killing the work of today.
For my understanding: What is the problem why there are such differences betwen IE8 and Firefox? Also, are there more things/features than namespaces that can be different in each browser?
from xmltojson.
The difficulty lies in Microsoft’s support for DOM standards in IE8. The situation greatly improved with IE9. IE10+ are significantly better. Chrome, Firefox, and Safari implemented the DOM methods for XML much more rapidly and so support appears in earlier versions.
I updated the documentation to reflect that the library will work as expected for IE9+ . I also stated in the docs that the library can be reasonably and predictably used with IE 7 and 8 if you set the xmlns option to false.
I hope this helps, and I apologize if it does not. If you would like to submit a patch, I’d be happy to consider it. For now though, I have no intent of supporting outdated and non-standard browsers.
Best luck with your endeavors.
On Jan 28, 2015, at 12:47 PM, Julian [email protected] wrote:
Well, that's open source and you have the right to change requirements. But for me, that means a huge problem since I already started to implement your plugin today. Each XML2JSON-converter plugin will use different ways to handle attributes, texts, values and namespaces. My target browser is IE since it is a customer requirement. So for me that would mean, you are switching from IE7+ to IE9+ and killing the work.
For my understanding: What is the problem why there are such differences betwen IE8 and Firefox? Also, are there more things/features than namespaces that can be different in each browser?
—
Reply to this email directly or view it on GitHub #6 (comment).
from xmltojson.
The only thing left I don't understand is why setting xmlns to false will fix the differences from IE8 to Firefox. For me setting the value to false means that there should not appear any namespace attributes. But in IE8 those still exist (see my last example).
What am I missing? Why is settin xmlns to false a solution in this situation?
from xmltojson.
Related Issues (20)
- Add license in bower.json and .min.js HOT 1
- Update module on npm HOT 7
- Cannot iterate children at proper order HOT 7
- When attribute name of an element have ":" character, does not parse HOT 1
- oXMLParent.hasChildNodes is not a function HOT 1
- Add the proper require() statement to your Readme.md file HOT 1
- Internal state (options) can be modified asynchronously HOT 2
- Cannot get it working with latest angular-cli with webpack HOT 4
- Doesn't work in NodeJS HOT 5
- syntax error display on console when call xml_str2json() on firefox HOT 2
- How to convert XML to JSON in an external reference HOT 3
- How to force to dispaly 0 after decimal? HOT 1
- Implement promises for asynchronous parsing of XML
- Improve examples in README
- Improve test coverage
- Migrate to latest Jasmine (2.8.x)
- Add support for processing instructions and comments HOT 2
- Migrate to DOM4
- Cannot parse Android Manifest XML HOT 4
- Support node v20.13.1 or latest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmltojson.