All Model Groups You can also define an element within an all model group, which defines an unordered list of elements, all of which can appear in any order, but each element may be present at most once.

Listing 2-5. getTagName(); If the root element has attributes, retrieve the attributes in the root element. The hasAttributes() method tests whether an element has attributes, and the getAttributes() method retrieves the attributes, as shown in Listing 2-6. Listing 2-6. getAttributes(); } The getAttributes() method returns a NamedNodeMap of attributes. The NamedNodeMap method getNodeLength() returns the attribute list length, and the attributes in the attribute list are retrieved with the item(int) method.

Download PDF sample

Rated 4.89 of 5 – based on 9 votes