[erlang-questions] xmerl and the xml namespace

Karolis Petrauskas k.petrauskas@REDACTED
Sat Jan 7 22:05:31 CET 2017

Hello erlangers,

I tried to parse XML document containing namespaced elements using
xmerl. The document contain xml:lang attributes and no declaration for
the xml prefix. The minimal example reproducing the error is bellow.

1> catch xmerl_scan:string("<a xml:lang='en_US'/>",
[{namespace_conformant, true}]).


The same XML document is parsed successfully with {namespace_conformant, false}.

The XML specification (https://www.w3.org/TR/xml-names/#xmlReserved)
says, that the xml prefix can be used without declaration and must
refer to "http://www.w3.org/XML/1998/namespace".

Is this a bug in xmerl, or I misunderstand something?


More information about the erlang-questions mailing list