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

Anthony Ramine n.oxyde@REDACTED
Tue Sep 16 11:16:52 CEST 2014


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> 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> 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
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list