| 834 | |
| 835 | |
| 836 | void XMLWriter::addAttributes(AttributeMap& attributeMap, const Attributes& attributes, const XMLString& elementNamespaceURI) |
| 837 | { |
| 838 | for (int i = 0; i < attributes.getLength(); i++) |
| 839 | { |
| 840 | XMLString namespaceURI = attributes.getURI(i); |
| 841 | XMLString localName = attributes.getLocalName(i); |
| 842 | XMLString qname = attributes.getQName(i); |
| 843 | if (!localName.empty()) |
| 844 | { |
| 845 | XMLString prefix; |
| 846 | if (!namespaceURI.empty()) |
| 847 | prefix = _namespaces.getPrefix(namespaceURI); |
| 848 | if (!prefix.empty()) |
| 849 | { |
| 850 | qname = prefix; |
| 851 | qname.append(toXMLString(MARKUP_COLON)); |
| 852 | } |
| 853 | else qname.clear(); |
| 854 | qname.append(localName); |
| 855 | } |
| 856 | attributeMap[qname] = attributes.getValue(i); |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | |
| 861 | void XMLWriter::addAttributes(CanonicalAttributeMap& attributeMap, const Attributes& attributes, const XMLString& elementNamespaceURI) |