The selection from the concrete BNF of the syntax of XML which concerns generic identifiers
in start tags and end tags, and attribute names in start tags includes the following
phrases:
[[1]] Document ::=DoctypeDecl?Element[[28]] DoctypeDecl ::= '<!DOCTYPE' QName MarkupDecl* '>' [[29]] MarkupDecl ::= ElementDecl | AttlistDecl[[39]] Element ::= STag ( '/>' | ( '>' Content* ETag ) ) [[40]] STag ::= '<' QName AttributeSequence? AttributeSequence ::= Attribute AttributeSequence? [[41]] Attribute ::= QName AttValue [[42]] ETag ::= '</' QName '>'[[45]] ElementDecl ::= '<!ELEMENT' QName Qname* '>' [[52]] AttlistDecl ::= '<!ATTLIST' QName AttDef '>' [[53]] AttDef ::= QName AttValue QName ::= Prefix? LocalPart Prefix ::= NCName ':' LocalPart ::= NCName
These can be elaborated to distinguish namespaces from other attributes, and simplified to the following forms:
NCName ::= (Letter | '_' | ':') (Letter | Digit | '.' | '-' | '_' | ':')* p .E. Prefix ::= NCName l .E. LocalPart ::= NCName ns .E. Namespace ::= Character+ null ::= '()' qn .E. QualifiedName ::= (:qn (Prefix + null) X LocalPart ) un .E. UniversalName ::= (:un (Namespace + null) X LocalPart ) n .E. Name ::= UniversalName + QualifiedName nsb .E. NamespaceBinding ::= (:nsb . ((LocalPart X Namespace) + (null X (Namespace + null))) ) a .E. Attribute ::= (:a Name ) e .E. Element ::= (:e Name X NamespaceBinding* X Attribute* X Element* ) ed .E. ElementDeclaration ::= (:ed Name X (Name* + '*') ) ad .E. AttributeDeclaration ::= (:ad Name X NamespaceBinding* X Attribute* ) dcl .E. DeclarationContext ::= (:dcl (ElementDeclaration + AttributeDeclaration + DeclarationContext)* ) doc .E. Document ::= (:doc Name DeclarationContext X Element )
from which the following exemplary variations can be extrapolated. the respective values are reexpressed as declaration-free documents.
the scope of the p1->ns0 binding comprises the element declaration. by virtue of attribute defaults it extends to the document element instance
<!DOCTYPE P0:L0 [
<!ELEMENT P0:L0 EMPTY >
<!ATTLIST P0:L0 xmlns:P0 CDATA 'ns0' > ] >
<P0:L0/>
(:doc (:qn p0l0)
(:dcl ((:ed (:qn p0l0) )
(:ad (:qn p0l0) (:nsb p0ns0 )))
(:e (:qn p0l0) () () ()))
==>
(:doc ns0 l0)
(:dcl ((:ad ns0 l0) (:nsb nil nil) (:nsb p0ns0 )
(:ed ns0 l0) )))
(:e ns0 l0) ((:nsb nil nil) (:nsb p0ns0) () ()))
the scope of the p1->ns1 binding comprises the element declaration and to content elements. by virtue of attribute defaults it extends to the document element instance.
<!DOCTYPE P0:L0 [
<!ELEMENT P0:L0 ( P0:L1, P0:L2 ) >
<!ATTLIST P0:L0 xmlns:P0 CDATA 'ns0' P0:LA1 CDATA 'attValue-1' P0:LA2 CDATA 'attValue-2' >
<!ELEMENT P0:L1 EMPTY >
<!ELEMENT P0:L2 EMPTY >
<!ATTLIST P0:L0 P0:ATT3 CDATA 'attValue-3' > ] >
<P0:L0>
<P0:L1/>
<P0:L2/></P0:L0>
(:doc (:qn p0l0)
(:dcl ((:ed (:qn p0l0) (:qn p0l1) (:qn p0l2))
(:ad (:qn p0l0) (:nsb p0ns0 (:ad (:qn p0la1)) (:ad (:qn p0la2)))
(:ed (:qn p0l1) )
(:ed (:qn p0l2) )
(:ad (:qn p0l0) (:ad (:qn p0att3)))))
(:e (:qn p0l0) () ()
((:e (:qn p0l1) () () ())
(:e (:qn p0l2) () () ())))
==>
(:doc ns0 l0)
(:dcl ((:ad ns0 l0) (:nsb nil nil) (:nsb p0ns0 (:ad ns0 att3)) (:ad ns0 la2)) (:ad ns0 la1)))
(:ed ns0 l0) ns0 l2) ns0 l1) ns0 l0))
(:ed ns0 l1) )
(:ed ns0 l2) )))
(:e ns0 l0) ((:nsb nil nil) (:nsb p0ns0) ((:ad ns0 att3)) (:ad ns0 la2)) (:ad ns0 la1)))
((:e ns0 l1) () () ())
(:e ns0 l2) () () ())))
the scope of the p1->ns1 binding comprises the element declaration and declared content elements. by virtue of attribute defaults it extends to the document element instance.
<!DOCTYPE P1:L1 [
<!ELEMENT P1:L1 ( P1:L2 ) >
<!ELEMENT P1:L2 EMPTY >
<!ATTLIST P1:L1 xmlns:P1 CDATA 'ns1' > ] >
<P1:L1>
<P1:L2/></P1:L1>
(:doc (:qn p1l1)
(:dcl ((:ed (:qn p1l1) (:qn p1l2))
(:ed (:qn p1l2) )
(:ad (:qn p1l1) (:nsb p1ns1 )))
(:e (:qn p1l1) () ()
((:e (:qn p1l2) () () ())))
==>
(:doc ns1 l1)
(:dcl ((:ed ns1 l2) )))
(:e ns1 l1) ((:nsb nil nil) (:nsb p1ns1) ()
((:e ns1 l2) () () ())))
the scope of the p1->ns1 binding comprises the element declaration and ANY content elements. by virtue of attribute defaults it extends to the document element instance.
<!DOCTYPE P1:L1 [
<!ELEMENT P1:L1 ANY >
<!ELEMENT P1:L2 EMPTY >
<!ATTLIST P1:L1 xmlns:P1 CDATA 'ns1' > ] >
<P1:L1>
<P1:L2/></P1:L1>
(:doc (:qn p1l1)
(:dcl ((:ed (:qn p1l1) *)
(:ed (:qn p1l2) )
(:ad (:qn p1l1) (:nsb p1ns1 )))
(:e (:qn p1l1) () ()
((:e (:qn p1l2) () () ())))
==>
(:doc ns1 l1)
(:dcl ((:ed ns1 l2) )))
(:e ns1 l1) ((:nsb nil nil) (:nsb p1ns1) ()
((:e ns1 l2) () () ())))
the scope of the p1->ns1 binding encompasses declarations of elements which appear in declaration entities dependent on the entity within which the binding appears. it extends as well over distinct branch entities and over children of the directly declared element by virtue of the ANY content model.
<!DOCTYPE P1:L1 [
<!ATTLIST P1:L1 xmlns:P1 CDATA 'ns1' >
<!ENTITY % e-1 SYSTEM 'data:,<!ELEMENT P1:L1 ANY > '> %e-1;
<!ENTITY % e-2 SYSTEM 'data:,<!ELEMENT P1:L2 EMPTY > '> %e-2; ] >
<P1:L1>
<P1:L2/></P1:L1>
(:doc (:qn p1l1)
(:dcl ((:ad (:qn p1l1) (:nsb p1ns1 )
(:dcl ((:ed (:qn p1l1) *)))
(:dcl ((:ed (:qn p1l2) )))))
(:e (:qn p1l1) () ()
((:e (:qn p1l2) () () ())))
==>
(:doc ns1 l1)
(:dcl ((:ed ns1 l2) )))
(:e ns1 l1) ((:nsb nil nil) (:nsb p1ns1) ()
((:e ns1 l2) () () ())))
the scope of the p1->ns1, and p2->ns1 binding encompasses declarations of elements which appear in declaration entities dependent on the entity within which the binding appears. it extends as well over distinct child entities and over children of the directly declared element to effect the identity od names with distinct literal expressions.
<!DOCTYPE P1:L1 [
<!ATTLIST P1:L1 xmlns:P1 CDATA 'ns1' xmlns:P2 CDATA 'ns1' >
<!ENTITY % e-1 SYSTEM 'data:,<!ELEMENT P1:L1 ( P1:L2 ) > '> %e-1;
<!ENTITY % e-2 SYSTEM 'data:,<!ELEMENT P2:L2 EMPTY > '> %e-2; ] >
<P1:L1>
<P1:L2/></P1:L1>
(:doc (:qn p1l1)
(:dcl ((:ad (:qn p1l1) (:nsb p1ns1 (:nsb p2ns1 )
(:dcl ((:ed (:qn p1l1) (:qn p1l2))))
(:dcl ((:ed (:qn p2l2) )))))
(:e (:qn p1l1) () ()
((:e (:qn p1l2) () () ())))
==>
(:doc ns1 l1)
(:dcl ((:ed ns1 l2) )))
(:e ns1 l1) ((:nsb nil nil) (:nsb p2ns1 (:nsb p1ns1) ()
((:e ns1 l2) () () ())))
the scope of the p1->ns1 binding encompasses declarations of elements which appear in declaration entities dependent on the entity within which the binding appears. it extends as well over distinct child entities and over children of the directly declared element.
<!DOCTYPE P1:L1 [
<!ATTLIST P1:L1 xmlns:P1 CDATA 'ns1' >
<!ENTITY % e-1 SYSTEM 'data:,<!ELEMENT P1:L1 ANY > '> %e-1;
<!ENTITY % e-2 SYSTEM 'data:,<!ELEMENT P1:L2 EMPTY > '> %e-2; ] >
<P1:L1>
<P1:L2/></P1:L1>
(:doc (:qn p1l1)
(:dcl ((:ad (:qn p1l1) (:nsb p1ns1 )
(:dcl ((:ed (:qn p1l1) *)))
(:dcl ((:ed (:qn p1l2) )))))
(:e (:qn p1l1) () ()
((:e (:qn p1l2) () () ())))
==>
(:doc ns1 l1)
(:dcl ((:ed ns1 l2) )))
(:e ns1 l1) ((:nsb nil nil) (:nsb p1ns1) ()
((:e ns1 l2) () () ())))
the scope of the p1->ns1 binding does not encompass declarations of elements which appear in declaration entities in parallel branches. it extends as well over distinct child entities and over children of the directly declared element.
<!DOCTYPE P1:L1 [
<!ATTLIST P1:L1 xmlns:P1 CDATA 'ns1' xmlns:P2 CDATA 'ns2' >
<!ELEMENT P1:L1 ( P1:L2, P2:L2 ) >
<!ENTITY % e-1 SYSTEM 'data:,<!ELEMENT P1:L2 EMPTY > <!ATTLIST P1:L2 xmlns:P1 CDATA "ns1" > '> %e-1;
<!ENTITY % e-2 SYSTEM 'data:,<!ELEMENT P1:L2 EMPTY > <!ATTLIST P1:L2 xmlns:P1 CDATA "ns2" > '> %e-2; ] >
<P1:L1>
<P1:L2/>
<P2:L2/></P1:L1>
(:doc (:qn p1l1)
(:dcl ((:ad (:qn p1l1) (:nsb p1ns1 (:nsb p2ns2 )
(:ed (:qn p1l1) (:qn p1l2) (:qn p2l2))
(:dcl ((:ed (:qn p1l2) )
(:ad (:qn p1l2) (:nsb p1ns1 )))
(:dcl ((:ed (:qn p1l2) )
(:ad (:qn p1l2) (:nsb p1ns2 )))))
(:e (:qn p1l1) () ()
((:e (:qn p1l2) () () ())
(:e (:qn p2l2) () () ())))
==>
(:doc ns1 l1)
(:dcl ((:ad ns2 l2) (:nsb p1ns2 )
(:ed ns2 l2) )
(:ad ns1 l2) (:nsb p1ns1 )
(:ed ns1 l2) )))
(:e ns1 l1) ((:nsb nil nil) (:nsb p2ns2 (:nsb p1ns1) ()
((:e ns1 l2) ((:nsb p1ns1) () ())
(:e ns2 l2) ((:nsb p1ns2) () ())))