W3C home > Mailing lists > Public > xml-editor@w3.org > January to March 2013

Re: Regarding the "Mixed" production of both XML 1.0 and 1.1 specifications

From: Paul Grosso <paul@paulgrosso.name>
Date: Mon, 11 Feb 2013 08:51:03 -0600
Message-ID: <51190557.30402@paulgrosso.name>
To: Dinesh Bolkensteyn <dinesh.bolkensteyn@sonarsource.com>
CC: xml-editor@w3.org
Thank you for your interest in the XML Recommendation.

Throughout the various XML recommendations, the production
rules are applied after parameter entity references have
been expanded.  This is explained in section 2.8 of XML 1.0
Fifth Edition and XML 1.1 Second Edition by the second
paragraph following production [29]:

  The markup declarations may be made up in whole or in
  part of the replacement text of parameter entities. The
  productions later in this specification for individual
  nonterminals (elementdecl, AttlistDecl, and so on)
  describe the declarations after all the parameter
  entities have been included.

paul

Paul Grosso, for the XML Core WG

[29] http://www.w3.org/TR/REC-xml/#NT-markupdecl


On 2013-02-05 09:05, Dinesh Bolkensteyn wrote:
> Hi XML editors,
> In both the XML 1.0 and 1.1 specs, the "Mixed" production is defined 
> in the same way:
>  1.0: http://www.w3.org/TR/2008/REC-xml-20081126/#sec-mixed-content
>  1.1: http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-mixed-content
> |Mixed| 	::= 	|'(' S 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? '#PCDATA' (S 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? '|' S 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? Name 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-Name>)* S 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? ')*' |
>
> 	
> 	
> 	|| '(' S <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? 
> '#PCDATA' S <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? ')' |
>
>
> And the following mixed element declaration examples are given:
> 1) <!ELEMENT p (#PCDATA|a|ul|b|i|em)*>
> 2) <!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* >
> 3) <!ELEMENT b (#PCDATA)>
> It is clear to me how examples 1) and 3) are parsed, but I do not 
> understand the 2nd case.
> "%font;", "%phrase;" etc... look like the PEReference production, and 
> not like Name one.
> Name, more precisely NameStartChar, does not accept '%' as a first 
> character.
> So, should I read the "Mixed" production as follows, or is the 
> provided example wrong?
> |Mixed| 	::= 	|'(' S 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? '#PCDATA' (S 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? '|' S 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? (Name 
> <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-Name> | PEReference))* 
> S <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? ')*' |
>
> 	
> 	
> 	|| '(' S <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? 
> '#PCDATA' S <http://www.w3.org/TR/2008/REC-xml-20081126/#NT-S>? ')' |
>
> Many thanks!
>
> --
> Dinesh Bolkensteyn
> www.SonarSource.com <http://www.sonarsource.com/>
> twitter.com/DBolkensteyn <http://twitter.com/DBolkensteyn>
Received on Monday, 11 February 2013 14:52:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 11 February 2013 14:52:07 GMT