XML and XLST

The strength of XSLT lies in its ability to manipulate data, sorting and filtering it in much the same way as SQL does with a database.

There are two ways of using XSLT: client-side and server-side. In this exercise you create a page that does both.

With client-side XSLT, you create an XSL page and link it to the XML document just like linking a CSS style sheet to an ordinary web page. With client-side XSLT the XSL and XML documents must both reside in the same folder on the web server. So, if you want to display the contents of a news feed from another site, you must first download the XML feed and store it locally. To get round these problems, you can use PHP to process the XSLT on the server. This converts the XML into XHTML before it’s sent from the server, providing your visitors with exactly the same page regardless of which browser they’re using.

With server-side transformation, you can pull the XML feed from any publicly available source on the Internet. Dreamweaver automatically builds the XSL page for you. All you need to do is embed the XSL fragment in a PHP page.

Pulling in an RSS news feed

(pp.811-824)

Cornell, Missouri, Ga. Tech Extend NCAA Upset Trend

The NCAA men's basketball tournament featured more surprises as first-round play continued Friday. Cornell, Missouri and Georgia Tech were all underdog winners.

Judge Says Ground Zero Settlement Is 'Not Enough'

U.S. District Judge Alvin Hellerstein ripped into the $657 million deal to compensate workers sickened by ash and dust from the collapsed World Trade Center. He said the figure was too low and workers did not have enough time to decide whether to accept the deal. "I will not preside over a settlement that is based on fear or ignorance," he said.

Announcer Scully Leaves Hospital, Dodgers Say

Dodgers Hall of Fame announcer Vin Scully was released from a hospital Friday after a night of observation following a fall and a bumped on the head. Scully, 82, issued a statement thanking people for their thoughts and prayers and apologizing for any concerns he caused.

Cartoon Furor Met With Muted Response In Sweden

Swedish artist Lars Vilks has lived with a $100,000 bounty on his head since 2007 for a drawing he made depicting the Prophet Muhammad. But unlike the angry protest that erupted in 2005 after similar cartoons were published in Denmark, Swedes have remained largely silent on the controversy.

Haiti Quake 'Orphans' Reunited With Parents

All of the 33 children that U.S. missionaries tried to take out of Haiti after the deadly January earthquake have been returned to their parents. But at least one mother says that she would consider giving up her children for a better life elsewhere than subject them to the desperate living conditions in Haiti.

ABC News Under Fire For Payment To Murder Suspect

The attorney for Casey Anthony, who is accused of killing her daughter, told a court Thursday that ABC News had paid Anthony $200,000 for exclusive rights to reproduce family photos and a video. Several journalists said ABC's failure to tell viewers of the payment for the pictures was an ethical lapse.


Using XSLT Parameters to Filter Data

Complete the exercises on pp.837-41 then create your own xml file to display data similar to the content below

Choose a photo size from the menu

Title Image Photo Size Price
Charlie Brown Peanuts thumb 8 x 10 print $9.95
Charlie Brown Golfer thumb 8 x 10 print $9.95
Charlie Brown Astronomer thumb 8 x 10 print $9.95