|
New to the CF scene
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
need help on transforming XML to XHTML through XLST
Hey guys, how you doing.
Ive been trying to pick up coding for a while now and have really found it difficult, i have been given a task by my uni to complete by tomorrow but man, i cant do it, i was wondering if i could get any help from you guys, its part of an assignment ive been given.
anyways, without further a due, here is my XML file. (its a biggie, sorry, and it probably isnt that good cause, well, i suck at this, haha)
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE recipes [
<!ELEMENT recipe (dish+)>
<!ELEMENT dish (name, type, preptime, cooktime, utensils+, instructions, bestbev?, condiments*, creator*)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT type (category, nationality*)>
<!ELEMENT category (Dishtype, ingredients)>
<!ELEMENT dishtype (#PCDATA)>
<!ELEMENT ingredients (mainingredient, otheringredients+)>
<!ELEMENT mainingredient (imageingredient, URLinfoingredient)>
<!ELEMENT otheringredients (#PCDATA)>
<!ELEMENT imageingredient (#PCDATA)>
<!ELEMENT URLinfoingredient (#PCDATA)>
<!ELEMENT nationality (#PCDATA)>
<!ELEMENT preptime (#PCDATA)>
<!ELEMENT cooktime (oventemp, time)>
<!ELEMENT oventemp (#PCDATA)>
<!ELEMENT time (#PCDATA)>
<!ELEMENT utensils (#PCDATA)>
<!ELEMENT instructions (preperation+, cooking)>
<!ELEMENT preperation (#PCDATA)>
<!ELEMENT cooking (#PCDATA)>
<!ELEMENT bestbev (#PCDATA)>
<!ELEMENT condiments (#PCDATA)>
<!ELEMENT creator (traditional | (restaurant*, firstname, surname, imagecreator*))>
<!ELEMENT traditional (#PCDATA)>
<!ELEMENT restaurant (name, location+)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT location (#PCDATA)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT surname (#PCDATA)>
<!ELEMENT imagecreator (#PCDATA)>
]>
<recipe>
<dish>
<name>Prawn, cucumber and bean starter</name>
<type>
<category>
<dishtype>starter</dishtype>
<ingredients>
<mainingredient>Prawn</mainingredient>
<imageingredient>http://www.taste.com.au/images/recipes/sfi/2007/12/18570_n.jpg</imageingredient>
<URLinfoingredient>http://en.wikipedia.org/wiki/Prawns</URLinfoingredient>
<otheringredient>300g Green beans, trimmed and thinly sliced</otheringredient>
<otheringredient>2 Large lebanese Cucumbers</otheringredient>
<otheringredient>1.5Kgs Cooked King Prawns, Tails intact</otheringredient>
<otheringredient>1/3 cup olive oil</otheringredient>
<otheringredient>2Tbs Lemon Juice</otheringredient>
<otheringredient>2Tbs Chopped fresh Dill Sprigs</otheringredient>
<otheringredient>2Tsp Wholegrain Mustard</otheringredient>
</ingredients>
</category>
<nationality>Australian</nationality>
</type>
<preptime>15 mins</preptime>
<cooktime>
<time>30 secs</time>
</cooktime>
<utensils>knife, chopping board, jug, saucepan, calendar</utensils>
<instructions>
<preperation>Cook beans in a large saucepan of boiling water for 30 seconds or until just tender. Refresh in cold water. Drain.</preperation>
<preperation>Make dressing: Combine ingredients in a screw-top jar. Season with salt and pepper. Secure lid. Shake to combine.</preperation>
<preperation>Combine beans, cucumber and prawns in a large bowl. Pour over dressing. Toss to combine. Serve.</preperation>
</instructions>
<bestbev>White Wine, a nice fruity number</bestbev>
<condiments>none</condiments>
<creator>
<traditional>this is a traditional dish</traditional>
</creator>
</dish>
<dish>
<name>Egg and Lettuce Cups</name>
<type>
<category>
<dishtype>starter</dishtype>
<ingredients>
<mainingredient>Egg</mainingredient>
<imageingredient>http://www.taste.com.au/images/recipes/agt/2007/11/18401_n.jpg</imageingredient>
<URLinfoingredient>http://en.wikipedia.org/wiki/Eggs</URLinfoingredient>
<otheringredient>4 Eggs</otheringredient>
<otheringredient>1tsp Mayonaise</otheringredient>
<otheringredient>1.5Kgs Cooked King Prawns, Tails intact</otheringredient>
<otheringredient>1/4tsp Curry Powder</otheringredient>
<otheringredient>12 baby cos lettuce leaves</otheringredient>
</ingredients>
</category>
<nationality>Chinese</nationality>
</type>
<preptime>15 mins</preptime>
<cooktime>
<time>10 mins</time>
</cooktime>
<utensils>knife, chopping board, saucepan, calendar</utensils>
<instructions>
<preperation>Place eggs in a saucepan and cover with cold water. Bring to the boil over high heat. Cook for 4 minutes. Drain and cover with cold water. Set aside to cool. Peel. Place in a bowl. Use a fork to mash. Stir in mayonnaise and curry powder, if desired. Arrange baby cos lettuce leaves on serving plates. Spoon in the egg mixture. Serve.</preperation>
</instructions>
<bestbev>Glass of cold water</bestbev>
<condiments>none</condiments>
<creator>
<traditional>this is a traditional dish</traditional>
</creator>
</dish>
<dish>
<name>Barbecued asparagus with pink peppercorn dressing</name>
<type>
<category>
<dishtype>starter</dishtype>
<ingredients>
<mainingredient>Asparagus</mainingredient>
<imageingredient>http://www.taste.com.au/images/recipes/nb/2010/04/24712_n.jpg</imageingredient>
<URLinfoingredient>http://en.wikipedia.org/wiki/Asparagus</URLinfoingredient>
<otheringredient>2 1/2 tbs light olive oil</otheringredient>
<otheringredient>2 bunches asparagus, trimmed</otheringredient>
<otheringredient>2 tbs red wine vinegar</otheringredient>
<otheringredient>1 tsp honey</otheringredient>
<otheringredient>1 tsp Dijon mustard</otheringredient>
<otheringredient>1 shallot, finely chopped</otheringredient>
<otheringredient>1 tbs pink peppercorns, lightly crushed</otheringredient>
</ingredients>
</category>
<nationality>French</nationality>
</type>
<preptime>5 mins</preptime>
<cooktime>
<time>5 mins</time>
</cooktime>
<utensils>knife, chopping board, jug, saucepan, calendar</utensils>
<instructions>
<preperation>Heat a char-grill pan on high. Drizzle 2 teaspoons of the oil over the asparagus. Add the asparagus to the char-grill and cook, turning occasionally, for 2 minutes or until bright green and tender crisp. Transfer to a plate.</preperation>
<preperation>Place the remaining oil, vinegar, honey, mustard, shallot and peppercorns in a screw-top jar and shake until well combined. Season with salt and black pepper. Drizzle over the asparagus and serve immediately.</preperation>
</instructions>
<bestbev>White Wine, a nice fruity number</bestbev>
<condiments>none</condiments>
<creator>
<traditional>this is a traditional dish</traditional>
</creator>
</dish>
</recipe>
what im really looking for is someone to help me with the process to turn this into a good looking xhtml file. Thanks a lot in advance if anyone decides to take on a little task.
|
|