I\'m working in Java with XML and I\'m wondering; what\'s the difference between an element and a node?
An xml document is made of nested elements. An element begins at its opening tag and ends at its closing tag. You're probably seen and in html. Everything between the opening and closing tags is the element's content. If an element is defined by a self-closing tag (eg. ) then its content is empty.
Opening tags can also specify attributes, eg. . In this example the attribute name is 'class' and its value 'rant'.
The XML language has no such thing as a 'node'. Read the spec, the word doesn't occur.
Some people use the word 'node' informally to mean element, which is confusing because some parsers also give the word a technical meaning (identifying 'text nodes' and 'element nodes'). The exact meaning depends on the parser, so the word is ill-defined unless you state what parser you are using. If you mean element, say 'element'.