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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Dinesh Bolkensteyn
Hi XML editors,
 
In both the XML 1.0 and 1.1 specs, the "Mixed" production is defined in the same way:
 
Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'
| '(' S? '#PCDATA' 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? '#PCDATA' (S? '|' S? (Name | PEReference))* S? ')*'
| '(' S? '#PCDATA' S? ')'
 
Many thanks!
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Paul Grosso
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:
 
Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'



| '(' S? '#PCDATA' 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? '#PCDATA' (S? '|' S? (Name | PEReference))* S? ')*'



| '(' S? '#PCDATA' S? ')'
 
Many thanks!

Loading...