Parse HTML on JavaScript's Windows Store apps RRS feed

  • Question

  • I got an error "XML5633: End-tag name does not match the corresponding start-tag name. Line: 8, Column 338"


    var parser = new DOMParser();

    var doc = parser.parseFromString(xhr.responseText, "text/html");

    • Edited by SaravudhS Saturday, December 22, 2012 4:48 PM
    Saturday, December 22, 2012 4:47 PM


  • Hi SaravudhS,

    From the error, it seems the response HTML content cause the DOMParser throw an error. For test, you can try loading the target page's html content in a .NET console app (and use either XDocument or some other html parsing library) to see if the response html content is well-formed xml or if it is valid html.

    For html data parsing in windows store javascript, you can also try using jquery api to simplify the html content loading and querying. But you need to convert the jquery object into raw HTML DOM objects before you will add them to the Windows Store UI page's DOM structure.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Friday, December 28, 2012 7:40 AM
    Monday, December 24, 2012 5:35 AM