M
M
Maxim Morozov2013-12-03 12:02:35
JavaScript
Maxim Morozov, 2013-12-03 12:02:35

How to make IE < 9 parse XML into a jquery object and work with it?

It is necessary to get a jquery object from such XML (it is slightly simplified), which is returned to me by ActiveX.

<?xml version="1.0" encoding="windows-1251"?>
<root>
  <Certificate>
    <Check>
      <CRL address="" type="LocalStore">CRL не найден в локальных хранилищах</CRL>
    </Check>
    <Version>3</Version>
   </Certificate>
</root>


Here's the code that only works in IE >= 9:
var jXML = $($.parseXML(XML));
In lower versions, the object is created, but it's read-only. You cannot edit or delete content.

I tried to cheat and push the XML content as html like this but again I ran into problems in IE < 9. Here's the call: Removes only the start tag, leaving the end tag and content in place. Tried all versions of jQuery up to 1.9 (inclusive) currently available. Everywhere is the same. After a large number of manipulations with the jQuery object, the output of the script should be a modified source XML, so I would like to work with jQuery. How to be?

var wrapper = $('<div></div>').html(XML);


wrapper.find('Check').remove();


Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artur Yenokyan, 2014-12-06
@archybaldo

https://www.dropbox.com/s/ihsj7c2jdr23mmn/xmljsonj...
//here you can do either from json xml from xml obj/xml string json
//transfer your xml to json process and distill back to xml

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question