equal
deleted
inserted
replaced
36 import javax.xml.crypto.*; |
36 import javax.xml.crypto.*; |
37 import javax.xml.crypto.dsig.dom.DOMSignContext; |
37 import javax.xml.crypto.dsig.dom.DOMSignContext; |
38 import javax.xml.crypto.dsig.*; |
38 import javax.xml.crypto.dsig.*; |
39 import javax.xml.crypto.dsig.spec.*; |
39 import javax.xml.crypto.dsig.spec.*; |
40 |
40 |
41 import com.sun.org.apache.xml.internal.security.utils.IdResolver; |
|
42 |
|
43 /** |
41 /** |
44 * Useful static DOM utility methods. |
42 * Useful static DOM utility methods. |
45 * |
43 * |
46 * @author Sean Mullan |
44 * @author Sean Mullan |
47 */ |
45 */ |
105 * @param value the attribute value. If null, no attribute is set. |
103 * @param value the attribute value. If null, no attribute is set. |
106 */ |
104 */ |
107 public static void setAttributeID(Element elem, String name, String value) { |
105 public static void setAttributeID(Element elem, String name, String value) { |
108 if (value == null) return; |
106 if (value == null) return; |
109 elem.setAttributeNS(null, name, value); |
107 elem.setAttributeNS(null, name, value); |
110 IdResolver.registerElementById(elem, value); |
108 elem.setIdAttributeNS(null, name, true); |
111 } |
109 } |
112 |
110 |
113 /** |
111 /** |
114 * Returns the first child element of the specified node, or null if there |
112 * Returns the first child element of the specified node, or null if there |
115 * is no such element. |
113 * is no such element. |