using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using r13.Engines;
using System.Xml.Linq;

namespace r13.Controllers
{
    public class BooksController : Controller
    {
        public ViewResult Index()
        {
            ViewResult result = View(GetBooks());
            result.ViewEngineCollection = new ViewEngineCollection { 
            new XSLTViewEngine() 
        };
            return result;
        }

        private XDocument GetBooks()
        {
            return XDocument.Parse(@" 
          <Books> 
             <Book title='Jak zdenerwować delfiny' author='B. Swimmer'/> 
             <Book title='Jak przetrwać atak delfina' author='B. Swimmer'/> 
          </Books> 
        ");
        }
    }
}
