je dois réaliser le xml et le xsl. on m'a donné le dtd suivant:
j'aimerai savoir à quoi correspond la ligne
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 <!ELEMENT Recipe (Name, Description?, Ingredients?, Instructions?)> <!ELEMENT Name (#PCDATA)> <!ELEMENT Description (#PCDATA)> <!ELEMENT Ingredients (Ingredient)*> <!ELEMENT Ingredient (Qty, Item)> <!ELEMENT Qty (#PCDATA)> <!ATTLIST Qty unit CDATA #REQUIRED> <!ELEMENT Item (#PCDATA)> <!ATTLIST Item optional CDATA "0"isVegetarianCDATA "true"> <!ELEMENT Instructions (Step)+>
car je ne l'a comprend pas bien.
Code : Sélectionner tout - Visualiser dans une fenêtre à part <!ATTLIST Item optional CDATA "0"isVegetarianCDATA "true">
j'ai fais le xml suivant:
mon raisonnement est il bon ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE Recipe SYSTEM "recipe.dtd"> <?xml-stylesheet type="text/xsl" href="recipe.xsl"?> <Recipe> <Name>ma recette surprise</Name> <Description>Celle que ma grand-mere adore.</Description> <Ingredients> <Ingredient> <Qty unite="box">1</Qty> <item>lime gelatin</item> </Ingredient> <Ingredient> <Qty unite="g">500</Qty> <item>multicoloredmarshmallows</item> </Ingredient> <Ingredient> <Qty unite="ml">500</Qty> <item>cottage cheese</item> </Ingredient> <Ingredient> <Qty unite="dash"></Qty> <item>Tabasco sauce (optional)</item> </Ingredient> </Ingredients> <Instructions> <step>Preparer gelatine selon les instructions donnees...</step> </Instructions> </Recipe>
car mon prof veut que je réalise la page web suivante:
je me demandais donc si la ligne que je ne comprend pas fais afficher l'expression (optional).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <HTML> <HEAD> <TITLE>Ma recette Surprise</TITLE> </HEAD> <BODY> <H3>Ma recette Surprise</H3> Celle que ma grand-mere adore. <H4>Ingredients</H4> <TABLE BORDER="1"> <TR BGCOLOR="#308030"><TH>Qty</TH><TH>Units</TH><TH>Item</TH></TR> <TR><TD>1</TD><TD>box</TD><TD>lime gelatin</TD></TR> <TR><TD>500</TD><TD>g</TD><TD>multicoloredmarshmallows</TD></TR> <TR><TD>500</TD><TD>ml</TD><TD>cottage cheese</TD></TR> <TR><TD></TD><TD>dash</TD><TD>Tabasco sauce (optional)</TD></TR> </TABLE> <P> <H4>Instructions</H4> <OL> <LI>Preparer gelatine selon les instructions donnees...</LI> <!--etc etc --> </BODY> </HTML>
merci de votre aide.
Partager