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

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

From: Dinesh Bolkensteyn <dinesh.bolkensteyn@sonarsource.com>
Date: Tue, 5 Feb 2013 16:05:09 +0100
Message-ID: <CAA06TwNni39G8YaM_sQygyTHHRTbgSi87zTFjF4u775hbLh6Lw@mail.gmail.com>
To: xml-editor@w3.org
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://www.SonarSource.com>
Received on Tuesday, 5 February 2013 16:44:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 5 February 2013 16:44:13 GMT