Comments (12)
[deleted comment]
from x2js.
[deleted comment]
from x2js.
This is an issue for data including &
Original comment by [email protected]
on 16 Oct 2013 at 11:16
from x2js.
Investigating
Original comment by [email protected]
on 16 Oct 2013 at 12:28
- Changed state: Accepted
from x2js.
Thanks - here's a sample feed to trial ...
http://corcoransunshine.com/newdevxml/447NewDevs.xml
Original comment by [email protected]
on 16 Oct 2013 at 12:33
from x2js.
I've checked it with v1.1.3
(https://code.google.com/p/x2js/source/browse/xml2json.js) and it looks like
working for me.
Example with your feed:
function loadXMLDoc(dname) {
if (window.XMLHttpRequest) {
xhttp=new XMLHttpRequest();
}
else {
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send();
return xhttp.responseXML;
}
var xmlDoc = loadXMLDoc("447NewDevs.xml");
var x2js = new X2JS();
var jsonObj = x2js.xml2json(xmlDoc);
Could you please provide your sample / code where is a problem?
Original comment by [email protected]
on 16 Oct 2013 at 12:55
from x2js.
Was testing via the JS Fiddle you built - inputting the XML from in textarea
for XML field (together with & data)...
Original comment by [email protected]
on 16 Oct 2013 at 1:03
from x2js.
Ouch. Now I understand what you mean. You can't enter '&' to that demo, because
it is not suitable demo for XML escaping.
You should have valid well formatted XML string or DOM object for input.
For example, this is not valid XML in string form:
"<textNode>First & Child</textNode>".
Valid and well-formed XML string form is "<textNode>First & Child</textNode>"
If you have manually enterered XML in string form, you should escape it value
(because it is required by XML standard).
You should escape only XML node value, not full XML document (in a string
form).
For example:
"<textNode>First <> Child</textNode>" should be
"<textNode>First <> Child</textNode>"
Well, this is a not x2js issue. It is just about valid XML string formatting :)
Let me know if you had any other questions.
Original comment by [email protected]
on 16 Oct 2013 at 1:28
- Changed state: WontFix
from x2js.
right - I was using & (not just & as it isn't valid XML) ... the fiddle
doesn't work with & values.
Original comment by [email protected]
on 16 Oct 2013 at 1:37
from x2js.
Ok, you entered you test data with & in the input or in the HTML window code
frame (at fiddle)?
You can't do it with HTML window code. Actually I'm just lazy and shouldn't
have fill textarea in that style (because it's not valid HTML).
If you enter test data with & in the textarea (bottom-right frame at fiddle)
you will see it's working :)
Original comment by [email protected]
on 16 Oct 2013 at 1:47
from x2js.
right - thanks!
Original comment by [email protected]
on 16 Oct 2013 at 1:51
from x2js.
NP. I'll think about update demo to avoid misunderstandings.
Original comment by [email protected]
on 16 Oct 2013 at 2:09
from x2js.
Related Issues (20)
- trim() in IE8 HOT 2
- IE9 DOM Exception HOT 6
- namespace url does not properly convert from json to xml HOT 3
- Decode problem in Firefox v30 and IE10 HOT 8
- asArray(undefined) == [undefined] HOT 4
- ReferenceError: "ActiveXObject" is not defined error thrown HOT 6
- Option to use double quotations for XML attribute values HOT 2
- can't use escaped characters HOT 2
- namespaces not working in chrome HOT 2
- 'Not enough storage is available to complete this operation' occurs in IE when parsing long XML string
- Set a null prefix HOT 3
- Problems when having ':' in XML attribute names HOT 5
- Javascript syntax error Firefox - demo.html HOT 3
- ape HOT 1
- Namespaces stripped from elements but not attributes HOT 1
- Request: Ignoring invalid XML element names from object properties HOT 3
- / is escaped but should NOT be escaped HOT 2
- escape "&" caractere HOT 1
- official github repo HOT 1
- unable to run published demo HOT 3
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 x2js.