Answer the question
In order to leave comments, you need to log in
What is the most convenient way in your opinion to work with XML to JavaScript in AJAX applications?
Please tell me the most convenient way in your opinion to work with XML in JavaScript in AJAX applications. Basically it is required to read XML by going around its branches with a high degree of nesting. Less often it is necessary to form response XMLs.
I tried to use the bare DOM, but it turns out quite cumbersome code.
I also tried to use bare jQuery, it turns out to be more compact, but it still feels like jQuery is intended for other tasks.
Usually I use JSON to exchange with the server, and the code is much more concise than with XML, there is no nasty feeling of constant conversions and crutches. But now I need XML.
Answer the question
In order to leave comments, you need to log in
There are a lot of libraries written for JavaScript. The choice depends on the task.
If you need to run through XML - that is, SAX parsers. Although I doubt that this is what you need. Here it is time to think about using XSLT transformations.
Can be converted to JSON .
You can use XPath expressions. They are implemented in jQuery for example, but uses querySelector() internally .
This tool ( Xml Viewer - Editor ) will help you to understand your xml and help to convert to other data format like json , csv
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question