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

Eranga Udesh eranga.erl@REDACTED
Tue Sep 16 14:49:37 CEST 2014


It's my mistake. The XML parser I sent is w3schools and not the W3C. The
W3C parser at http://validator.w3.org too parses the same XML I sent and
return below status.

This document was successfully checked as well-formed XML!

- Eranga

On Tue, Sep 16, 2014 at 6:10 PM, Loïc Hoguin <essen@REDACTED> wrote:

> It is *not* the W3C validator. The W3C validator is at
> http://validator.w3.org/
>
> On 09/16/2014 11:53 AM, Eduardo Gurgel wrote:
>
>> That's w3schools. Is it "the W3C" validator?
>>
>> On 16 September 2014 21:27, Eranga Udesh <eranga.erl@REDACTED
>> <mailto:eranga.erl@REDACTED>> wrote:
>>
>>     What do you mean? I use the online validator at
>>     http://www.w3schools.com/xml/xml_validator.asp
>>
>>     - Eranga
>>
>>     On Tue, Sep 16, 2014 at 2:46 PM, Anthony Ramine <n.oxyde@REDACTED
>>     <mailto:n.oxyde@REDACTED>> wrote:
>>
>>         How did you feed XML to the W3C validator given that you can't
>>         limit it to XML analysis?
>>
>>         Le 15 sept. 2014 à 13:22, Eranga Udesh <eranga.erl@REDACTED
>>         <mailto:eranga.erl@REDACTED>> a écrit :
>>
>>          > 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 <mailto:desired.mta@REDACTED>> wrote:
>>          > On Mon, Sep 15, 2014 at 9:44 AM, Eranga Udesh
>>         <eranga.erl@REDACTED <mailto: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
>>          >
>>          > _______________________________________________
>>          > erlang-questions mailing list
>>          > erlang-questions@REDACTED <mailto:erlang-questions@
>> erlang.org>
>>          > http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>>     _______________________________________________
>>     erlang-questions mailing list
>>     erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>>     http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>>
>> --
>> Eduardo
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
> --
> Loïc Hoguin
> http://ninenines.eu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140916/c0772cf8/attachment.htm>


More information about the erlang-questions mailing list