Menu

#271 xmlwf -n on file which uses a ':' as attribute name

Not a Bug
closed-invalid
nobody
None
5
2003-08-13
2003-08-12
Anonymous
No

xmwf -n on file

<!DOCTYPE doc [
<!ELEMENT doc (#PCDATA)>
<!ATTLIST doc : CDATA #IMPLIED>
]>
<doc :="v1"></doc>

reports valid/sa/012.xml:3:14: syntax error
as it does not like ':' as an attribute name.

I'm not quite sure whether this is a bug or not - cf.

http://www.w3.org/TR/REC-xml-names/

[4] NCName ::= (Letter | '_') (NCNameChar)*
[5] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
CombiningChar | Extender
[6] QName ::= (Prefix ':')? LocalPart
[7] Prefix ::= NCName
[8] LocalPart ::= NCName

and

http://www.w3.org/TR/REC-xml#attdecls

[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S?
'>'
[53] AttDef ::= S Name S AttType S DefaultDecl

[4] NameChar ::= Letter | Digit | '.' | '-' | '_'
| ':' | CombiningChar | Extender
[5] Name ::= (Letter | '_' | ':') (NameChar)*

tcrhak@suse.cz

Discussion

  • Rolf Ade

    Rolf Ade - 2003-08-13

    Logged In: YES
    user_id=13222

    Not a bug. expat is right. You've quoted even the right
    productions, to decide this. (4) says, that a NCName must
    have at least one char and a colon isn't allowed. (By the
    way: I always thought, that NCName stands for non colon
    name, but could not found a source for that, at the moment).
    Prefix (7) and Localpart (8) are both NCNames. A colon in
    the QName is therefor only possible, if the QName has a
    prefix. Since the prefix must have at least one char, the
    att name in your example hasn't a prefix.

    Note, that your document is a wellformed XML document - and
    xmlwf (without -n) confirms this. It's only not a wellformed
    namespaced XML document.

     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    Closing as not-a-bug, for the reason explained by Rolf.

     
  • Fred L. Drake, Jr.

    • milestone: --> Not a Bug
    • status: open --> closed-invalid
     
  • Nobody/Anonymous

    Logged In: NO

    Just for letting you guys know, NCN stands for "non-
    colonized" Names, you can check
    http://www.w3.org/TR/2004/REC-xmlschema-2-
    20041028/datatypes.html#NCName for NCName full description.

    lucas.massuh@gmail.com

     

Log in to post a comment.