/** * Returns the prefix associated with the specified namespace URI * * @param context contains the namespace map * @param nsURI the namespace URI * @return the prefix associated with the specified namespace URI, or * null if not set */ public static String getNSPrefix(XMLCryptoContext context, String nsURI) { if (context != null) { return context.getNamespacePrefix (nsURI, context.getDefaultNamespacePrefix()); } else { return null; } }
String dsPrefix = null; if (context != null) { prefix = context.getNamespacePrefix (WSSE, "wsse"); dsPrefix = context.getNamespacePrefix (XMLSignature.XMLNS, context.getDefaultNamespacePrefix());