<?xml version="1.0" encoding="UTF-8"?>
<!-- Simple recipe Schema -->
<xs:
schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified
">
<xs
:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="recipe
"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<schema
xmlns='http://www.w3.org/2000/10/XMLSchema'
targetNamespace='http://yourdomain.org/namespace/
'xmlns:t='http://yourdomain.org/namespace/
'>
<element name='t:list'>
<complexType>
<sequence>
<element ref='t:recipe
' maxOccurs='unbounded'/>
</sequence>
</complexType>
</element>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<list
xmlns="http://myrecipes.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://myrecipes.org/
recipe.xsd
"
>
<recipe>
<meta> .....</meta>
......
</recipe>
</list>
En gros: Il faut substituer qc. pour le rose et le rouge ci-dessus. Faites attention à la syntaxe de l’attribut schemaLocation: "
Namespace_url
XSD_URL
NameSpace_URL
XSD_URL
..."
<manifest
xmlns
="http://www.imsglobal.org/xsd/imscp_v1p1"xmlns:imsmd
="http://www.imsglobal.org/xsd/imsmd_v1p2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
identifier="MANIFEST-1"
xsi:schemaLocation=
"http://www.imsglobal.org/xsd/imscp_v1p imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd">
<metadata>
<imsmd:lom> ......
</imsmd:lom>
</metadata>
<organizations default="learning_sequence_1">
.....
<xsd:schema
xmlns
= "http://www.imsglobal.org/xsd/imscp_v1p1"
targetNamespace = "http://www.imsglobal.org/xsd/imscp_v1p1"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
version = "IMS CP 1.1.4"
elementFormDefault = "qualified">
Exemple d’un simple élément sans enfant et sans attributs:
<xs:element
name="author" type="xs:string"/>
<xs:element
name="recipe">
<xs:complexType>
<xs:sequence>
<xs:element ref="meta"/>
<xs:element minOccurs="0" ref="recipe_author"/>
<xs:element ref="recipe_name"/>
<xs:element ref="ingredients"/>
<xs:element ref="directions"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="recipe" type="recipe_contents
" />
<xs:complexType name="recipe_contents
">
<xs:sequence>
<xs:element ref="meta"/>
<xs:element minOccurs="0" ref="recipe_author"/>
<xs:element ref="recipe_name"/>
<xs:element ref="meal"/>
<xs:element ref="ingredients"/>
<xs:element ref="directions"/>
</xs:sequence>
</xs:complexType>