Using XML and XSLT to Personalize a Web Site Part 4: Dynamic Style Sheets and User Customized Layout
Like this article? We recommend
New Content
To accomplish this feat, we've made some changes to both the content and the style sheets. The changes to content.xml are easy: we've simply added new content, which is shown in bold.
... <teaser> <person>Merridith Garett</person>, star of the fur and feather epic <movie>Misterra, Jungle Princess</movie>, is getting married next month to long time boyfriend <person>Keith Wild</person>. They plan to settle down for a while and are looking for a show they can do together. </teaser> </gossip> <weather> <location city="Saskatoon, Canada"> <temperature>6</temperature> <clouds>Cloudy</clouds> </location> <location city="Tampa, FL"> <temperature>65</temperature> <clouds>Clear</clouds> </location> <location city="Atlanta, GA"> <temperature>39</temperature> <clouds>Partly Cloudy</clouds> </location> <location city="London, England"> <temperature>30</temperature> <clouds>Clear</clouds> </location> <location city="Dublin, Ireland"> <temperature>35</temperature> <clouds>Scattered showers</clouds> </location> <location city="Paris, France"> <temperature>28</temperature> <clouds>Clear</clouds> </location> </weather> <schedules> <show> <tvshow>Dark Heroes</tvshow> <tvtitle>In the Dark</tvtitle> <tvtime>8:00pm EST</tvtime> <tvnetwork>HOB</tvnetwork> </show> <show> <tvshow>Millenium Mysteries</tvshow> <tvtitle>In the Heat of the Millenium</tvtitle> <tvtime>9:00pm EST</tvtime> <tvnetwork>ACB</tvnetwork> </show> <show> <tvshow>Mission to Destiny</tvshow> <tvtitle>Pilot</tvtitle> <tvtime>9:00pm EST</tvtime> <tvnetwork>BCS</tvnetwork> </show> <show> <tvshow>Journey to Jeopardy</tvshow> <tvtitle>The Long Walk</tvtitle> <tvtime>10:00pm EST</tvtime> <tvnetwork>NBS</tvnetwork> </show> </schedules> </content>
We'll add the new content to the page by adding templates to the style sheet.