index.html 48 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org">

  <title>HTML+RDFa</title>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <style type="text/css">
pre { margin-left: 2em; white-space: pre-wrap; }
   h2 { margin: 3em 0 1em 0; }
   h3 { margin: 2.5em 0 1em 0; }
   h4 { margin: 2.5em 0 0.75em 0; }
   h5, h6 { margin: 2.5em 0 1em; }
   h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
   h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
   p { margin: 1em 0; }
   hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
   dl, dd { margin-top: 0; margin-bottom: 0; }
   dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
   dt + dt { margin-top: 0; }
   dd dt { margin-top: 0.25em; margin-bottom: 0; }
   dd p { margin-top: 0; }
   dd dl + p { margin-top: 1em; }
   dd table + p { margin-top: 1em; }
   p + * > li, dd li { margin: 1em 0; }
   dt, dfn { font-weight: bold; font-style: normal; }
   dt dfn { font-style: italic; }
   pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
   pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
   pre em { font-weight: bolder; font-style: normal; }
   @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
   var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
   table { border-collapse: collapse; border-style: hidden hidden none hidden; }
   table thead { border-bottom: solid; }
   table tbody th:first-child { border-left: solid; }
   table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
   blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }

   .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
   .matrix, .matrix td { border: none; text-align: right; }
   .matrix { margin-left: 2em; }
   .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
   .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
   .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
   .applies th > * { display: block; white-space: nowrap; }
   .applies thead code { display: block; }
   .applies td { text-align: center; }
   .applies .yes { background: yellow; }

   .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
   img.extra { float: right; }
   pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; }
   pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
   pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
   pre.css:first-line { color: #AAAA50; }
   dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #EEFFEE; }
   hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
   dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
   dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
   dl.domintro dd p { margin: 0.5em 0; }
   dl.switch { padding-left: 2em; }
   dl.switch > dt { text-indent: -1.5em; }
   dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
   dl.triple { padding: 0 0 0 1em; }
   dl.triple dt, dl.triple dd { margin: 0; display: inline }
   dl.triple dt:after { content: ':'; }
   dl.triple dd:after { content: '\A'; white-space: pre; }
   .diff-old { text-decoration: line-through; color: silver; background: transparent; }
   .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
   a .diff-new { border-bottom: 1px blue solid; }

   h2 { page-break-before: always; }
   h1 + h2, hr + h2.no-toc { page-break-before: auto; }

   p > span:not([title=""]):not([class="XXX"]):not([class="impl"]), li > span:not([title=""]):not([class="XXX"]):not([class="impl"]) { border-bottom: solid #9999CC; }

   div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
   div.head p { margin: 0; }
   div.head h1 { margin: 0; }
   div.head .logo { float: right; margin: 0 1em; }
   div.head .logo img { border: none } /* remove border from top image */
   div.head dl { margin: 1em 0; }

   body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
   body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
   body > .toc > li > * { margin-bottom: 0.5em; }
   body > .toc > li > * > li > * { margin-bottom: 0.25em; }
   .toc, .toc li { list-style: none; }

   .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
   .brief li { margin: 0; padding: 0; }
   .brief li p { margin: 0; padding: 0; }

   .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
   .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
   .category-list li { display: inline; }
   .category-list li:not(:last-child)::after { content: ', '; }
   .category-list li > span, .category-list li > a { text-transform: lowercase; }
   .category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */

   .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
   .XXX > :first-child { margin-top: 0; }
   p .XXX { line-height: 3em; }
   .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
   .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
   .annotation :link, .annotation :visited { color: inherit; }
   .annotation :link:hover, .annotation :visited:hover { background: transparent; }
   .annotation span { border: none ! important; }
   .note { color: green; background: transparent; font-family: sans-serif; }
   .warning { color: red; background: transparent; }
   .note, .warning { font-weight: bolder; font-style: italic; }
   p.note, div.note { padding: 0.5em 2em; }
   span.note { padding: 0 2em; }
   .note p:first-child, .warning p:first-child { margin-top: 0; }
   .note p:last-child, .warning p:last-child { margin-bottom: 0; }
   .warning:before { font-style: normal; }
   p.note:before { content: 'Note: '; }
   p.warning:before { content: '\26A0 Warning! '; }

   .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
   .bookkeeping { font-size: 0.8em; margin: 2em 0; }
   .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }

   h4 { position: relative; z-index: 3; }
   h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
   .element {
     background: #EEEEFF;
     color: black;
     margin: 0 0 1em 0.15em;
     padding: 0 1em 0.25em 0.75em;
     border-left: solid #9999FF 0.25em;
     position: relative;
     z-index: 1;
   }
   .element:before {
     position: absolute;
     z-index: 2;
     top: 0;
     left: -1.15em;
     height: 2em;
     width: 0.9em;
     background: #EEEEFF;
     content: ' ';
     border-style: none none solid solid;
     border-color: #9999FF;
     border-width: 0.25em;
   }

   .example {
     display: block;
     color: #222222;
     background: #FCFCFC;
     border-left: double;
     margin-left: 2em;
     padding-left: 1em;
   }

   .tall-and-narrow {
     font-size: 0.6em;
     column-width: 25em;
     column-gap: 1em;
     -moz-column-width: 25em;
     -moz-column-gap: 1em;
     -webkit-column-width: 25em;
     -webkit-column-gap: 1em;
   }

   ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
   ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
   ul.domTree li li { list-style: none; }
   ul.domTree li:first-child::before { position: absolute; top: 0; height: 0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
   ul.domTree li:not(:last-child)::after { position: absolute; top: 0; bottom: -0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
   ul.domTree span { font-style: italic; font-family: serif; }
   ul.domTree .t1 code { color: purple; font-weight: bold; }
   ul.domTree .t2 { font-style: normal; font-family: monospace; }
   ul.domTree .t2 .name { color: black; font-weight: bold; }
   ul.domTree .t2 .value { color: blue; font-weight: normal; }
   ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
   ul.domTree .t7 code, .domTree .t8 code { color: green; }
   ul.domTree .t10 code { color: teal; }

  </style>
  <link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type=
  "text/css"><!-- ZZZ ED vs WD -->
</head>

<body>
  <div class="head">
    <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src=
    "http://www.w3.org/Icons/w3c_home" width="72"></a></p>

    <h1>HTML+RDFa</h1>

    <h2 class="no-num no-toc" id="a-mechanism-for-embedding-rdf-in-html">A
    mechanism for embedding RDF in HTML</h2>

    <h2 class="no-num no-toc" id="editor-s-draft-date-04-March-2010">W3C
    Working Draft 04 March 2010</h2><!--:ZZZ-->

    <dl>

      <dt>This Version</dt>

      <dd><a href=
      "http://www.w3.org/TR/2010/WD-rdfa-in-html-20100304/">http://www.w3.org/TR/2010/WD-rdfa-in-html-20100304/</a></dd>

      <dt>Latest Version</dt>

      <dd><a href=
      "http://www.w3.org/TR/rdfa-in-html/">http://www.w3.org/TR/rdfa-in-html/</a></dd>

      <dt>Previous Versions</dt>

      <dd><a href=
      "http://www.w3.org/TR/2009/WD-rdfa-in-html-20091015/">http://www.w3.org/TR/2009/WD-rdfa-in-html-20091015/</a></dd>

      <dt>Authors (alphabetical order):</dt>

      <dd>Ben Adida (Chair, RDFa Task Force, Creative Commons)</dd>

      <dd>Mark Birbeck (Editor, XHTML+RDFa and inventor of RDFa concept, Web
      Backplane Ltd.)</dd>

      <dd>Shane McCarron (Editor, XHTML+RDFa, Applied Testing and Technology,
      Inc.)</dd>

      <dd>Steven Pemberton (Chair, XHTML2 and RDFa Task Force member,
      CWI)</dd>

      <dd><a href="mailto:msporny@digitalbazaar.com">Manu Sporny</a>,
      (Editor, HTML+RDFa and RDFa Task Force member, Digital Bazaar,
      Inc.)</dd>
    </dl>

    <p class="copyright"><a href=
    "http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
    &copy; 2010 <a href="http://www.w3.org/"><abbr title=
    "World Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a href=
    "http://www.csail.mit.edu/"><abbr title=
    "Massachusetts Institute of Technology">MIT</abbr></a>, <a href=
    "http://www.ercim.eu/"><abbr title=
    "European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
    <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C
    <a href=
    "http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
    <a href=
    "http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
    and <a href=
    "http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
    rules apply.</p>
  </div>
  <hr class="top">

  <h2 class="no-num no-toc" id="abstract">Abstract</h2>

  <p>This specification defines rules and guidelines for adapting the RDF in
  XHTML: Syntax and Processing (RDFa) specification for use in the HTML5 and
  XHTML5 members of the HTML family. The rules defined in this specification
  not only apply to HTML5 documents in non-XML and XML mode, but also to
  HTML4 and XHTML documents interpreted through the HTML5 parsing rules.</p>

  <h2 class="no-num no-toc" id="status-of-this-document">Status of this
  document</h2><!-- intro boilerplate (required) -->

  <p><em>This section describes the status of this document at the time of
  its publication. Other documents may supersede this document. A list of
  current W3C publications and the latest revision of this technical report
  can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
  index</a> at http://www.w3.org/TR/.</em></p>

  <p>This is a Working Draft of the "HTML+RDFa: A mechanism for embedding RDF
  in HTML" specification for review by W3C members and other interested
  parties.</p>

  <p>This Working Draft includes the following changes:</p>

  <ul>
    <li>Updating HTML5 coercion to Infoset rules (normative)</li>

    <li>Clarifying how to extract RDFa attributes via Infoset
    (informative)</li>

    <li>Clarifying how to extract RDFa attributes via DOM2 (informative)</li>
  </ul>

  <p>If you wish to make comments regarding this document, please send them
  to <a href=
  "mailto:public-rdf-in-xhtml-tf@w3.org">public-rdf-in-xhtml-tf@w3.org</a>
  (<a href=
  "mailto:public-rdf-in-xhtml-tf-request@w3.org?subject=subscribe">subscribe</a>,
  <a href=
  "http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/">archives</a>)
  or to <a href=
  "mailto:public-html-comments@w3.org">public-html-comments@w3.org</a>
  (<a href=
  "mailto:public-html-comments-request@w3.org?subject=subscribe">subscribe</a>,
  <a href=
  "http://lists.w3.org/Archives/Public/public-html-comments/">archives</a>),
  or submit them using the <a href=
  "http://www.w3.org/Bugs/Public/enter_bug.cgi">W3C's public bug
  database</a>.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- stability (required) -->

  <p>Implementors should be aware that this specification is not stable.
  <strong>Implementors who are not taking part in the discussions are likely
  to find the specification changing out from under them in incompatible
  ways.</strong> Vendors interested in implementing this specification should
  note the status, and are encouraged to join the RDFa Working Group.</p>
  <!-- not everyone agrees with html5 (requested before fpwd) -->

  <p>Publication as a Working Draft does not imply endorsement by the W3C
  Membership. This is a draft document and may be updated, replaced or
  obsoleted by other documents at any time. It is inappropriate to cite this
  document as other than work in progress.</p>

  <p>The publication of this document by the W3C as a W3C Working Draft does
  not imply that all of the participants in the W3C HTML working group
  endorse the contents of the specification. Indeed, for any section of the
  specification, one can usually find many members of the working group or of
  the W3C as a whole who object strongly to the current text, the existence
  of the section at all, or the idea that the working group should even spend
  time discussing the concept of that section.</p>

  <p>The latest stable version of the editor's draft of this specification is
  always available on <a href="http://dev.w3.org/html5/rdfa/">the W3C CVS
  server</a>. The <a href=
  "http://html5.digitalbazaar.com/specs/rdfa.html">latest editor's working
  copy</a> (which may contain unfinished text in the process of being
  prepared) is also available. A <a href=
      "http://www.w3.org/TR/2010/WD-rdfa-in-html-20100304/diffs.html">Diff-marked version</a> is available.
</p>

  <p>This specification has been jointly developed by the <a href=
  "http://www.w3.org/2001/sw/BestPractices/HTML/">RDFa Task Force</a> and the
  <a href="http://www.w3.org/html/wg/">HTML Working Group</a> and is
  currently being published by the <a href="http://www.w3.org/html/wg/">HTML
  Working Group</a> to further discussions there.</p>

  <p>This specification is an extension to the HTML5 language. All normative
  content in the HTML5 specification, unless specifically overridden by this
  specification, is intended to be the basis for this specification.</p>

  <p>This document was produced by a group operating under the <a href=
  "http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C
  Patent Policy</a>. W3C maintains a <a href=
  "http://www.w3.org/2004/01/pp-impl/40318/status" rel="disclosure">public
  list of any patent disclosures</a> made in connection with the deliverables
  of the group; that page also includes instructions for disclosing a patent.
  An individual who has actual knowledge of a patent which the individual
  believes contains <a href=
  "http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
  Claim(s)</a> must disclose the information in accordance with <a href=
  "http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
  6 of the W3C Patent Policy</a>.</p>

  <h2 class="no-num no-toc" id="contents">Table of contents</h2>
  <!--begin-toc-->

  <ol class="toc">
    <li>
      <a href="#introduction"><span class="secno">1</span> Introduction</a>

      <ol>
        <li><a href="#history"><span class="secno">1.1</span>
        History</a></li>
      </ol>
    </li>

    <li>
      <a href="#parsing-model"><span class="secno">2</span> Parsing Model</a>

      <ol>
        <li><a href="#modifying-the-input-document"><span class=
        "secno">2.1</span> Modifying the Input Document</a></li>
      </ol>
    </li>

    <li>
      <a href="#conformance-requirements"><span class="secno">3</span>
      Conformance Requirements</a>

      <ol>
        <li><a href="#document-conformance"><span class="secno">3.1</span>
        Document Conformance</a></li>

        <li><a href="#user-agent-conformance"><span class="secno">3.2</span>
        User Agent Conformance</a></li>

        <li><a href="#rdfa-processor-conformance"><span class=
        "secno">3.3</span> RDFa Processor Conformance</a></li>
      </ol>
    </li>

    <li>
      <a href="#modifications-to-xhtml-rdfa"><span class="secno">4</span>
      Modifications to XHTML+RDFa</a>

      <ol>
        <li><a href="#specifying-the-language-for-a-literal"><span class=
        "secno">4.1</span> Specifying the language for a literal</a></li>

        <li><a href="#invalid-xmlliteral-values"><span class=
        "secno">4.2</span> Invalid XMLLiteral values</a></li>

        <li><a href="#xmlns:-prefixed-attributes"><span class=
        "secno">4.3</span> <code>xmlns:</code>-Prefixed Attributes</a></li>
      </ol>
    </li>

    <li>
      <a href="#extensions-to-the-html5-syntax"><span class="secno">5</span>
      Extensions to the HTML5 Syntax</a>

      <ol>
        <li><a href="#the-rdfa-attributes-and-valid-values"><span class=
        "secno">5.1</span> The RDFa Attributes and Valid Values</a></li>

        <li><a href=
        "#conformance-criteria-for-xmlns:-prefixed-attributes"><span class=
        "secno">5.2</span> Conformance Criteria for
        <code>xmlns:</code>-Prefixed Attributes</a></li>

        <li><a href=
        "#preserving-namespaces-via-coercion-to-infoset"><span class=
        "secno">5.3</span> Preserving Namespaces via Coercion to
        Infoset</a></li>
      </ol>
    </li>

    <li>
      <a href="#infoset-based-processors"><span class="secno">6</span>
      Infoset-based Processors</a>

      <ol>
        <li><a href="#processing-namespaced-rdfa-attributes"><span class=
        "secno">6.1</span> Processing Namespaced RDFa Attributes</a></li>

        <li><a href="#processing-rdfa-attributes"><span class=
        "secno">6.2</span> Processing RDFa Attributes</a></li>
      </ol>
    </li>

    <li>
      <a href="#dom-level-2-based-processors"><span class="secno">7</span>
      DOM Level 2-based Processors</a>

      <ol>
        <li><a href="#processing-namespaced-rdfa-attributes-0"><span class=
        "secno">7.1</span> Processing Namespaced RDFa Attributes</a></li>

        <li><a href="#processing-rdfa-attributes-0"><span class=
        "secno">7.2</span> Processing RDFa Attributes</a></li>
      </ol>
    </li>

    <li>
      <a href="#references"><span class="secno">8</span> References</a>

      <ol>
        <li><a href="#normative-references"><span class="secno">8.1</span>
        Normative References</a></li>

        <li><a href="#non-normative-references"><span class=
        "secno">8.2</span> Non-Normative References</a></li>
      </ol>
    </li>
  </ol><!--end-toc-->

  <h2 id="introduction"><span class="secno">1</span> Introduction</h2>

  <p><em>This section is informative.</em></p>

  <p>Today's web is built predominantly for human consumption. Even as
  machine-readable data begins to permeate the web, it is typically
  distributed in a separate file, with a separate format, and very limited
  correspondence between the human and machine versions. As a result, web
  browsers can provide only minimal assistance to humans in parsing and
  processing web data: browsers only see presentation information. RDFa is
  intended to solve the problem of machine-readable data in HTML documents.
  RDFa provides a set of HTML attributes to augment visual data with
  machine-readable hints. Using RDFa, authors may turn their existing
  human-visible text and links into machine-readable data without repeating
  content.</p>

  <h3 id="history"><span class="secno">1.1</span> History</h3>

  <p>In early 2004, Mark Birbeck published a document named [<a href=
  "#refsXHTMLRDF">XHTMLRDF</a>] via the XHTML2 Working Group wherein he laid
  the groundwork for what would eventually become RDFa (The Resource
  Description Framework in Attributes).</p>

  <p>In 2006, the work was co-sponsored by the Semantic Web Deployment Work
  Group, which began to formalize a technology to express semantic data in
  XHTML. This technology was successfully developed and reached consensus at
  the W3C, later published as an official W3C Recommendation. While HTML
  provides a mechanism to express the structure of a document (title,
  paragraphs, links), RDFa provides a mechanism to express the meaning in a
  document (people, places, events).</p>

  <p>The document, titled "RDF in XHTML: Syntax and Processing" [<a href=
  "#refsXHTMLRDFA">XHTML+RDFa</a>], defined a set of attributes and rules for
  processing those attributes that resulted in the output of machine-readable
  semantic data. While the document applied to XHTML, the attributes and
  rules were always intended to operate across any tree-based structure
  containing attributes on tree nodes (such as HTML4, SVG and ODF).</p>

  <p>While RDFa was initially specified for use in XHTML, adoption by a
  number of large organizations on the Web spurred RDFa's use in non-XHTML
  languages. Its use in HTML4, before an official specification was developed
  for those languages, caused concern regarding document conformance.</p>

  <p>Over the years, the members of the RDFa Task Force [<a href=
  "http://rdfa.info/">RDFaTF</a>] had discussed the possibility of applying
  the same attributes and processing rules outlined in the XHTML+RDFa
  specification to all HTML family documents. By design, the possibility of a
  unified semantic data expression mechanism between all HTML and XHTML
  family documents was squarely in the realm of possibility.</p>

  <p>This section describes the modifications to the original XHTML+RDFa
  specification that permit the use of RDFa in all HTML family documents. By
  using the attributes and processing rules described in the XHTML+RDFa
  specification and heeding the minor changes in this section, authors can
  expect to generate markup that produces the same semantic data output in
  HTML4, HTML5 and XHTML5.</p>

  <h2 id="parsing-model"><span class="secno">2</span> Parsing Model</h2>

  <p><em>This section is normative.</em></p>

  <p><a href="http://www.w3.org/TR/rdfa-syntax/#sec_5.5.">Section 5.5:
  Sequence</a>, of the [<a href=
  "http://www.w3.org/TR/rdfa-syntax/">XHTML+RDFa</a>] specification defines a
  generic processing model for extracting RDF from a tree-based model. The
  method of transforming an input document into a model suited for the RDFa
  processing rules is intentionally not defined in the XHTML+RDFa
  specification. The method of transformation was intended to be defined in
  the implementation language, in this case, this section of the HTML+RDFa
  specification.</p>

  <p>The HTML5 and XHTML5 DOMs are each a super-set of the tree-based model
  on which the RDFa processing rules operate. Therefore, a mapping mechanism
  to translate from a DOM to a tree-model is not necessary. The HTML5 and
  XHTML5 DOM, or equivalent data structure, should be used as input to the
  RDFa processing rules. The normative language for construction of the HTML5
  DOM and XHTML5 DOM is contained in the HTML5 specification.</p>

  <h3 id="modifying-the-input-document"><span class="secno">2.1</span>
  Modifying the Input Document</h3>

  <p><em>This section is informative.</em></p>

  <p>RDFa's tree-based processing rules, outlined in <a href=
  "http://www.w3.org/TR/rdfa-syntax/#sec_5.5.">Section 5.5: Sequence</a> of
  the XHTML+RDFa specification, allow an input document to be automatically
  corrected, cleaned-up, re-arranged, or modified in any way that is approved
  by the host language prior to processing. For example, element nesting
  issues in HTML documents may be corrected before the input document is
  translated into the DOM, a valid tree-based model, on which the RDFa
  processing rules will operate.</p>

  <p>Any mechanism that generates a data structure equivalent to the HTML5 or
  XHTML5 DOM, such as the html5lib library, may be used as the mechanism to
  construct the tree-based model provided as input to the RDFa processing
  rules.</p>

  <h2 id="conformance-requirements"><span class="secno">3</span> Conformance
  Requirements</h2>

  <p><em>This section is normative.</em></p>

  <p>The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
  interpreted as described in [<a class="nref" href=
  "#refsRFC2119">RFC2119</a>].</p>

  <h3 id="document-conformance"><span class="secno">3.1</span> Document
  Conformance</h3>

  <p>In order for a document to claim that it is a conforming HTML+RDFa
  document, it must provide the facilities described as mandatory in this
  section. The document conformance criteria are listed below, of which only
  a subset are mandatory:</p>

  <ol>
    <li>All document conformance requirements stated as mandatory in the
    HTML5 specification must be met.</li>

    <li>There should be a <code>version</code> attribute on the
    <code>html</code> element. The value of the <code>version</code>
    attribute should be "HTML+RDFa 1.0" if the document is a non-XML mode
    document, or "XHTML+RDFa 1.0" if the document is a XML mode
    document.</li>

    <li>There may be a <code>link</code> element contained in the
    <code>head</code> element that contains <code>profile</code> for the the
    <code>rel</code> attribute and
    <code>http://www.w3.org/1999/xhtml/vocab</code> for the <code>href</code>
    attribute.</li>
  </ol>

  <h3 id="user-agent-conformance"><span class="secno">3.2</span> User Agent
  Conformance</h3>

  <p>A conforming RDFa user agent must:</p>

  <ul>
    <li>Conform to all requirements listed in the <span>Conformance
    requirements</span> section of the HTML5 specification.</li>

    <li>Implement all of the features required by this specification.</li>

    <li>Implement all of the features specified in the XHTML+RDFa
    specification, excluding those features which are specifically overridden
    by this specification as detailed in the <a href=
    "#modifications-to-xhtml-rdfa">Modifications to XHTML+RDFa</a>.</li>
  </ul>

  <h3 id="rdfa-processor-conformance"><span class="secno">3.3</span> RDFa
  Processor Conformance</h3>

  <p>A conforming RDFa Processor must implement all of the mandatory features
  specified in the XHTML+RDFa specification. It must also support any
  mandatory features specified in this specification.</p>

  <h2 id="modifications-to-xhtml-rdfa"><span class="secno">4</span>
  Modifications to XHTML+RDFa</h2>

  <p><em>This section is normative.</em></p>

  <p>The [<a href="http://www.w3.org/TR/rdfa-syntax/">XHTML+RDFa</a>]
  Recommendation is the base document on which this specification builds.
  XHTML+RDFa specifies the attributes, in <a href=
  "http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes">Section 2.1: The RDFa
  Attributes</a>, and processing model, in <a href=
  "http://www.w3.org/TR/rdfa-syntax/#s_model">Section 5: Processing
  Model</a>, for extracting RDF from an XHTML document. This section
  specifies changes to the attributes and processing model defined in
  XHTML+RDFa in order to support extracting RDF from HTML documents.</p>

  <p>The requirements and rules, as specified in XHTML+RDFa and further
  modified in this document, apply to all HTML5 documents. The RDFa Processor
  operating on HTML and XHTML documents, specifically the resulting DOMs,
  must apply the same processing rules for both types of serializations and
  DOMs.</p>

  <h3 id="specifying-the-language-for-a-literal"><span class=
  "secno">4.1</span> Specifying the language for a literal</h3>

  <p>The <code>lang</code> attribute must be processed in the same manner as
  the <code>xml:lang</code> attribute is in the XHTML+RDFa specification,
  <a href="http://www.w3.org/TR/rdfa-syntax/#sec_5.5.">Section 5.5:
  Sequence</a>, step #3.</p>The rules for determining the language of a node
  are specified in the section titled <a href=
  "http://www.w3.org/TR/html5/Overview.html#the-lang-and-xml:lang-attributes">
  The lang and xml:lang attributes</a> in the HTML5 specification.

  <p>If an author is editing an HTML fragment and is unsure of the final
  encapsulating MIME type for their markup, it is suggested that the author
  specify both <code>lang</code> and <code>xml:lang</code> where the value in
  both attributes is exactly the same.</p>

  <h3 id="invalid-xmlliteral-values"><span class="secno">4.2</span> Invalid
  XMLLiteral values</h3>

  <p>When generating literals of type XMLLiteral, the processor must ensure
  that the output XMLLiteral is a namespace well-formed XML fragment. A
  namespace well-formed XML fragment has the following properties:</p>

  <ul>
    <li>The XML fragment, when placed inside of a single root element, must
    validate as well-formed XML. The normative language that describes a
    well-formed XML document is specified in <a href=
    "http://www.w3.org/TR/REC-xml/#sec-well-formed">Section 2.1 "Well-Formed
    XML Documents"</a> of the XML specification.</li>

    <li>A case-insensitive match for the currently active <code>xmlns</code>
    attribute as well as all currently active attributes starting with
    <code>xmlns:</code> must be preserved in the generated XMLLiteral. This
    preservation must be accomplished by placing all active namespaces in
    each top-level element in the generated XMLLiteral, taking care to not
    over-write pre-existing namespace values.</li>
  </ul>If the input is not a namespace well-formed XML fragment, the
  processor must transform the input text in a way that ensures the
  well-formedness rules described in this section. If a sequence of
  characters cannot be transformed into a namespace well-formed XML fragment,
  the triple containing the XMLLiteral must not be generated.

  <p>An RDFa Processor that transforms the XML fragment must use the <a href=
  "http://www.w3.org/TR/html5/Overview.html#coercing-an-html-dom-into-an-infoset">
  Coercing an HTML DOM into an Infoset</a> rules, as specified in the HTML5
  specification, prior to generating the triple containing the XMLLiteral.
  The serialization algorithm that must be used for generating the XMLLiteral
  is normatively defined in the <a href=
  "http://www.w3.org/TR/html5/Overview.html#serializing-xhtml-fragments">Serializing
  XHTML Fragments</a> section of the HTML5 specification.</p>

  <p>Transformation to a namespace well-formed XML fragment is required
  because an application that consumes XMLLiteral data expects that data to
  be a namespace well-formed XML fragment.</p>

  <p>The transformation requirement does not apply to input data that are
  text-only, such as literals that contain a <code>datatype</code> attribute
  with an empty value (<code>""</code>), or input data that that contain only
  text nodes.</p>

  <p>An example transformation demonstrating the preservation of namespace
  values is provided below. The &rarr; symbol is used to denote that the line
  is a continuation of the previous line and is included purely for the
  purposes of readability:</p>
  <pre>
&lt;p xmlns:ex="http://example.org/vocab#"      
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
 Two rectangles (the example markup for them are stored in a triple):
 &lt;svg xmlns="http://www.w3.org/2000/svg" property="ex:markup" datatype="rdf:XMLLiteral"&gt;
&rarr; &lt;rect width="300" height="100" 
&rarr; style="fill:rgb(0,0,255);stroke-width:1; stroke:rgb(0,0,0)"/&gt;
&rarr; &lt;rect width="50" height="50" 
&rarr; style="fill:rgb(255,0,0);stroke-width:2; 
&rarr; stroke:rgb(0,0,0)"/&gt;&lt;/svg&gt;
&lt;/p&gt;
   
</pre>The markup above should produce the following triple:
  <pre>
&lt;&gt; 
   &lt;http://example.org/vocab#markup&gt;
      "&lt;rect xmlns=\"http://www.w3.org/2000/svg\" width=\"300\" 
&rarr; height=\"100\" style=\"fill:rgb(0,0,255);stroke-width:1; stroke:rgb(0,0,0)\"/&gt;
&rarr; &lt;rect xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" 
&rarr; height=\"50\" style=\"fill:rgb(255,0,0);stroke-width:2; 
&rarr; stroke:rgb(0,0,0)\"/&gt;"^^http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral
   
</pre>Note the preservation of the SVG namespace by injecting a new
<code>xmlns</code> attribute. Since the <code>ex</code> and <code>rdf</code>
namespaces are not used in either <code>rect</code> element, they are not
preserved in the XMLLiteral.

  <h3 id="xmlns:-prefixed-attributes"><span class="secno">4.3</span>
  <code>xmlns:</code>-Prefixed Attributes</h3>

  <p class="XXX">While this section outlines xmlns: processing in RDFa, the
  support for distributed extensibility in non-XML mode HTML5 (using xmlns
  and xmlns:) is still an open issue. This section may be further modified
  before Last Call based on progress made on the distributed extensibility
  issue.</p>

  <p>CURIE prefix mappings specified using attributes prepended with
  <code>xmlns:</code> must be processed using the rules specified in
  <a
  href="http://www.w3.org/TR/rdfa-syntax/#s_curieprocessing">Section
  5.4, CURIE and URI Processing,</a> contained in the XHTML+RDFa
  specification.</p>

  <p>Since CURIE prefix mappings have been specified using
  <code>xmlns:</code>, and since HTML attribute names are case-insensitive,
  CURIE prefix names declared using the <code>xmlns:</code>attribute-name
  pattern <code>xmlns:&lt;PREFIX&gt;="&lt;URI&gt;"</code> should be specified
  using only lower-case characters. For example, the text
  "<code>xmlns:</code>" and the text in <code>"&lt;PREFIX&gt;"</code> should
  be lower-case only. This is to ensure that prefix mappings are interpreted
  in the same way between HTML (case-insensitive attribute names) and XHTML
  (case-sensitive attribute names) document types.</p>

  <h2 id="extensions-to-the-html5-syntax"><span class="secno">5</span>
  Extensions to the HTML5 Syntax</h2>

  <p class="XXX annotation"><b>Status:</b> <a href="http://www.w3.org/html/wg/tracker/issues/41">ISSUE-41</a> (decentralized extensibility) blocks progress to Last Call</p>


  <p><em>This section is normative.</em></p>

  <p>There are a few changes that are required to the HTML5 specification in
  order to fully support RDFa. The following sub-sections outline the
  necessary modifications to the base HTML5 specification.</p>

  <h3 id="the-rdfa-attributes-and-valid-values"><span class=
  "secno">5.1</span> The RDFa Attributes and Valid Values</h3>

  <p>All RDFa attributes and valid values (including CURIEs), as listed in
  <a href="http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes">Section 2.1:
  The RDFa Attributes</a>, are conforming when used in an HTML5 or XHTML5
  document.</p>

  <h3 id="conformance-criteria-for-xmlns:-prefixed-attributes"><span class=
  "secno">5.2</span> Conformance Criteria for <code>xmlns:</code>-Prefixed
  Attributes</h3>

  <p class="XXX">While this section outlines xmlns: conformance criteria for
  HTML+RDFa, the support for distributed extensibility in non-XML mode HTML5
  (using xmlns and xmlns:) is still an open issue. This section may be
  further modified before Last Call based on progress made on the distributed
  extensibility issue.</p>

  <p>Since RDFa uses attributes starting with <code>xmlns:</code> to specify
  CURIE prefixes, it is important that any attribute starting with a
  case-insensitive match on the text string "<code>xmlns:</code>" be
  preserved in the DOM or other tree-like model that is passed to the RDFa
  Processor. While it is specified that HTML5 must preserve these attributes
  in the DOM, it must also accept these attributes as conforming in non-XML
  HTML5. For documents conforming to this specification, attributes with
  names that have the case insensitive prefix "<code>xmlns:</code>" are
  conforming in both HTML5 and XHTML5.</p>

  <h3 id="preserving-namespaces-via-coercion-to-infoset"><span class=
  "secno">5.3</span> Preserving Namespaces via Coercion to Infoset</h3>

  <p class="XXX">This section needs feedback from the user agent vendors to
  ensure that this feature does not conflict with user agent architecture and
  has no technical reason that it cannot be implemented.</p>

  <p>RDFa is currently dependent on the <code>xmlns:</code> pattern to
  declare prefix mappings, it is imperative that namespace information that
  is declared in non-XML mode HTML5 documents are mapped to an Infoset
  correctly. In order to ensure this mapping is performed correctly, the
  "Coercing an HTML DOM into an infoset" rules defined in [<a href=
  "#refsHTML5">HTML5</a>] must be modified to include the following rule:</p>

  <p>If the XML API is namespace-aware, the tool must ensure that proper
  ([<a href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace
  name</a>], [<a href=
  "http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</a>],
  [<a href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized
  value</a>]) namespace tuples are created when converting the non-XML mode
  DOM into an Infoset.</p>

  <p>For example, given the following input text:</p>
  <pre>
       &lt;div xmlns:audio="http://purl.org/media/audio#"&gt;
    
</pre>The <code>div</code> element above, when coerced from an HTML DOM into
an Infoset, should contain an attribute in the [<a href=
"http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace
attributes</a>] list with a [namespace name] set to
"<code>http://www.w3.org/2000/xmlns/</code>", a [local name] set to
<code>audio</code>, and a [normalized value] of
"<code>http://purl.org/media/audio#</code>".

  <h2 id="infoset-based-processors"><span class="secno">6</span>
  Infoset-based Processors</h2>

  <p><em>This section is informative</em></p>

  <p>While the intent of the RDFa processing instructions were to provide a
  set of rules that are as language and toolchain agnostic as possible, for
  the sake of clarity, detailed methods of extracting RDFa content from
  processors operating on an XML Information Set are provided below.</p>

  <h3 id="processing-namespaced-rdfa-attributes"><span class=
  "secno">6.1</span> Processing Namespaced RDFa Attributes</h3>

  <p>Extracting namespaced RDFa attributes while operating from within an
  Infoset-based RDFa processor can be achieved using the following
  algorithm:</p>

  <p>While processing an element as described in [<a href=
  "#refsXHTMLRDFA">XHTML+RDFA</a>], Section 5.5, <a href=
  "http://www.w3.org/TR/rdfa-syntax/#T_URI_mapping">Step #2</a>:</p>

  <ol>
    <li>For each attribute in the [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace
    attributes</a>] list that has a [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.attribute">prefix</a>] value,
    create a [<a href="http://www.w3.org/TR/rdfa-syntax/#T_URI_mapping">URI
    mapping</a>] by storing the [prefix] as the value to be mapped, and the
    [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized
    value</a>] as the value to map.</li>

    <li>For each attribute in the in the [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</a>] list
    that has no value for [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.attribute">prefix</a>] and a
    [<a href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local
    name</a>] that starts with <code>xmlns:</code>, create a [<a href=
    "http://www.w3.org/TR/rdfa-syntax/#T_URI_mapping">URI mapping</a>] by
    storing the [local name] part with the <code>xmlns:</code> characters
    removed as the value to be mapped, and the [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized
    value</a>] as the value to map.<br>
    <br>
    <span class="XXX">Note: This step is unnecessary if the Infoset coercion
    rules preserve namespaces specified in non-XML mode.</span></li>
  </ol>

  <p>To demonstrate, assume that the following markup is processed by an
  Infoset-based RDFa processor:</p>
  <pre>
&lt;div xmlns:audio="http://purl.org/media/audio#" ...
</pre>After the markup is processed, there should exist a [URI mapping] in
the [local list of URI mappings] that contains a mapping from
<code>audio</code> to <code>http://purl.org/media/audio#</code>.

  <h3 id="processing-rdfa-attributes"><span class="secno">6.2</span>
  Processing RDFa Attributes</h3>

  <p>There are a number of non-prefixed attributes that are associated with
  RDFa Processing in HTML5. If an XML Information Set based RDFa processor is
  used to process these attributes, the following algorithm should be used to
  detect and extract the values of the attributes.</p>

  <p>While processing an element as described in [<a href=
  "#refsXHTMLRDFA">XHTML+RDFA</a>], Section 5.5, <a href=
  "http://www.w3.org/TR/rdfa-syntax/#T_current_element">Step #4 through Step
  #9</a>:</p>

  <ol>
    <li>For each RDFa attribute in the [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.attribute">attributes</a>]
    list that has a [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.attribute">prefix</a>]] with
    no value or a [prefix] with the value of
    <code>http://www.w3.org/1999/xhtml</code>, extract and use the [<a href=
    "http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized
    value</a>].</li>
  </ol>

  <h2 id="dom-level-2-based-processors"><span class="secno">7</span> DOM
  Level 2-based Processors</h2>

  <p><em>This section is informative</em></p>

  <p class="XXX">This mechanism should be double-checked against all of the
  RDFa Javascript implementations to ensure correctness.</p>

  <p>While the intent of the RDFa processing instructions were to provide a
  set of rules that are as language and toolchain agnostic as possible, for
  the sake of clarity, detailed methods of extracting RDFa content from
  processors operating in a DOM2 environment are provided below.</p>

  <h3 id="processing-namespaced-rdfa-attributes-0"><span class=
  "secno">7.1</span> Processing Namespaced RDFa Attributes</h3>

  <p>Extracting namespaced RDFa attributes while operating from within a DOM
  Level 2 based RDFa processor can be achieved using the following
  algorithm:</p>

  <p>While processing each [<a href=
  "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614">Element</a>]
  as described in [<a href="#refsXHTMLRDFA">XHTML+RDFA</a>], Section 5.5,
  <a href="http://www.w3.org/TR/rdfa-syntax/#T_URI_mapping">Step #2</a>:</p>

  <ol>
    <li>For each [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614">Attr</a>]
    in the [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247">Node.attributes</a>]
    list that has a [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/glossary.html#dt-namespaceprefix">namespace
    prefix</a>] value of <code>xmlns</code>, create a [<a href=
    "http://www.w3.org/TR/rdfa-syntax/#T_URI_mapping">URI mapping</a>] by
    storing the [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/glossary.html#dt-localname">local
    name</a>] as the value to be mapped, and the [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68D080">Node.nodeValue</a>]
    as the value to map.</li>

    <li>For each [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614">Attr</a>]
    in the [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247">Node.attributes</a>]
    list that has a [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/glossary.html#dt-namespaceprefix">namespace
    prefix</a>] value of null and a [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/glossary.html#dt-localname">local
    name</a>] that starts with <code>xmlns:</code>, create a [<a href=
    "http://www.w3.org/TR/rdfa-syntax/#T_URI_mapping">URI mapping</a>] by
    storing the [local name] part with the <code>xmlns:</code> characters
    removed as the value to be mapped, and the [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68D080">Node.nodeValue</a>]
    as the value to map.<br>
    <br>
    <span class="XXX">Note: This step is unnecessary if the XML and non-XML
    mode DOMs are namespace consistent.</span></li>
  </ol>

  <p>To demonstrate, assume that the following markup is processed by a
  DOM2-based RDFa processor:</p>
  <pre>
&lt;div xmlns:audio="http://purl.org/media/audio#" ...
</pre>After the markup is processed, there should exist a [URI mapping] in
the [local list of URI mappings] that contains a mapping from
<code>audio</code> to <code>http://purl.org/media/audio#</code>.

  <h3 id="processing-rdfa-attributes-0"><span class="secno">7.2</span>
  Processing RDFa Attributes</h3>

  <p>There are a number of non-prefixed attributes that are associated with
  RDFa processing in HTML5. If an DOM2-based RDFa processor is used to
  process these attributes, the following algorithm should be used to detect
  and extract the values of the attributes.</p>

  <p>While processing an element as described in [<a href=
  "#refsXHTMLRDFA">XHTML+RDFA</a>], Section 5.5, <a href=
  "http://www.w3.org/TR/rdfa-syntax/#T_current_element">Step #4 through Step
  #9</a>:</p>

  <ol>
    <li>For each RDFa attribute in the [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-84CF096">Node.attributes</a>] list that has a [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/glossary.html#dt-namespaceprefix">namespace
    prefix</a>] that is null or a [namespace prefix] with the value of
    <code>http://www.w3.org/1999/xhtml</code>, extract and use the [<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68D080">Node.nodeValue</a>]
    as the value.</li>
  </ol>

  <h2 id="references"><span class="secno">8</span> References</h2>

  <h3 id="normative-references"><span class="secno">8.1</span> Normative
  References</h3>

  <dl>
    <dt id="refsHTML5">[<a href="http://www.w3.org/TR/html5/">HTML5</a>]
    (currently not a REC)</dt>

    <dd>The HTML5 Specification, Ian Hickson. W3C, Work in Progress</dd>

    <dt id="refsRFC2119">[<a href=
    "http://www.ietf.org/rfc/rfc2119.txt">RFC2119</a>]</dt>

    <dd>RFC2119: Key words for use in RFCs to Indicate Requirement Levels, S.
    Bradner. IETF, March 1997.</dd>

    <dt id="refsXHTMLRDFA">[<a href=
    "http://www.w3.org/TR/rdfa-syntax/">XHTML+RDFA</a>]</dt>

    <dd>RDFa in XHTML: Syntax and Processing, Mark Birbeck, Shane McCarron,
    Steven Pemberton. W3C, October 2008.</dd>

    <dt id="refsDOM2">[<a href=
    "http://www.w3.org/TR/DOM-Level-2-Core/">DOM2</a>]</dt>

    <dd>Document Object Model (DOM) Level 2 Core Specification, Arnaud Le
    Hors, Philippe Le H&eacute;garet, Lauren Wood, Gavin Nicol, Jonathan
    Robie, Mike Champion, Steve Byrne, W3C, November 2000</dd>

    <dt id="refsInfoset">[<a href=
    "http://www.w3.org/TR/xml-infoset/">INFOSET</a>]</dt>

    <dd>XML Information Set (Second Edition), John Cowan, Richard Tobin, W3C,
    February 2004</dd>
  </dl>

  <h3 id="non-normative-references"><span class="secno">8.2</span>
  Non-Normative References</h3>

  <dl>
    <dt id="refsXHTMLRDF">[<a href=
    "http://www.w3.org/MarkUp/2004/02/xhtml-rdf.html">XHTMLRDF</a>]</dt>

    <dd>XHTML and RDF, Mark Birbeck. W3C, February 2004.</dd>
  </dl>
</body>
</html>