xmerl and the xml namespace

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

xmerl and the xml namespace

Karolis Petrauskas-2
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}]).

{'EXIT',{fatal,{{namespace_prefix_not_declared,"xml"},
                {file,file_name_unknown},
                {line,1},
                {col,23}}}}

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?

Karolis
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: xmerl and the xml namespace

Lars Thorsen-4


Hi,

this is clearly a bug and I will create an internal ticket for it.

If you want to keep track on it create a bug report in Jira (http://bugs.erlang.org/).


BR Lars

OTP Team



From: [hidden email] <[hidden email]> on behalf of Karolis Petrauskas <[hidden email]>
Sent: Saturday, January 7, 2017 10:05:31 PM
To: [hidden email]
Subject: [erlang-questions] xmerl and the xml namespace
 
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}]).

{'EXIT',{fatal,{{namespace_prefix_not_declared,"xml"},
                {file,file_name_unknown},
                {line,1},
                {col,23}}}}

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?

Karolis
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: xmerl and the xml namespace

Karolis Petrauskas-2
Thanks for the information.

Karolis

On Wed, Jan 11, 2017 at 8:29 AM, Lars Thorsen <[hidden email]> wrote:

>
> Hi,
>
> this is clearly a bug and I will create an internal ticket for it.
>
> If you want to keep track on it create a bug report in Jira
> (http://bugs.erlang.org/).
>
>
> BR Lars
>
> OTP Team
>
>
> ________________________________
> From: [hidden email]
> <[hidden email]> on behalf of Karolis Petrauskas
> <[hidden email]>
> Sent: Saturday, January 7, 2017 10:05:31 PM
> To: [hidden email]
> Subject: [erlang-questions] xmerl and the xml namespace
>
> 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}]).
>
> {'EXIT',{fatal,{{namespace_prefix_not_declared,"xml"},
>                 {file,file_name_unknown},
>                 {line,1},
>                 {col,23}}}}
>
> 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?
>
> Karolis
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: xmerl and the xml namespace

Karolis Petrauskas-2
I created a pull request https://github.com/erlang/otp/pull/1332.
It contains a fix for this problem as well as two additional test cases.

Karolis

On Wed, Jan 11, 2017 at 3:43 PM, Karolis Petrauskas <[hidden email]> wrote:
Thanks for the information.

Karolis

On Wed, Jan 11, 2017 at 8:29 AM, Lars Thorsen <[hidden email]> wrote:
>
> Hi,
>
> this is clearly a bug and I will create an internal ticket for it.
>
> If you want to keep track on it create a bug report in Jira
> (http://bugs.erlang.org/).
>
>
> BR Lars
>
> OTP Team
>
>
> ________________________________
> From: [hidden email]
> <[hidden email]> on behalf of Karolis Petrauskas
> <[hidden email]>
> Sent: Saturday, January 7, 2017 10:05:31 PM
> To: [hidden email]
> Subject: [erlang-questions] xmerl and the xml namespace
>
> 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}]).
>
> {'EXIT',{fatal,{{namespace_prefix_not_declared,"xml"},
>                 {file,file_name_unknown},
>                 {line,1},
>                 {col,23}}}}
>
> 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?
>
> Karolis
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions