Questions tagged [domparser]

A DOMParser can parse XML or HTML source stored in a string into a DOM Document.

The DOMParser is specifically used in Javascript to parse XML and HTML sources, however other languages may provide DOMParsers as well. In Javascript the DOMParser is specified in DOM Parsing and Serialization.

543 questions
3
votes
2 answers

Is parsing HTML with DOMParser safe from XSS?

I am using the DOMParser in my code as such: html`${this.domParser.parseFromString(this.richText, 'text/html').body.children}` After reading the documentation i became a bit worried that Cross site Scripting attacks were still possible because as…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
3
votes
1 answer

Is it possible to change domparser element to string?

I have some HTML string. Use domparser to update some values, now i need back to HTML string format with updated values... Bcoz document.write accept only string. Checkout the Sample patch, const domName = 'MOBILE_NO'; // Below dom was getting from…
R.G.Krish
  • 487
  • 5
  • 22
3
votes
0 answers

XML tag replace

I need to replace with <sec-title> in the below XML code. but the result removed <named-content> tag from <title>. var parser, xmlDoc; var text = "<bookstore><book>" + "<title>Teting<named-content…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/dom" class="post-tag grid--cell" title="show questions tagged 'dom'" rel="tag">dom</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> <a href="../../questions/tagged/xmlelement" class="post-tag grid--cell" title="show questions tagged 'xmlelement'" rel="tag">xmlelement</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Nov 10 '19 at 07:20">asked Nov 10 '19 at 07:20</time> <a href="../../users/10727661/anoop-sankar" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/10727661.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Anoop Sankar" /> </a> <div class="s-user-card--info"> <a href="../../users/10727661/anoop-sankar" class="s-user-card--link">Anoop Sankar</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">619</li> <li class="s-award-bling s-award-bling__silver" title="5 silver badges">5</li> <li class="s-award-bling s-award-bling__bronze" title="16 bronze badges">16</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-56451731"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>3</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/56451731/dom-parser-chrome-extension-memory-leak" class="question-hyperlink">DOM Parser Chrome extension memory leak</a></h3> <div class="excerpt">The problem I have developed an extension that intercepts web requests, gets the HTML the web request originated from and processes it. I have used the DOMParser to parse the HTML and I have realised that the DOMParser is causing massive memory leak…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/browser" class="post-tag grid--cell" title="show questions tagged 'browser'" rel="tag">browser</a> <a href="../../questions/tagged/google-chrome-extension" class="post-tag grid--cell" title="show questions tagged 'google-chrome-extension'" rel="tag">google-chrome-extension</a> <a href="../../questions/tagged/memory-leaks" class="post-tag grid--cell" title="show questions tagged 'memory-leaks'" rel="tag">memory-leaks</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 04 '19 at 21:43">asked Jun 04 '19 at 21:43</time> <a href="../../users/10548884/coder-guy" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/10548884.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Coder Guy" /> </a> <div class="s-user-card--info"> <a href="../../users/10548884/coder-guy" class="s-user-card--link">Coder Guy</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">185</li> <li class="s-award-bling s-award-bling__silver" title="5 silver badges">5</li> <li class="s-award-bling s-award-bling__bronze" title="12 bronze badges">12</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-52720259"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/52720259/test-domparser-using-jest" class="question-hyperlink">Test DOMParser using Jest</a></h3> <div class="excerpt">I have a method which uses DOMParser to parse a XML, like this: this.parseXmlString = function(xmlDocStr) { var xmlDoc; var parser= new window.DOMParser(); xmlDoc = parser.parseFromString( xmlDocStr, "text/xml" ); // here I do some…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/unit-testing" class="post-tag grid--cell" title="show questions tagged 'unit-testing'" rel="tag">unit-testing</a> <a href="../../questions/tagged/jestjs" class="post-tag grid--cell" title="show questions tagged 'jestjs'" rel="tag">jestjs</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Oct 09 '18 at 11:43">asked Oct 09 '18 at 11:43</time> <a href="../../users/1932353/daniel-marin" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1932353.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Daniel Marín" /> </a> <div class="s-user-card--info"> <a href="../../users/1932353/daniel-marin" class="s-user-card--link">Daniel Marín</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,369</li> <li class="s-award-bling s-award-bling__silver" title="14 silver badges">14</li> <li class="s-award-bling s-award-bling__bronze" title="36 bronze badges">36</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-4288232"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/4288232/javascript-xml-parser-how-to-get-nodes-that-have-in-the-name" class="question-hyperlink">Javascript xml parser: how to get nodes that have ":" in the name</a></h3> <div class="excerpt">I have the following code where i'm trying to get the c:CreationDate nodes: value = '<?xml version="1.0" encoding="UTF-8"?><content><c:CreationDate>2010-09-04T05:04:53Z</c:CreationDate></content>'; xml = (new DOMParser()).parseFromString(value,…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Nov 26 '10 at 20:01">asked Nov 26 '10 at 20:01</time> <a href="../../users/447458/fernando" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/447458.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Fernando" /> </a> <div class="s-user-card--info"> <a href="../../users/447458/fernando" class="s-user-card--link">Fernando</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">4,459</li> <li class="s-award-bling s-award-bling__gold" title="4 gold badges">4</li> <li class="s-award-bling s-award-bling__silver" title="26 silver badges">26</li> <li class="s-award-bling s-award-bling__bronze" title="39 bronze badges">39</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-38637493"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>5</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/38637493/parsing-xml-into-java-object" class="question-hyperlink">Parsing XML into Java object</a></h3> <div class="excerpt">I am trying to determine the best way to parse the XML response I get from a webservice call into a Java object. Using JAXB seems to be the easiest way but every example I get for this requires that you have a template Java class which will be the…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/java" class="post-tag grid--cell" title="show questions tagged 'java'" rel="tag">java</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/xml-parsing" class="post-tag grid--cell" title="show questions tagged 'xml-parsing'" rel="tag">xml-parsing</a> <a href="../../questions/tagged/jaxb" class="post-tag grid--cell" title="show questions tagged 'jaxb'" rel="tag">jaxb</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jul 28 '16 at 13:14">asked Jul 28 '16 at 13:14</time> <a href="../../users/965895/mayoman" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/965895.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="MayoMan" /> </a> <div class="s-user-card--info"> <a href="../../users/965895/mayoman" class="s-user-card--link">MayoMan</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">4,757</li> <li class="s-award-bling s-award-bling__gold" title="10 gold badges">10</li> <li class="s-award-bling s-award-bling__silver" title="53 silver badges">53</li> <li class="s-award-bling s-award-bling__bronze" title="85 bronze badges">85</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-36877459"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/36877459/getting-xerces-for-android-to-work-with-documentbuilderfactoryimpl-and-transfo" class="question-hyperlink">Getting Xerces-for-Android to work with DocumentBuilderFactoryImpl and TransformerFactoryImpl</a></h3> <div class="excerpt">I need to parse an XML file to DOM. I also want to validate this against an XSD schema, and be able to use a transformer to convert this with an XSL style sheet. While this worked fine as a plain Java application, I have had serious problems trying…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/android" class="post-tag grid--cell" title="show questions tagged 'android'" rel="tag">android</a> <a href="../../questions/tagged/xslt" class="post-tag grid--cell" title="show questions tagged 'xslt'" rel="tag">xslt</a> <a href="../../questions/tagged/xml-parsing" class="post-tag grid--cell" title="show questions tagged 'xml-parsing'" rel="tag">xml-parsing</a> <a href="../../questions/tagged/xsd-validation" class="post-tag grid--cell" title="show questions tagged 'xsd-validation'" rel="tag">xsd-validation</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 26 '16 at 23:15">asked Apr 26 '16 at 23:15</time> <a href="../../users/3795045/urps" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/3795045.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="urps" /> </a> <div class="s-user-card--info"> <a href="../../users/3795045/urps" class="s-user-card--link">urps</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">366</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="4 silver badge">4</li> <li class="s-award-bling s-award-bling__bronze" title="13 bronze badge">13</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-36734137"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/36734137/xml-parser-unexpected-token-error-position-text-1-2-in-java-io-stringreader" class="question-hyperlink">Xml Parser unexpected token error position:TEXT @1:2 in java.io.StringReader</a></h3> <div class="excerpt">The problem is when I parse the XML from the original link for example (I am not posting the original link due to security purpose) http://example.com/ss.svc/APIabc?A=10&Key=XXXXX&From=19&To=221&Date=19-Apr-2016 then listview is not populated and…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/java" class="post-tag grid--cell" title="show questions tagged 'java'" rel="tag">java</a> <a href="../../questions/tagged/android" class="post-tag grid--cell" title="show questions tagged 'android'" rel="tag">android</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/xml-parsing" class="post-tag grid--cell" title="show questions tagged 'xml-parsing'" rel="tag">xml-parsing</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 20 '16 at 04:54">asked Apr 20 '16 at 04:54</time> <a href="../../users/4085470/user1919" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/4085470.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="user1919" /> </a> <div class="s-user-card--info"> <a href="../../users/4085470/user1919" class="s-user-card--link">user1919</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">309</li> <li class="s-award-bling s-award-bling__silver" title="5 silver badges">5</li> <li class="s-award-bling s-award-bling__bronze" title="15 bronze badges">15</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-36488712"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>0</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/36488712/hyperlink-destinations-are-blank-when-parsing-document-with-domparser-in-chrom" class="question-hyperlink">Hyperlink destinations are blank when parsing document with DOMParser in Chrome</a></h3> <div class="excerpt">I am trying to use DOMParser to parse an HTML page (in this case http://www.iana.org/domains/reserved) and print out its <a> elements and their destinations. I have pasted and run the following code from the console at http://www.iana.org/: var xhr…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 07 '16 at 23:03">asked Apr 07 '16 at 23:03</time> <a href="../../users/83280/steven" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/83280.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Steven" /> </a> <div class="s-user-card--info"> <a href="../../users/83280/steven" class="s-user-card--link">Steven</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">2,538</li> <li class="s-award-bling s-award-bling__gold" title="3 gold badges">3</li> <li class="s-award-bling s-award-bling__silver" title="31 silver badges">31</li> <li class="s-award-bling s-award-bling__bronze" title="40 bronze badges">40</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-34517068"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>0</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/34517068/php-simple-html-dom-parser-can-t-find-elements-after-using-str-get-html" class="question-hyperlink">PHP Simple HTML DOM Parser can't find elements after using str_get_html();</a></h3> <div class="excerpt">I am using PHP Simple HTML DOM Parser to gather some text from another website. When I use file_get_html($url) then I get the error, "Message: file_get_contents(http://www.yellowbook.com/profile/great-wall-restaurant_1855353442.html): failed to open…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/php" class="post-tag grid--cell" title="show questions tagged 'php'" rel="tag">php</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 29 '15 at 18:42">asked Dec 29 '15 at 18:42</time> <a href="../../users/5683952/khtims75" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/5683952.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="khtims75" /> </a> <div class="s-user-card--info"> <a href="../../users/5683952/khtims75" class="s-user-card--link">khtims75</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">81</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="6 bronze badges">6</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-31534584"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>0</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/31534584/domparser-parsestring-comments-out-and-mess-cdata-inside-html-string" class="question-hyperlink">DOMParser.parseString comments out and mess CDATA inside HTML string</a></h3> <div class="excerpt">After parsing HTML string with DOMParser, the parser does some strange modification to CDATA included in the string. The only thing I want is to create HTML Dom object so I can access nodes. Any tip on how to avoid changes to CDATA? Before…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/html" class="post-tag grid--cell" title="show questions tagged 'html'" rel="tag">html</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jul 21 '15 at 08:58">asked Jul 21 '15 at 08:58</time> <a href="../../users/1565829/ismar-slomic" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1565829.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Ismar Slomic" /> </a> <div class="s-user-card--info"> <a href="../../users/1565829/ismar-slomic" class="s-user-card--link">Ismar Slomic</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">5,315</li> <li class="s-award-bling s-award-bling__gold" title="6 gold badges">6</li> <li class="s-award-bling s-award-bling__silver" title="44 silver badges">44</li> <li class="s-award-bling s-award-bling__bronze" title="63 bronze badges">63</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-29053868"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/29053868/domparser-parsefromstring-text-text-html-only-interprets-the-first-21500-bytes" class="question-hyperlink">DOMParser.parseFromString(text,"text/html") only interprets the first ~21,500 Bytes. Is this a bug?</a></h3> <div class="excerpt">I have Win 7, 64 Bit, Firefox 32.0.1, Noscript running. The following code only returns 199 nodes with aXML.getElementsByTagName("node"), whereas there are 300 in the parsed text, which is not well formed xml. var atext = ''; for (var…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/firefox" class="post-tag grid--cell" title="show questions tagged 'firefox'" rel="tag">firefox</a> <a href="../../questions/tagged/html-parsing" class="post-tag grid--cell" title="show questions tagged 'html-parsing'" rel="tag">html-parsing</a> <a href="../../questions/tagged/promise" class="post-tag grid--cell" title="show questions tagged 'promise'" rel="tag">promise</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 14 '15 at 20:33">asked Mar 14 '15 at 20:33</time> <a href="../../users/4550791/john" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/4550791.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="John" /> </a> <div class="s-user-card--info"> <a href="../../users/4550791/john" class="s-user-card--link">John</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">605</li> <li class="s-award-bling s-award-bling__silver" title="9 silver badges">9</li> <li class="s-award-bling s-award-bling__bronze" title="28 bronze badges">28</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-28487226"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/28487226/how-to-apply-document-css-properties-to-a-parsed-element-without-appending-it-" class="question-hyperlink">How to apply document CSS properties to a Parsed element without appending it to the DOM</a></h3> <div class="excerpt">The common way to do it is to appending the new element to the body and then get the computed css values like in this jQuery script: var $body = $('body'); var $this = $(this); var $text = $this.text(); if($text=='') $text =…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/dom" class="post-tag grid--cell" title="show questions tagged 'dom'" rel="tag">dom</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> <a href="../../questions/tagged/getcomputedstyle" class="post-tag grid--cell" title="show questions tagged 'getcomputedstyle'" rel="tag">getcomputedstyle</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card__deleted"> <time class="s-user-card--time" datetime="asked Feb 12 '15 at 20:32">asked Feb 12 '15 at 20:32</time> <div class="s-avatar s-avatar__32 s-user-card--avatar"> </div> <div class="s-user-card--info">user2200481</div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-25557937"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/25557937/using-filereader-domparser-in-angularjs" class="question-hyperlink">Using FileReader & DOMParser in AngularJS</a></h3> <div class="excerpt">I have a user uploaded file using AngularJS and like to manipulate the file contents using XML. However, I have a difficulty in the DOMParser recognising the text file. index.html <div ng-controller = "myCtrl"> <input type="file"…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/angularjs" class="post-tag grid--cell" title="show questions tagged 'angularjs'" rel="tag">angularjs</a> <a href="../../questions/tagged/filereader" class="post-tag grid--cell" title="show questions tagged 'filereader'" rel="tag">filereader</a> <a href="../../questions/tagged/domparser" class="post-tag grid--cell" title="show questions tagged 'domparser'" rel="tag">domparser</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Aug 28 '14 at 21:01">asked Aug 28 '14 at 21:01</time> <a href="../../users/3979240/andrew-mantilas" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/3979240.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Andrew Mantilas" /> </a> <div class="s-user-card--info"> <a href="../../users/3979240/andrew-mantilas" class="s-user-card--link">Andrew Mantilas</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">31</li> <li class="s-award-bling s-award-bling__bronze" title="3 bronze badges">3</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/domparser_page=3" rel="prev" title="Go to page 3">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/domparser_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/domparser_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/domparser_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/domparser_page=36" rel="" title="Go to page 36">36</a> <a class="s-pagination--item" href="../../questions/tagged/domparser_page=37" rel="" title="Go to page 37">37</a> <a class="s-pagination--item" href="../../questions/tagged/domparser_page=5" rel="next" title="Go to page 5"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>