<uneBaliseDuDocumentCourant xmlns:nomDeNotreChoix="UrlDeDtdOuSchemaAImporter">Exemple : pour utiliser les balises HTML dans un document XML :
<?xml version="1.0" encoding="ISO-8859-1"?> <article xmlns:html="http://www.w3.org/Profiles/XHTML-transitional">Pour éviter les ambiguïtés, les éléments utilisant des balises importées doivent alors être de la forme
<nomDeNotreChoix:NomDeBalise ...>Exemple :
<html:img html:src="..." />
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Rectangle SVG</title> </head> <body> <h1>Rectangle</h1> <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="100px"> <rect y="6px" x="5px" width="80px" height="40px" style="stroke:#0000FF;fill:#FF0000"/> </svg> </body> </html>
Différents exemples, dans différents domaines, permettent de mieux comprendre l'utilité des espaces de noms
exemple 2 ... exemple 12
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rss="http://purl.org/rss/1.0/" xmlns:rss091="http://purl.org/rss/1.0/modules/rss091#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns="http://purl.org/rss/1.0/"> <channel rdf:about="http://xmlfr.org/actualites/channel.rss10"> <title>XMLfr</title> <link>http://xmlfr.org/actualites/</link> <description>Actualités de XML</description> <dc:source rdf:resource="http://xmlfr.org/"/> <dc:language>fr</dc:language>