XHTML2/i18n/hreflang examples

From XHTML2
< XHTML2‎ | i18n
Jump to: navigation, search

hreflang Examples

UL nested in a P with an illustration of @role and the L element

Illustration of hreflang use in association with the content negotiation algorithm. An element marked hreflang="es" should deliver to a user whose user agent is set to accept Spanish, the Spanish-language version of the press release, if available.


Version 1: Unicode Values for Extended Latin Characters

 <p role="complementary">
 <l href="http://www.w3.org/2003/06/semantictour-pressrelease"
 >Semantic Tour Press Release</l>
  <ul>
  <li hreflang="es" xml:lang="es">Esta pagina en español</li>
  <li hreflang="fr" xml:lang="fr">Cette page en français</li>
  <li hreflang="nl" xml:lang="nl">Deze pagina in het nederlands</li>
  </ul>
  </p>

Version 2: Character Entities for Extended Latin Characters

<p role="complementary">
 <l href="http://www.w3.org/2003/06/semantictour-pressrelease"
 >Semantic Tour Press Release</l>
  <ul>
  <li hreflang="es" xml:lang="es">Esta pagina en espa&#241;ol</li>
  <li hreflang="fr" xml:lang="fr">Cette page en fran&#231;ais</li>
  <li hreflang="nl" xml:lang="nl">Deze pagina in het nederlands</li>
  </ul>
  </p>


Version 3: "Naked" Extended ASCII Characters

<p role="complementary">
 <l href="http://www.w3.org/2003/06/semantictour-pressrelease"
 >Semantic Tour Press Release</l>
  <ul>
  <li hreflang="es" xml:lang="es">Esta pagina en español</li>
  <li hreflang="fr" xml:lang="fr">Cette page en français</li>
  <li hreflang="nl" xml:lang="nl">Deze pagina in het nederlands</li>
  </ul>
  </p>