Question
Book: New Perspectives on XML Comprehensive 3rd Edition Chapter 4 http://example.com/primalsnacks/?cat=6 http://example.com/primalsnacks/?cat=18 2017-09-19T17:13:19+00:00 http://example.com/primalsnacks/?cat=54 2017-09-19T15:24:01+00:00 http://example.com/primalsnacks/?cat=52 2017-09-28T21:03:11+00:00 http://example.com/primalsnacks/?cat=201 2017-10-06T07:03:26+00:00 http://example.com/primalsnacks/?cat=11 ---------------------- http://example.com/vegsnacks/?cat=102 http://example.com/vegsnacks/?cat=23 http://example.com/vegsnacks/?cat=1 http://example.com/vegsnacks/?cat=55
Book: New Perspectives on XML Comprehensive 3rd Edition
Chapter 4
----------------------
----------------------------
------------------------------
---------------------------
Case Problem 1 Data Files needed for this Case Problem: sitemapPS.xml, sitemapVS.xml, sitemapWFS.xml, a sitestxt.xml, sitestxt.xsd Weekend Fun Snacks Cleo Coal created and maintains a website called Weekend Fun Snacks, which lists her picks of the best and easiest recipes for kids to cook. The site's popularity convinced her there was room for more specialty recipe sites, so she created two additional websites-Primal Snacks, which features snacks appropriate for a paleo or primal diet, and Veg Snacks, which includes quick bites suitable for vegetarians. Cleo also created a Sitemaps file for each site, which is a document written in XML that provides basic information about each page in a website, as well as how all the pages are related. submitted her Sitemaps files to Google and other search services to help them better index her sites. However, she also thinks that the Sitemaps content she's created would be useful in a compound document with a custom vocabulary, which would allow her to view information about all the pages on all of her sites in a single page. Cleo has Cleo asks for your help with creating this compound document. XML 242 XML Tutorial 4 Working with Advanced Schemas Figure 4-30 shows a tree diagram highlighting some of the elements from both vocabularies that you'll place in the document. Figure 4-30 diagrams of Sitemaps and sites vocabularies ree Sitemaps vocabulary sites vocabulary urlset sites url site loc lastmod changefreq priority name totalPages Cleo has provided you with a truncated version of the Sitemaps file for each of her three websites as well as another XML file containing the administrative information on her sites. Your job will be to create a compound document combining the features of the two vocabularies. Complete the following 1. In your XML editor, open the sitestxt.xml and sitestxt.xsd files from the xml04case1 folder, enter your name and today's date in the comment section of each file, and then save the files as sites.xml and sites.xsd, respectively, in the same folder 2. In the sites.xml file, add a namespace declaration to the root sites element, associating the xs prefix with the URI for the XML Schema namespace. Specify the default namespace http://example.com/weekendfunsnacks/sites for the file. Specify sites.xsd as the location of the schema for the default namespace 3. In your XML editor, open the sitemapPS.xml, sitemapVS.xml, and sitemapWFS.xml files from the xml04 case1 folder. These files contain the Sitemaps for Cleo's three websites. In the sitemapWFS.xml file, copy the contents from the opening curlset> tag through the closing tag to the Clipboard, and then paste them into the sites.xml file just before the closing tag for the Weekend Fun Snacks site. Repeat to copy and paste the content from the sitemapPS.xml file into the site element for the Paleo Snacks site, and the content from the sitemapVS.xml file into the site element for the Veg Snacks site. Save your changes to the sites.xml file. 4. In each of the opening curlset> tags you pasted in the previous step, remove the XML Schema namespace declaration and the schema location, leaving the default n each element. Save your work. amespace declaration for 5. In the sites.xsd file, in the root element, specify the target namespace as http://example.com/ weekendfunsnacks/sites, and then associate the prefix cc with the target namespace. Associate the prefix sm with the namespace http://www.sitemaps.org/schemas/sitemap/0.9. Specify that elements are qualified by default, and that attributes are unqualified by default. 6. Add code to import the schema for the http://www.sitemaps. http://www.sitemaps. urlset element from the http://www.sitemaps namespace from the location 0.9/sitemap xsd. 7. Immediately following the declaration of the totalPages element, add a reference to the Save your work. 8. Validate the sites.xml file, and then, if necessary, fix any validation errors. Case Problem 1 Data Files needed for this Case Problem: sitemapPS.xml, sitemapVS.xml, sitemapWFS.xml, a sitestxt.xml, sitestxt.xsd Weekend Fun Snacks Cleo Coal created and maintains a website called Weekend Fun Snacks, which lists her picks of the best and easiest recipes for kids to cook. The site's popularity convinced her there was room for more specialty recipe sites, so she created two additional websites-Primal Snacks, which features snacks appropriate for a paleo or primal diet, and Veg Snacks, which includes quick bites suitable for vegetarians. Cleo also created a Sitemaps file for each site, which is a document written in XML that provides basic information about each page in a website, as well as how all the pages are related. submitted her Sitemaps files to Google and other search services to help them better index her sites. However, she also thinks that the Sitemaps content she's created would be useful in a compound document with a custom vocabulary, which would allow her to view information about all the pages on all of her sites in a single page. Cleo has Cleo asks for your help with creating this compound document. XML 242 XML Tutorial 4 Working with Advanced Schemas Figure 4-30 shows a tree diagram highlighting some of the elements from both vocabularies that you'll place in the document. Figure 4-30 diagrams of Sitemaps and sites vocabularies ree Sitemaps vocabulary sites vocabulary urlset sites url site loc lastmod changefreq priority name totalPages Cleo has provided you with a truncated version of the Sitemaps file for each of her three websites as well as another XML file containing the administrative information on her sites. Your job will be to create a compound document combining the features of the two vocabularies. Complete the following 1. In your XML editor, open the sitestxt.xml and sitestxt.xsd files from the xml04case1 folder, enter your name and today's date in the comment section of each file, and then save the files as sites.xml and sites.xsd, respectively, in the same folder 2. In the sites.xml file, add a namespace declaration to the root sites element, associating the xs prefix with the URI for the XML Schema namespace. Specify the default namespace http://example.com/weekendfunsnacks/sites for the file. Specify sites.xsd as the location of the schema for the default namespace 3. In your XML editor, open the sitemapPS.xml, sitemapVS.xml, and sitemapWFS.xml files from the xml04 case1 folder. These files contain the Sitemaps for Cleo's three websites. In the sitemapWFS.xml file, copy the contents from the opening curlset> tag through the closing tag to the Clipboard, and then paste them into the sites.xml file just before the closing tag for the Weekend Fun Snacks site. Repeat to copy and paste the content from the sitemapPS.xml file into the site element for the Paleo Snacks site, and the content from the sitemapVS.xml file into the site element for the Veg Snacks site. Save your changes to the sites.xml file. 4. In each of the opening curlset> tags you pasted in the previous step, remove the XML Schema namespace declaration and the schema location, leaving the default n each element. Save your work. amespace declaration for 5. In the sites.xsd file, in the root element, specify the target namespace as http://example.com/ weekendfunsnacks/sites, and then associate the prefix cc with the target namespace. Associate the prefix sm with the namespace http://www.sitemaps.org/schemas/sitemap/0.9. Specify that elements are qualified by default, and that attributes are unqualified by default. 6. Add code to import the schema for the http://www.sitemaps. http://www.sitemaps. urlset element from the http://www.sitemaps namespace from the location 0.9/sitemap xsd. 7. Immediately following the declaration of the totalPages element, add a reference to the Save your work. 8. Validate the sites.xml file, and then, if necessary, fix any validation errors
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started