5.2.20
09/20/2020

[#278] Xml attributes no ns without prefix
Summary Xml attributes no ns without prefix
Queue gloox
Queue Version 1.0.23
Type Bug
State Resolved
Priority 1. Low
Owners js (at) camaya (dot) net
Requester drizt72 (at) zoho (dot) eu
Created 08/08/2018 (774 days ago)
Due
Updated 12/08/2019 (287 days ago)
Assigned
Resolved 12/08/2019 (287 days ago)

History
12/08/2019 08:16:17 PM Jakob Schröter Comment #2
Assigned to Jakob Schröter
State ⇒ Resolved
Version ⇒ 1.0.23
Reply to this comment
Thank you.
It's taken a while but this is now fixed in svn.
08/08/2018 05:30:17 AM drizt72 (at) zoho (dot) eu Comment #1
State ⇒ Unconfirmed
Queue ⇒ gloox
Summary ⇒ Xml attributes no ns without prefix
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
This function returns parent xmlns for attribute without prefix. But 
in this case must be empty xmlns. See XML specification: 
https://stackoverflow.com/questions/3312390/xml-default-namespaces-for-unqualified-attribute-names

   const std::string Tag::Attribute::xmlns() const
   {
     if( !m_xmlns.empty() )
       return m_xmlns;

     if( m_parent )
       return m_parent->xmlns( m_prefix );

     return EmptyString;
   }

So correct code may be:

   const std::string Tag::Attribute::xmlns() const
   {
     if( !m_xmlns.empty() )
       return m_xmlns;

     if( m_parent && !m_prefix.empty() )
       return m_parent->xmlns( m_prefix );

     return EmptyString;
   }