Beruflich Dokumente
Kultur Dokumente
DocumentXMLbienform
Tout T tlment l tdoit d itavoir i unebalise b li fermante f t Lesbalisessontsensibleslacasse. LeslmentsXMLdoiventtrecorrectementimbriques Undocumentxml doitavoirunlmentracine Lesvaleursdesattributsxml doiventtreentreguillemets""ou
Lesentits:5entitsprdfiniesenxml:
Uniquementlescaractres<et&sontstrictementinterditsdansun d document txml l
< > & & ' " < > & ' "
Remarques
Enxml l les l espacessontprservs Dansundocumentxml lecaractreLFreprsente unsautdeligne. Rgles g denommage g deslments:
Lenomdunlmentpeutcontenirdeslettres,des chiffresetdautrescaractres. Lenomnedoitpascommencerparunchiffreouun caractredeponctuation Unnomnedoitpascommencerparxml. Unnomnedoitpascontenirdespace.
DTD
Undocumentxml valideestundocument parrapport pp uneDTD bienformetvalidep (DocumentTypeDefinition) UnedclarationDTDpeuttreinterneou externeundocumentXML. Dclarationinterne:
Dclarationinterne
<?xml version="1.0"?> version "1 0"?> <!DOCTYPE note [ <!ELEMENT note (A,DE,Titre,Corps)> <!ELEMENT A (#PCDATA)> ( ) <!ELEMENT DE (#PCDATA)> <!ELEMENT Titre (#PCDATA)> <!ELEMENT Corps(#PCDATA)> ]> <note> <A>Timah</A> <DE>Hatim</DE> <Titre>Rappel</Titre> <Corps>Votrecommandeatexpdie</Corps> </note>
Dclarationexterne
D Dansl led document txml, l ajouter j t la l dclaration d l ti suivante:
<!DOCTYPEelt_racine elt racine SYSTEM"definition definition.dtd dtd"> > Exemple:<!DOCTYPE note SYSTEM" note.dtd">
DclarationdesattributsdansunDTD
Pourchaque attribut
<!ATTLISTelementnom_attribut type yp valeur_default> Exemple:<!ATTLISTpaymenttypeCDATA"carte"> carte >
Valeurspardfaut
Value:une valeur #REQUIRED #IMPLIED:lattribut nest pasobligatoire #FIXEDval:lavaleur val delattribut est fixe Exemple: <!ATTLISTpaiement type (chque|numraire|carte)"carte">
Lesentits
<!ENTITYmatiere "Technologiesxml."> Utilisation<cours>&matiere;</cours> Dclarationexterneduneentit
<!ENTITYnom_entit SYSTEM"URI/URL">
Lesfeuillesdestylecss
Lierunefeuilledestyleundocumentxml
<?xmlstylesheet y type="text/css" yp / href=" style.css"?>
Exemple:
ExempledeDTD
<!ELEMENT clients li t (client*)> ( li t*)> <!ELEMENT client (nom,prenom,commandes?)> <!ELEMENT nom (#PCDATA)> <!ELEMENT prenom (#PCDATA)> <!ELEMENT commandes (commande+)> <!ELEMENT commande (date,article+)> (date article+)> <!ELEMENT date (#PCDATA)> <!ELEMENT article (ref,designation,prix,quantite)> <!ELEMENT ref (#PCDATA)> <!ELEMENT designation (#PCDATA)> <!ELEMENT prix (#PCDATA)> <!ELEMENT quantite (#PCDATA)> <!ATTLIST commande ref CDATA#REQUIRED>
styles
Pseudo d slecteurs l before b f etafter f DATE{display:block;fontsize:32pt;fontweight:bold; t talign: text li center} t } DATE:before (ouafter){content:"Date:"} Css estunlangagedestylelimit
Deslmentspeuventtrecachspardisplay:none Unstyledfinipourunlments sapplique appliqueaussiaux nudsfilsdecetlment Deslmentsdetextepeuventtreajoutsavantouaprs unlmentsenutilisant:before, before after etcontent. content
display:block,none,listitem,table