Create a key named agentid that matches the agent element

Assignment Help Web Project
Reference no: EM131541200

XML Authoring Assignment

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 ?le, and save them as homes.xml and homes.xsl , respectively.

2. Go to the homes.xml ?le 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 ?le in your editor, and review the content of the style sheet and the different templates it contains. At the top of the ?le, 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 ?rmID that matches the ?rm element, using values of the ?rmNum 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:

<a href="#id">style</a> (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 </section> 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, add

a. Sort the output by values of the style element.
b. For each unique housing style, write the following code to the result document:
<h2 id="id">style</h2>

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 ?rm 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 ?rm in the result document:

a. Declare a variable named fID , containing the value of the ?rm attribute
b. 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 ?rm contact information:

name <br /> street <br /> city, state &#160; zip <br />
phone <br /> 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: name
name <br />
phone <br />

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 ?rm data are correctly retrieved from the agencies.xml file.

Attachment:- Attachments.rar

Reference no: EM131541200

Questions Cloud

List first and last names of all full time faculty members : List only first and last names of all full time faculty members who are teaching more than 2 courses and the total enrollment for those courses.
In what ways does the dayton vineyard meet the mission : Based on what you witnessed and experienced, in what ways does the Dayton Vineyard meet the Mission of the Church?
Inequity and poverty : An analysis of the impact that government policies addressing income inequity and poverty could have on labor demand or supply.
What steps should dr romaro take to ethically implement : Complete attachment. Respond to the following questions in 1,250 to 1,500 words. Respond with three or more scholarly references.
Create a key named agentid that matches the agent element : Create a key named agentID that matches the agent element, using values of the agentNum attribute to generate the key index.
Why does smith believe that self -love is a good thing : Is discrimination based on gender. race, ethnicity. and sexual orientation also facial discrimination?
Significant amount of knowledge about : For this discussion, think about where you work or a business you have a significant amount of knowledge about.
What are environmental factors in the context of marketing : What are environmental factors in the context of marketing, and why do we marketers want to observe them
Most cost efficient company : Over the years, GE(General Electrics) was respected as one of the most admired company in America under the leadership by Mr. Jack Welch.

Reviews

Write a Review

Web Project Questions & Answers

  Evaluating an ecommerce website

Create a check list that contains key point for evaluating an ecommerce website - Write a short, reflective report about website

  Gpc and runtime magic quotes

Create a script that lets you know whether Zeus or Helios has the GPC and Runtime Magic Quotes turned on or off. The output should have appropriate labels that define what output signified and should display 'ON' or 'OFF' depending on the setting.

  Creating functions through conditional operator

Use the conditional operator and the cal_days_in_month function, determine the number of days in the current month and output to browser whether it is normal month or a leap month.

  Web development projects with database

Since the vast majority of web-development projects involve a database, do you think that computational activities should be performed there, or do you think they belong in the XML page or stylesheet?

  Comparing shelf software packages

Required assistance with comparing and contrasting two main off the shelf software packages that could be implemented in an organization.

  Web based scams

Web phishing, pharming and vishing are popular web based scams. Talk about currently used tools and recommended measures to defeat this kind of attacks efficiently?

  Explanation of contextual links

The most powerful hypertext capabilities is the the contextual link. Wikipedia . com is a great example of a site that utilizes contextual links.

  How architectural and protocol changes occur

Discuss how architectural and protocol changes happen, the administrative organization that oversees the technical development of the Internet,

  Traditional approaches for training professionals

Webinars and other web conferencing techniques have proved most beneficial for the provision of affordable quality corporate training.

  Internet for business

Discuss how can a business use the Internet and give at least three examples with web links demonstrating your answer.

  It influences the behavior of organizations

Information technology influences the behavior of organizations. Name one effect of Information technology implementation and long-term usage you suppose having a positive contribution and one having a negative consequence.

  Importance of a guided navigation system

Explain the use and importance of a guided navigation system and shopping cart for a website designed for e-commerce and business purpose.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd