5.2.20
12/08/2019

[#277] No prefixed xml namespace
Summary No prefixed xml namespace
Queue gloox
Queue Version 1.0.21
Type Bug
State Unconfirmed
Priority 1. Low
Owners
Requester drizt72 (at) zoho (dot) eu
Created 07/31/2018 (495 days ago)
Due
Updated 08/01/2018 (494 days ago)
Assigned
Resolved

History
08/01/2018 03:14:16 AM drizt72 (at) zoho (dot) eu Comment #2 Reply to this comment
I read documentation. It has "Do not use this function to set XML 
namespaces, use setXmlns() instead". But in such case addAttribute 
doesn't handle with incorrect attribute name. This looks like a bug. 
So addAttribute should doesn't make a new attribute with "xmlns" or 
"xmlns.*" name and return false or handle case when user tries use 
this function to add a new namespaces.
07/31/2018 09:00:48 AM drizt72 (at) zoho (dot) eu Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ No prefixed xml namespace
Queue ⇒ gloox
Reply to this comment
Tag::xmlns(std::string) returns empty when prefixed namespace was 
added with addAttribute function. Here code to reproduce

     Tag *tag = new Tag("t");
     tag->addAttribute("xmlns", "def/namespace");
     tag->addAttribute("xmlns:p", "pref/namespace");
     printf("xml: %s\n", tag->xml().c_str());
     printf("default ns: %s\n", tag->xmlns().c_str());
     printf("prefixed ns: %s\n", tag->xmlns("p").c_str());

Output:
xml: <t xmlns='def/namespace' xmlns:p='pref/namespace'/>
default ns: def/namespace
prefixed ns: