XML Authoring Assignment #7

Description


Lisa asks you to design another style sheet for her. Many of her clients are not looking for a house in a particular geographic area as much as they are looking for one of a particular style. She wants you to create a new style sheet based on her property data that groups the property report by housing style. She has already created the style sheet for the property report, but she needs your help in grouping the properties. The property report should also contain information on the real estate agencies and agents handling the properties. Since working on her last project, Lisa has placed all of this information within a single file.You have to extract information from this second source document to complete the report.  1. Using your editor, open homestxt.xml and homestxt.xsl files. Enter your name and the date in the comment section of each file, and save them as homes.xml and homes.xsl , respectively. 2. Go to the homes.xml file in your editor. Add a processing instruction after the comment section that attaches the homes.xsl style sheet to the document. Close the file, saving your changes. 3. Go to the homes.xsl file in your editor, and review the content of the style sheet and the different templates it contains. At the top of the file, directly below the opening tag, do the following: a. Create a variable named agencies that selects the agencies.xml file. b. Create a key named agentID that matches the agent element, using values of the agentNum attribute to generate the key index. c. Create a key named firmID that matches the firm element, using values of the firmNum attribute to generate the key index. d. Create a key named houseStyles that matches the property element, using values of the style element to generate the key index. 4. At the bottom of the style sheet, insert a template with a mode value of styleList that matches the property element. The purpose of this template is to create a list of the different housing styles associated with the properties in the style.xml document. Have the template write the following code: style (count) | where id is an ID value generated automatically by the XSLT processor using the generate-id() function, style is the value of the style element, and count is the number of properties that contain that style. ( Hint : Use the key() function and the houseStyles key to retrieve the node set of properties belonging to a particular style, and use the count() function to calculate the number of properties in that node set.) 5. Go to the root template. Within the style_list section after the | character, apply a template of the styleList mode to the step pattern: “listings/property[not(style=preceding::property/style)]” in order to display a list of unique housing styles. Sort the application of the template by order of the style element.  6 Directly below the closing tag in the root template, insert a for-each element using the Muenchian grouping with the location path “//property[generate-id()=generate-id(key(‘houseStyles’, style)[1])]” for the select attribute in order to select each housing style. Within the for-each element, adda. Sort the output by values of the style element.b. For each unique housing style, write the following code to the result document:

style

 where id is an ID value generated automatically by the XSLT processor using the generate-id() function and style is the value of the style element.c. Apply a template for each property belonging to the selected housing style. ( Hint : Use the key() function with the houseStyles key and the value of the style element.) Sort the applied template by the sqfeet element in descending order. 7. Go to the property template. The purpose of this template is to write the HTML code for a web table describing each property. Most of the contents of the table have already been created for you. Your task is to insert the firm and agent data into the table in the appropriate cells. Within the table cell following the comment “Place information about the firm here”, add the following styles to display information about the listing firm in the result document:a. Declare a variable named fID , containing the value of the firm attributeb. Insert a for-each element, selecting the value of the agencies variable to change the context node to the agencies.xml file.c. Within the for-each element, write the following firm contact information:  name
street
city, state   zip
 phone
