XSL by Example: Creating and Populating an HTML Template




Download 2,96 Mb.
Pdf ko'rish
bet130/131
Sana14.05.2024
Hajmi2,96 Mb.
#232039
1   ...   123   124   125   126   127   128   129   130   131
Bog'liq
Ceponkus, Hoodbhoy - Applied XML - Toolkit for Programmers

XSL by Example: Creating and Populating an HTML Template
Enough of theory! Let’s get our hands dirty and create our first XML to HTML conversion 
stylesheet. We begin with the following data set, which we use for most of our examples 
in this chapter:


->



Yin Yang
4
2
$6
Great food, but better to order take out 
than to eat in.



Little Italy
3
4
$8
Romantic setting, great place to go with a 
date.



- 253 -


Lee Tang
4
5
$9
Excellent food and a wonderful decor. Great place
for a business lunch.



Pirate's Lair
2
1
$7
Bad food and even worse decor. Never go
here unless you want an upset stomach.



Howie's Pizzeria
3
4
$7
Great place to get together with friends. They 
also sport the hottest wings in town.



For now, imagine that we want to display our restaurant’s review data set as an HTML 
page. In this case, the data is obviously repetitive and lends itself to a template-driven 
model approach. While we are getting ahead of ourselves, let’s take a look at what the 
corresponding XSL stylesheet would look like.


Download 2,96 Mb.
1   ...   123   124   125   126   127   128   129   130   131




Download 2,96 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



XSL by Example: Creating and Populating an HTML Template

Download 2,96 Mb.
Pdf ko'rish