Element extensions

The Element interface retains the original methods:

					String   getTagName();
					NodeList getElementsByTagName( String name );
					void     normalize();
					String   getAttribute( String name );
					void     setAttribute( String name, String value )
					throws DOMException;
					void     removeAttribute( String name )
					throws DOMException;
					Attr     getAttributeNode( String name );
					void     setAttributeNode( Attr newAttr )
					throws DOMException;
					void     removeAttributeNode( Attr OldAttr )
					throws DOMException;

A number of new methods have been added to handle namespaces, and one other has been added to discover if a particular attribute is present:

 boolean hasAttribute(String name); boolean hasAttributeNS(String namespaceURI, String localName); String getAttributeNS(String namespaceURI, ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.