<?xml version="1.0" encoding="UTF-8"?>
<answers>
    <name>
        <line>Name: Jeffry Hartono</line>
        <line>Class/Project: CSCIE-259/Project2</line>
        <line>Due Date: November 15, 2007</line>
        <line>Address: 5029 Sheboygan Ave #115, Madison WI 53705</line>
    </name>
    <answer number="1">
        <part name="A">
            <line>/students/student/name/last/text()[substring(., 1, 1) = 'B']/../../..</line>
        </part>
        <part name="B">
            <line>/students/student[substring(name/last, 1, 1) = 'B' and GPA >= 3.7]</line>
        </part>
    </answer>
    <answer number="2">
        <part name="A">
            <line>2 nodes (students, student[@id = 55])</line>
        </part>
        <part name="B">
            <line>5 nodes (student[@id = 1], student[@id = 1]/name, student[@id = 1]/name/first, student[@id = 1]/name/last, student[@id = 1]/GPA)</line>
        </part>
        <part name="C">
            <line>/preceding::*[4]</line>
            <line>or /preceding::*[position() = 4]</line>
        </part>
        <part name="D">
            <line>following::* --> 1 node (student[@id = 55]/GPA)</line>
            <line>
                following::node() --> 5 nodes (text() - between the closing tag of name element and the open tag of GPA element, student[@id = 55]/GPA, 
                student[@id = 55]/GPA/text() - 3.8, text() - between the closing tag of GPA element and the closing tag of student[@id = 55] element, 
                text() - between the the closing tag of student[@id = 55] element and students element).
            </line>
            <line>
                The fundamental difference between the two expressions is that node() will match/return any kind of node [text node, comment node, 
                processing-instruction node, element/regular node]; while * will only match/return element/regular node only.
            </line>
        </part>
        <part name="E">
            <line>/students//name[last = 'Bond']/../@id</line>
        </part>
    </answer>
</answers>
