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 O’Reilly online learning.

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