import javax.xml.XMLConstants;
import org.w3c.dom.Element;
public class Utils {
/**
* Add a namespace prefix definition to an element.
*
* @param element
* @param namespaceUri
* @param prefix
*/
public static void addNamespacePrefix(Element element, String namespaceUri, String prefix) {
element.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:" + prefix, namespaceUri);
}
}
sources68 the directory containing the programming examples, source code and programming guide online
Monday, 1 August 2011
Add a namespace prefix definition to an element.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment