jindw / xmldom

A PURE JS W3C Standard based(XML DOM Level2 CORE) DOMParser and XMLSerializer.
Other
819 stars 265 forks source link

Issue with empty spaces in the closing tags #197

Open RamprasadAkella opened 7 years ago

RamprasadAkella commented 7 years ago

Parser is not working as expected when there are empty spaces in the closing tags. For example, the below code is returning empty nodes because of "</book >".


var xml = "<book></book ><title>Harry Potter</title>"
var doc = new Dom().parseFromString(xml)
var nodes = xpath.select("title/text()", doc)

If I keep </book > as </book> it's working as expected. Please check this.

karfau commented 4 years ago

@brodybits I guess we should also check/add a test for this one over at https://github.com/xmldom/xmldom

karfau commented 3 years ago

Fix upcoming: https://github.com/xmldom/xmldom/pull/267