Here you can find the source of processAnyAttributes(Element element, Map
Parameter | Description |
---|---|
element | the element where to add the attributes. |
anyAttributes | the any attributes to process. |
public static void processAnyAttributes(Element element, Map<QName, String> anyAttributes)
//package com.java2s; /*/* w w w. j av a2 s . c o m*/ * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ import java.util.*; import javax.xml.namespace.*; import org.w3c.dom.*; public class Main { /** * Processes any attributes and add them into the element. * * @param element the element where to add the attributes. * @param anyAttributes the any attributes to process. */ public static void processAnyAttributes(Element element, Map<QName, String> anyAttributes) { for (Map.Entry<QName, String> attribute : anyAttributes.entrySet()) { String localName = attribute.getKey().getLocalPart(); String prefix = attribute.getKey().getPrefix(); String namespace = attribute.getKey().getNamespaceURI(); element.setAttributeNS(namespace, prefix + ":" + localName, attribute.getValue()); } } }