Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Technically you "can" if you manage to find a non-namespace-aware XML parser, it'll parse `prefix:name` as the ELEMENTNAME `prefix:name`.

> As it is, this XML is not parsable

It's parsable with a non-namespace-aware XML parser (ignoring tagsoup parsers as we're pretenting this is supposed to be an XML document)



That's true; but where would you find such a beast? AFAIK you can't switch namespace-awareness off in modern parsers, so you'd have to find a very (very) old version...


> AFAIK you can't switch namespace-awareness off in modern parsers

Apparently, the JDK's javax.xml.parsers.*Factory can return namespace-unaware parsers and — even stranger — do so by default:

http://docs.oracle.com/javase/7/docs/api/javax/xml/parsers/D...

> Specifies that the parser produced by this code will provide support for XML namespaces. By default the value of this is set to false

http://docs.oracle.com/javase/7/docs/api/javax/xml/parsers/S...

> Specifies that the parser produced by this code will provide support for XML namespaces. By default the value of this is set to false.

Whether they qualify as "modern parsers" can be debated and I didn't test their behavior, but there you are.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: