[erlang-questions] [Patch] XMERL Attributes without whitespaces

Motiejus Jakštys desired.mta@REDACTED
Mon Sep 15 10:22:09 CEST 2014

On Mon, Sep 15, 2014 at 9:44 AM, Eranga Udesh <eranga.erl@REDACTED> wrote:
> Hi,
> However W3C (http://www.w3schools.com/xml/xml_validator.asp) validates above
> XLM without any errors. Therefore I guess xmerl better support that.

Hi, Udesh,

according to XML 1-1 specification[1], your example does not adhere to
the grammar. Relevant grammar sections:

[3]   S   ::=   (#x20 | #x9 | #xD | #xA)+
[40]   STag   ::=   '<' Name (S Attribute)* S? '>'
[41]   Attribute   ::=    Name Eq AttValue

Important bit: (S Attribute)*. As you can see, Attribute can never
follow Attribute without a whitespace between them.

> Attached is a patch to fix that. It could help others too, if that patch is
> added to the xmerl package distributed in OTP distribution.

Maybe that W3C parser supports non-spaced attributes is coincidental?
Or maybe I am looking at the wrong grammar?

Motiejus Jakštys

[1]: http://www.w3.org/TR/xml11/#sec-starttags

More information about the erlang-questions mailing list