Here you can find the source of getDeclaredNamespaces(SOAPElement aElement, Map aPrefixMap)
Parameter | Description |
---|---|
aElement | element |
aPrefixMap | map of prefixes to namespaces |
public static void getDeclaredNamespaces(SOAPElement aElement, Map aPrefixMap)
//package com.java2s; import java.util.Iterator; import java.util.Map; import javax.xml.soap.SOAPElement; public class Main { /**// w w w .ja va2 s.c o m * Finds all the namespaces and prefixes in effect for a SOAPElement * using SAAJ interface methods * * @param aElement element * @param aPrefixMap map of prefixes to namespaces */ public static void getDeclaredNamespaces(SOAPElement aElement, Map aPrefixMap) { for (SOAPElement element = aElement; element != null; element = element.getParentElement()) { for (Iterator it = element.getNamespacePrefixes(); it.hasNext();) { String prefix = (String) it.next(); String ns = element.getNamespaceURI(prefix); if (!aPrefixMap.containsKey(prefix)) { aPrefixMap.put(prefix, ns); } } } } }