Tag Archives: Wine tasting

xml and xsl and css connected example

first, you need have a wine.xml,this is for store your wines database: see below:

<?xml version=”1.0″ encoding=”UTF-8″?>
<?xml-stylesheet type=”text/css” href=”wine.css”?>
<!DOCTYPE wines [
<!ELEMENT wines (wine+)>
<!ELEMENT wine (name,country,location,history,color,year,served)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT location (#PCDATA)>
<!ELEMENT history (#PCDATA)>
<!ELEMENT color (#PCDATA|span)*>
<!ELEMENT span (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT served (#PCDATA)>
]>
<?xml-stylesheet type=”text/xsl” href=”wine.xsl”?>
<wines>
<wine>
<name>Rough Red</name>
<country>Italy</country>
<location>Turin</location>
<history>Some oenologists believe that Rough Red goes back to Roman times.</history>
<color>dark ruby-red wine – traditionally, it is called,<span>”black as rabbit’s blood”</span></color>
<year>2010</year>
<served>Rough Red should be served at 15 – 16 _C(59 – 60.8_F)
</served>
</wine>

<wine>
<name>Cabernet Merlot</name>
<country>South Australia</country>
<location>Australia</location>
<history>A soft, round and gloriously fleshy palate delivers flavours of ripe plum, red berries along with subtle liquorice and chocolate, finishing in a smooth and elegant fashion.
This is such an easy-drinking, soft and approachable wine. There is wonderful flavour and richness but it’s not at all confronting…a bit like a red wine with training wheels…and a true little treasure!</history>
<color>dark ruby-red wine – traditionally, it is called,<span>”black as rabbit’s blood”</span></color>
<year>2009</year>
<served>Rough Red should be served at 15 – 16 _C(59 – 60.8_F)
</served>
</wine>

</wines>

Then,save as win.xml you use xsl to style your wines’ data, see below(xml can let your xml data display in html ) Continue reading xml and xsl and css connected example