Subject Copy the XML file booksxml at httpwwww3schoolscomxml

Subject Copy the XML file books.xml at http://www.w3schools.com/xml/dom_nodes_set.asp and create a website named XML2 using WebMatrix. This website is made of the XML file books.xml and the HTML file default.html. In the HTML file, write JavaScript code that dynamically changes the XML DOM created on the client side from books.xml as following. Delete the and elements from the second book. Add a element to every book, with text \"Pearson\" and attribute \"academic\". The attribute can only have value \"yes\" or \"no\". A random number generator should be used to determine the attribute value of each element\'s attribute value. Print out nodeName and nodeValue properties of all first generation child nodes of first book element. Print out nodeName and nodeValue properties of all first generation child nodes of the new element of the second book element.

Solution

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<bookstore>
<book category=\"cooking\">
    <title lang=\"en\">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
<book publisher=\"pearson\">child::node()</book>

</book>
<book category=\"children\">
    <title lang=\"en\">Harry Potter</title>
    <author>J K. Rowling</author>
<book publisher=\"pearson\">child::node()</book>

  
</book>
<book category=\"web\">
    <title lang=\"en\">XQuery Kick Start</title>
    <author>James McGovern</author>
    <author>Per Bothner</author>
    <author>Kurt Cagle</author>
    <author>James Linn</author>
    <author>Vaidyanathan Nagarajan</author>
    <year>2003</year>
    <price>49.99</price>
<book publisher=\"pearson\">child::node()</book>

</book>
<book category=\"web\" cover=\"paperback\">
    <title lang=\"en\">Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
<book publisher=\"pearson\">child::node()</book>

</book>
</bookstore>

 Subject Copy the XML file books.xml at http://www.w3schools.com/xml/dom_nodes_set.asp and create a website named XML2 using WebMatrix. This website is made of

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site