for (ExtensionAttribute attribute : attributeList) { if (!isBlacklisted(attribute, blackLists)) { if (attribute.getNamespacePrefix() == null) { if (attribute.getNamespace() == null) xtw.writeAttribute(attribute.getName(), attribute.getValue()); if (!namespaceMap.containsKey(attribute.getNamespacePrefix())) { namespaceMap.put(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeNamespace(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue());
if (StringUtils.isNotEmpty(attribute.getName()) && attribute.getValue() != null) { if (StringUtils.isNotEmpty(attribute.getNamespace())) { if (StringUtils.isNotEmpty(attribute.getNamespacePrefix())) { if (!namespaceMap.containsKey(attribute.getNamespacePrefix()) || !namespaceMap.get(attribute.getNamespacePrefix()).equals(attribute.getNamespace())) { xtw.writeNamespace(attribute.getNamespacePrefix(), attribute.getNamespace()); namespaceMap.put(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue()); } else { xtw.writeAttribute(attribute.getNamespace(), attribute.getName(), attribute.getValue());
for (ExtensionAttribute attribute : attributeList) { if (!isBlacklisted(attribute, blackLists)) { if (attribute.getNamespacePrefix() == null) { if (attribute.getNamespace() == null) xtw.writeAttribute(attribute.getName(), attribute.getValue()); if (!namespaceMap.containsKey(attribute.getNamespacePrefix())) { namespaceMap.put(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeNamespace(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue());
if (StringUtils.isNotEmpty(attribute.getName()) && attribute.getValue() != null) { if (StringUtils.isNotEmpty(attribute.getNamespace())) { if (StringUtils.isNotEmpty(attribute.getNamespacePrefix())) { if (namespaceMap.containsKey(attribute.getNamespacePrefix()) == false || namespaceMap.get(attribute.getNamespacePrefix()).equals(attribute.getNamespace()) == false) { xtw.writeNamespace(attribute.getNamespacePrefix(), attribute.getNamespace()); namespaceMap.put(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue()); } else { xtw.writeAttribute(attribute.getNamespace(), attribute.getName(), attribute.getValue());