O'Reilly logo

Beginning XML, 4th Edition by Andrew Watt, David Hunter, Linda McKinnon, Joe Fawcett, Eric van der Vlist, Jon Duckett, Danny Ayers, Jeff Rafter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 22. Case Study: Payment Calculator — Ruby on Rails

Throughout this book, you have learned how XML can be used to construct and validate documents and how it is used for communications between systems. You have also learned how to use several important XML display formats. Sometimes it can be difficult seeing how all of these technologies fit together without a real-world business case. This case study demonstrates how you can build an online home loan calculator using a public web service, a Ruby on Rails web application, JavaScript, and several of the XML technologies you have learned.

In this chapter, you will:

  • Create a Ruby on Rails application.

  • Create a web page to enter loan information.

  • Call a web service to calculate the payments using SOAP.

  • Display the results using Ajax (Asynchronous JavaScript and XML) and SVG.

Mortgage Calculations

Mortgages are commonly used throughout the world when purchasing a home or land. The word "mortgage" comes from French and literally means "death pledge." Before making such a pledge, the consumer often wants to see what the proposed payments for the loan would be. The payments may generally include interest and a principal reduction component, depending on various laws or religious guidelines.

In the most common mortgages, the schedule of payments (based on a repayment agreement or Note) must be determined before the annual percentage rate (APR) can be calculated. The amount of interest and principal paid in each payment is based on the loan ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required