web where name , street , city , state , zip , phone , and web are the values of the name, street, city, state, zip, phone, and web elements for the selected firm in the agencies.xml file. ( Hint : Use the key() function with the firmID key and the value of the fID variable to select the appropriate firm element from the agencies.xml file.) 8. Scroll down the web table and, within the table cell directly after the comment “Place information about the agent here”, add the following styles:a. Declare a variable named aID , selecting the value of the agent attribute.b. Insert a for-each element, selecting the value of the agencies variable in order to change the context node to the agencies.xml file.  Within the for-each element, write the following code to the result document: namename
phone
email    where name , phone , and email are the values of the name, phone, and email elements for the selected agent in the agencies.xml file. 9. Save your changes to the homes.xsl file. 10. Use your web browser or your XSLT processor to generate the result document. Verify that the property report displays each property grouped by housing style, that the list of housing styles includes a count of the number of each property within each style, that links within the style list jump the browser to the appropriate style section in the report, and that the agent and firm data are correctly retrieved from the agencies.xml file.   homestxt.xml          2638 Maple Avenue      Padua      WI      53701      229000            2328      2 1/2      4      2 car, attached      22      Very nice home on a one block dead end street with woods nearby.       Very special location for quiet and privacy! Home features open floor plan with       large rooms - new patio doors to pretty yard. updates: shingles, vinyl siding,       refrig and dishwasher, garage door. Fireplace in family room flanked by great       built-ins. add first floor laundry and award winning Padua schools.                   3014 Allen Lane      Broxton      WI      53987      314200            2752      2 1/2      4      3 car, attached      15      Surround fireplace. Quality thru-out! Call lister for completion       date. Wow! Expect to be impressed with this new 4-bdrm transitional home! All       the upgrades for the distinguished buyer. Large entertaining kitchen w/corian counters,       birch cabinets, maple flr and trim, lg work island. Pella windows everywhere. 200amp,       ge profile appliances, whirlpool bath, kohler plumbing, trayed master,       exposed ll w/8ft9in ceilings. 15-yr waterproof warrty, tile surround fireplace.       Quality thru-out! Call lister for completion date.                   505 Brandit Road      Cutler      WI      55709      305200            2900      2      4      2 car, attached      17      A picture perfect home in a fantastic location. 4 bedrooms, formal       dining and living room, a family room with wood burning fireplace and a lower level       rec room. Close to Padua and Argyle with 1.67 acres of breathing space. Wood       floors throughout, tile entry, 6 panel doors, 2 car garage and a home warranty so you       can buy with confidence!                   77 East Creek Road      Argyle      WI      56981      290000            3169      2      4      3 or more car, attached      14      Quality built 2-Story on wooded lot adjacent to park. Large entry with       tile flr. Formal lr and dr w/chair rail and crown molding. Eat-in kitchen with breakfast       bar and patio door that opens to a lrg deck. Fam rm w/built-in bookcases and woodburning       fp. 4 bdrms on 2nd flr. Master w/walk-in closet and 3/4 bath. Fin ll has rec rm and       office/exercise rm. Lots of space in the unfinished lower level. 3 car tandem garage.       Home warranty included.                      41 Mohawk Street      Stratmore      WI      58105      241900            1710      2      3      2 car, attached      12      Spectacular new ranch w/ extra deep yard! Vaulted great room has gas frplc.       Spacious kitch w/pantry and brkfst bar. 1st flr laundry rm, walk-in closet and double       vanity bath in master. Br 3 set up as a study w/french doors walkout ll w/over       1200 sq ft for future finish! 14'x10' deck. Landscaping. Also an air-air exchanger for       a healthier home w/hepa filter, 20 yr warranty tuff n dri water proofing, too! 6 panel       doors, oak trim. Ready for move in!                     88 Atkins Avenue      Padua      WI      53704      305200            2800      2      4      3 car, attached      New      Expect to be impressed with this stunning ranch home situated on wooded       lot backing to city bike trail. Home features include maple flrs, painted trim, spacious       kitchen with 2 pantries and island with breakfast bar, huge great room with gorgeous view.       Tray clg in dining, large master wp suite with tray ceiling, 10x18 deck, 12x12 patio, walkout       ll, prof landscaping, air exchanger for healthier home and so much more!!                   3810 Stamford Lane      Oseola      WI      53414      315400            2751      2 1/2      4      3 or more car, attached      2      Stunning custom built 2-Story 4 br home features 1st floor large master suite       w/wic, dual vanitites, whirlpool tub and separate shower. Large great rm w/gas fp, formal dr/lr.       Large kitchen w/center island, planning desk, and dinette. Hardwood flrs cover 2-Story foyer,       dinette, kitchen and powder rm. Cathedral ceiling highlights open flr plan. Maple cabinets,       solid oak trim throughout. Job relo-highly motivated seller. All measurements approx.                   57 East Raulston Lane      Fenmore      WI      56729      329900            2770      2 1/2      4      3 car, attached      8      Wonderful 2-Story colonial in super area. Homestead builder quality with       custom cabinetry, oak trim, 6 panel doors, crown molding, elegant 2-Story foyer.       4 season sunroom overlooks huge backyard. Walkin closets.2 stairways to partially       finished basement with lots of storage/expansion area. Nicely decorated and landscaped.       Master bath with whirlpool! Fireplace in sunken family room. Huge       kitchen with island and desk. Nice! Call seller direct and save!                     14 Haywood Street      Cutler      WI      55710      319500            2565      2 1/2      4      3 car, attached      New      New 2-Story by Eton homes 4 bedroom, 9' ceilings 1st floor wood       floors kitchen and foyer, formal dining room, 1st floor study and laundy room, exposed       lower level w/ 8' 6' ceilings. Large landscaped yard, 3 car tandom garage.                    515 Lawrence Avenue      Padua      WI      53706      274500            2100      2 1/2      4      2 car, attached      New      Spacious 4 bedroom 2-Story home featuring 9' ceilings first floor,       wood floors kitchen and foyer, great room with gas fireplace, large kitchen with       dinette, first floor laundry room, exposed lower level with 8'6 ceilings for future       living area, 2 car tandem garage.                   9 Alston Court      Cutler      WI      55712      361500            3360      3      4      3 or more car, attached      9      Great curb appeal in this 9 yr old transitional w/2-Story entry,       tile flr. Formal lr and dr w/12' ceilings. Beautiful oak cabinetry w/center island,       wet bar and dinette. Patio door opens to cobblestone patio. Fr w/gas fp. 2nd flr w/3       bdrms. Double french doors leads to master suite w/walk-in shower, soaking tub and walk-in       closet. Finished ll w/perfect in-law suite. Nicely landscaped yard w/inground       sprinkler system.                   3211 Stamford Lane      Oseola      WI      53414      285200            2911      2 1/2      3      2 car, attached      7      Expect a beautiful surprise when you walk into this contemporary home.       The 3 bdrm, 2 1/2 bath home is filled with personality. Home offers formal dining,       office, rec room, seperate master suite, mst ba has whrlpool tub. The sunroom (14x19)       opens up to the fenced-in back yard which is a national hemerocallis garden. Location       is unbeatable, backyard is next to preschool park and schools are minutes away. Slr will       be removing some plants.           homestxt.xsl                                      Real Estate Listings                                          
               
                  Bowline Realty               
                

New Listings

               
               |               
              
                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                           Listing #Real Estate Agency
Price            
Address               
               ,                            
Style
Age
Sq. FeetAgent
Baths            
Bedrooms
Garage
   
 
  agencies.xml          Acer Realty      400 Hawthorne Avenue      Longmont      CO      80504      (303) 555-9092      http://www.example.com/acerrealty                           Gary Ubersetzing            (303) 555-9091            gary_uber@example.com/acerrealty                              Kari Lawrence            (970) 555-8799            Kari_lawrence@example.com/acerrealty                              Patty Becker            (303) 555-0933            patty_becker@example.com/acerrealty                           Toffer Realty      311 Allen Court      Berthoud      CO      80513      (970) 555-5081      http://www.example.com/tofferrealty                           Karen Fawkes            (303) 555-3414            karen_fawkes@example.com/tofferrealty                              Peter Grumwald            (970) 555-3419            peter_grumwald@example.com/tofferrealty                           Carson Homes      981 Frontage Road      Longmont      CO      80503      (303) 555-0912      http://www.example.com/carsonhomes                           Linda DeJesus            (970) 555-4140            ldejesus@example.com/carsonhomes                              Ian Oppelganger            (303) 555-5439            idoppelganger@example.com/carsonhomes                              Cynthia Cho            (970) 555-5432            ckcho@example.com/carsonhomes                           The Rawlings Company      678 Grimble Street      Lyons      CO      80540      (970) 555-6780      http://www.example.com/rawlingscompany                           Lawrence Rao            (970) 555-8580            lkrao@example.com/rawlingscompany                              Allan Lee            (303) 555-8900            adlee@example.com/rawlingscompany                           Premier Realty      87 Crawford Court      Fort Lupton      CO      80622      (303) 555-8915      http://www.example.com/premierrealty                           Michael Menschen            (303) 555-8918            mkmenschen@example.com/premierrealty                     homestyle.css/*   New Perspectives on XML, 3rd Edition   Tutorial 7   Review Assignment    Bowline Realty style sheet      Filename:         homestyles.css   Supporting Files: none */ /* Default styles */ * {   margin: 0px;} header, section, article {   display: block;}   /* Body styles */body {   font-family: Verdana, Geneva, sans-serif;   background-color: #e3dbaf;} div#wrap {   background-color: white;   margin: 0px auto;   width: 1200px;   border-left: 2px solid rgb(151, 151, 151);   border-right: 2px solid rgb(151, 151, 151);    box-shadow: rgb(51, 51, 51) 10px 0px 30px,               rgb(51, 51, 51) -10px 0px 30px;   padding-bottom: 50px;}  div#wrap >  h1 {   font-size: 2.5em;   letter-spacing: 0.12em;   font-weight: normal;   color: #6bd51b;   text-shadow: black 1px 1px 1px;   padding: 15px 0px;     font-family: 'Century Gothic', sans-serif;   text-align: left;   margin-left: 100px;} #style_list {   margin: 0px auto;   width: 80%;   text-align: center;   background-color: #e3dbaf;   vertical-align: bottom;   padding-top: 20px;   padding-bottom: 20px;   border-top: 3px solid #b9ac55;   border-bottom: 3px solid #b9ac55;   font-size: 0.8em;} #style_list a {   color: rgb(51, 51, 51);} div#wrap > h2 {   margin: 25px 0px 5px 100px;   font-weight: normal;   font-size: 1.9em;   letter-spacing: 0.08em;   font-family: 'Century Gothic', sans-serif;   text-align: left;} table.head {   border-collapse: collapse;   margin: 5px 170px 30px 170px;   border: 2px solid #c3b451;} table.head th {   font-size: 0.8em;   text-align: left;   background-color: #b4ef87;   border: 1px solid rgb(91, 91, 91);   font-weight: normal;   vertical-align: top;   padding: 3px;   width: 100px;} table.head td {   font-size: 0.8em;   text-align: left;   vertical-align: top;   border: 1px solid rgb(91, 91, 91);   padding: 3px;   width: 300px;} table.head td.description {   font-family: 'Courier New', monospace;   padding: 20px;   background-color: rgb(231, 231, 231); } 

Question

XML Authoring Assignment #7

  • Written in: 17-Oct-2019
  • Paper ID: 82668283
Price: $ 40
 

Use the Order Now button below to Place a New Order for an Original, High-Quality Paper that passes all Plagiarism Checkers

Order Now




About this Question

STATUS

DATE ANSWERED

Oct 17, 2019

EXPERT

N/A

ANSWER RATING

Need Help with an Assignment?

Get Help with an Assignment

SSL Certificate website security