jcabi-xml
jcabi-xml copied to clipboard
Valid XML not passed validation
Please see full stacktrace at http://pastebin.com/zK7HkMK8
Patterns.XML not matches specified XML (attached as planets.txt due github file extension restriction) as valid XML. planets.txt
@yegor256 please do something about this issue
@amihaiemil it's yours, please help
@senleft can you give me the planets.xsl? I am running a test with planets.xml file you attached and I'm getting the following error:

Which makes me thing the whole xml passes patterns validation but it doesn't find the xsl and so it fails.
@senleft I figured why I got the exception above it's not lack of xsl. I also did try to instantiate an XmlDocument with the exact contents of planets.xml you attached and it worked

And that XmlDocument constructor calls DomParser:

which runs that regex pattern. So as it is now, I'd say I did not reproduce it? Are you absolutely sure the xml was valid at the moment when you tried? :D
@amihaiemil Yes, I'm absolutely sure about it. I will try to reproduce it and attach the full project source.
@senleft sure, thanks. I will wait for that since I'm out of leads for the moment :)
@dmarkov assign someone else; no more time for this :(
@senleft I reproduced the problem (it's indeed a regex problem), but got no more time for this. Someone else should take it up soon. In the meantime, please don't turn off notifications from this post as in the end, you should be the one to close it. Thanks!
@dmarkov assign someone else; no more time for this :(
@amihaiemil 30 points was deducted from your rating
@dmarkov assign someone else; no more time for this :(
@amihaiemil someone else will help in this task, no problem at all
I'm getting the same issue here, I have absolutely valid XML and the pattern returns this exception: java.lang.IllegalArgumentException: Doesn't look like XML: 'content of my valid xml file'
The issue seems to be in this string transformation: txt.replaceAll("\s", "") before pattern check. For any reason it is not only removing lines returns, but also whitespaces, so from <?xml version="1.0" encoding="utf-8"?> it makes <?xmlversion="1.0"encoding="utf-8"?>.
This is my Java Runtime: openjdk version "1.8.0_191" OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.18.04.1-b12) OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)