• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Workshop

The quiz questions are designed to test your knowledge of the material covered in this hour. The answers to the questions follow.

Quiz

1:How many nodes are shown in Figure 19.1?
A1: Five. There are three elements and two text nodes for a total of five nodes.
2:Name the nodes in the XML document <test>Hello World!</test>.
A2: There is the test node and the text node under it containing “Hello World!”.
3:What two steps need to be done to insert a new node into an XML document?
A3: You need to first use createElement or createTextNode to make the node and then use appendChild or, alternatively, insertBefore, to put the node in the XML object.
4:How would you get to the text “Hello World” in the document <test>Hello World!</test>?
A4: The text is the nodeValue of the first child of the first child. So you could do this: myXML.childNodes[0].childNodes[0].nodeValue.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint