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

Eranga Udesh eranga.erl@REDACTED
Mon Sep 15 13:22:25 CEST 2014


Hi Motiejus,

It is not just W3C parser, but it seems PHP/Java XML parser(s) too support
attributes without spaces.

For one of our projects in Erlang, we had to customize xmerl, because their
existing XML parsers are supporting the XML syntax without whitespaces in
attributes. When validated the same XML in W3C, no errors shown, so being a
new solution, we had to comply to their existing XML syntax.

- Eranga

On Mon, Sep 15, 2014 at 1:52 PM, Motiejus Jakštys <desired.mta@REDACTED>
wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140915/ff1c0468/attachment.htm>


More information about the erlang-questions mailing list