">
Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

Online

À la maison Codes sources E-Livres Téléchargements Nous contacter Au sujet de nous

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Attributs de XSD
Previous Next




Tous les attributs sont déclarés comme types simples.



Quel est un attribut ?

Les éléments simples ne peuvent pas avoir l'attribut. Si un élément a des attributs, on le considère comme d'les types complexes. Mais l'attribut lui-même est déclaré comme type simple.

Comment définir un attribut ?

La syntaxe pour définir un attribut est comme suit :

<xs:attribute name="xxx" type="yyy"/>

là où xxx est le nom de l'attribut et yyy indiquer le type de données de l'attribut.

Le schéma de XML a beaucoup de type de données intégré. Les types les plus communs sont comme suit :

  • xs : corde
  • xs : décimal
  • xs : booléen
  • xs : nombre entier
  • xs : date
  • xs : temps



Exemple

Voici un élément de XML avec l'attribut :

<lastname lang="EN">Smith</lastname>
Et voici les définitions d'attribut la correspondance :
<xs:attribute name="lang" type="xs:string"/>
Défaut et valeurs fixes pour des attributs

Les attributs peuvent valeur de havedefault OU une valeur fixe indiquée.

Une valeur par défaut est automatiquement assignée aux attributs quand aucune autre valeur n'est indiquée.

Dans l'exemple suivant la valeur par défaut pour l'attribut est « en » :

<xs:attribute name="lang" type="xs:string" default="EN"/>

Une valeur fixe est également automatiquement assignée à l'attribut, et vous ne pouvez pas indiquer une autre valeur.

Dans l'exemple suivant la valeur fixe est « en » :

<xs:attribute name="lang" type="xs:string" fixed="EN"/>
Attributs facultatifs et requis

Les attributs sont par défaut facultatif. Pour indiquer que les attributs sont exigés, employer l'attribut de « utilisation » :

<xs:attribute name="lang" type="xs:string" use="required"/>
Restrictions au contenu

Quand les éléments ou les attributs d'un XML a un type de données défini, il met des restrictions sur le contenu de l'élément ou de l'attribut.

Si un élément de XML est de type « xs : dater » et contenir une corde comme « bonjour le monde », l'élément ne validera pas.

Avec le schéma de XML, vous pouvez également ajouter vos propres restrictions à vos éléments et à attributs de XML. Ces restrictions s'appellent la facette. Vous pouvez également lire plus au sujet des facettes dans le prochain chapitre.







Previous Next

Keywords: XSD attributes,xsl attributes,xsd attribute,xsd tutorial,xslt attributes,dtd attributes,xml attributes


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.