summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2021-12-08 19:59:53 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2021-12-08 19:59:53 -0500
commit13fd8c214a34e7817afe493068f00d47a073ab09 (patch)
treea247b90d09fff133b42f503384deee19846a3b85
parent61126fb6ef8889cffa129ea34559fe6d12675f16 (diff)
downloadorcus-13fd8c214a34e7817afe493068f00d47a073ab09.tar.gz
Print short name in case an alias is not available.
-rw-r--r--src/liborcus/xml_util.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liborcus/xml_util.cpp b/src/liborcus/xml_util.cpp
index 0291be98..906d321d 100644
--- a/src/liborcus/xml_util.cpp
+++ b/src/liborcus/xml_util.cpp
@@ -29,8 +29,10 @@ void xml_element_printer::print_namespace(std::ostream& os, xmlns_id_t ns) const
if (mp_ns_cxt)
{
std::string_view alias = mp_ns_cxt->get_alias(ns);
- if (!alias.empty())
- os << alias;
+ if (alias.empty())
+ alias = mp_ns_cxt->get_short_name(ns);
+
+ os << alias;
}
else
os << ns;