Skip to content
  • Dennis Filder's avatar
    parser bug on misformed namespace attributes · 7e9bbdf8
    Dennis Filder authored and Daniel Veillard's avatar Daniel Veillard committed
    For https://bugzilla.gnome.org/show_bug.cgi?id=672539
    Reported by Axel Miller <axel.miller@ppi.de>
    
    Consider the following start-tag:
    <x xmlns=""version="">
    
    The start-tag does not conform to the rule
    
    [40]       STag       ::=       '<' Name (S Attribute)* S? '>'
    
    since there is no whitespace in front of the attribute "version".
    
    Thus, libxml2 should reject the start-tag.
    But it doesn't:
    
    $ echo '<x xmlns=""version=""/>' | xmllint -
    <?xml version="1.0"?>
    <x xmlns="" version=""/>
    
    The error seems to happen only if there is a namespace declaration in
    front of
    the attribute. A missing whitespace between other attributes is handled
    correctly:
    
    $ echo '<x someattr=""version=""/>' | xmllint -
    -:1: parser error : attributes construct error
    <x someattr=""version=""/>
                  ^
    [...]
    7e9bbdf8