index.html 172 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 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for Windows (vers 14 February 2006), see www.w3.org" />
<title>XSLT 2.0 and XQuery 1.0 Serialization (Second
Edition)</title>

<style type="text/css">
/*<![CDATA[*/
code           { font-family: monospace; }

div.constraint,
div.issue,
div.note,
div.notice     { margin-left: 2em; }

div.issue
p.title        { margin-left: -2em; }

ol.enumar      { list-style-type: decimal; }
ol.enumla      { list-style-type: lower-alpha; }
ol.enumlr      { list-style-type: lower-roman; }
ol.enumua      { list-style-type: upper-alpha; }
ol.enumur      { list-style-type: upper-roman; }

li p           { margin-top: 0.3em;
                 margin-bottom: 0.3em; }

sup small      { font-style: italic;
                 color: #8F8F8F;
               }
    
div.exampleInner pre { margin-left: 1em;
                       margin-top: 0em; margin-bottom: 0em}
div.exampleOuter {border: 4px double gray;
                  margin: 0em; padding: 0em}
div.exampleInner { background-color: #d5dee3;
                   border-top-width: 4px;
                   border-top-style: double;
                   border-top-color: #d3d3d3;
                   border-bottom-width: 4px;
                   border-bottom-style: double;
                   border-bottom-color: #d3d3d3;
                   padding: 4px; margin: 0em }
div.exampleWrapper { margin: 4px }
div.exampleHeader { font-weight: bold;
                    margin: 4px}

div.issue { border-bottom-color: black;
            border-bottom-style: solid;
            border-bottom-width: 1pt;
            margin-bottom: 20pt;
}

th.issue-toc-head { border-bottom-color: black;
                    border-bottom-style: solid;
                    border-bottom-width: 1pt;
}

      
      .termdef     { color: rgb(133,0,033);
                   }
      .aside       { border-left: 4px solid green;
                     background-color: #EEFFEE;
                     padding-left: 1em;
                     font-size: small;
                   }

      .node-summary table       { margin-left: 1em;
                                }
      .node-summary thead td    { font-weight: bold;
                                }
      .node-summary td          { padding-left: 1em;
                                  padding-right: 1em;
                                  border-bottom: 1px solid gray;
                                }

      .infoset-mapping table    { margin-left: 1em;
                                }
      .infoset-mapping thead td { font-weight: bold;
                                }
      .infoset-mapping td       { padding-left: 1em;
                                  padding-right: 1em;
                                }

      .issue-closed             { color: green;
                                }

      .issue-resolved           { color: red;
                                }

      .issue-open               { color: red;
                                }

div.schemaComp  { border: 4px double gray;
                  margin: 0em 1em;
                  padding: 0em;
                }
div.compHeader  { margin: 4px;
                  font-weight: bold;
                }
span.schemaComp { background-color: white;
                  color: #A52A2A;
                }
div.compBody    { border-top-width: 4px;
                  border-top-style: double;
                  border-top-color: #d3d3d3;
                  padding: 4px;
                  margin: 0em;
                }

div.exampleInner { background-color: #d5dee3;
                   color: black;
                   border-top-width: 4px;
                   border-top-style: double;
                   border-top-color: #d3d3d3;
                   border-bottom-width: 4px;
                   border-bottom-style: double;
                   border-bottom-color: #d3d3d3;
                   padding: 4px;
                   margin: 0em;
                 }

div.issueBody    { margin-left: 0.25in;
                 }

code.function    { font-weight: bold;
                 }
code.return-type { font-style: italic;
                 }
code.type        { font-style: italic;
                 }
code.as          { font-style: normal;
                 }
code.arg         {
                 }
code.strikeout   { text-decoration: line-through;
                 }
p.table.footnote { font-size: 8pt;
                 }

span.function    { font-family: monospace;
                 }

span.prefix      { font-style: italic;
                 }

tr.document               { background-color: #FFD4EA; }
tr.element                { background-color: #96E3D1; }
tr.attribute              { background-color: #E7E6FF; }
tr.text                   { background-color: #FFFFC2; }
tr.processing-instruction { background-color: #E5FDFE; }
tr.comment                { background-color: #E1E1E1; }
tr.namespace              { background-color: #E7E6FF; }

/*]]>*/
</style>
<link rel="stylesheet" type="text/css" href=
"http://www.w3.org/StyleSheets/TR/W3C-REC.css" />
<link rel="TableOfContents" title="1 Introduction" href="#intro" />
<link rel="TableOfContents" title="1.1 Terminology" href=
"#terminology" />
<link rel="TableOfContents" title="2 Sequence Normalization" href=
"#serdm" />
<link rel="TableOfContents" title="3 Serialization Parameters"
href="#serparam" />
<link rel="TableOfContents" title="4 Phases of Serialization" href=
"#serphases" />
<link rel="TableOfContents" title="5 XML Output Method" href=
"#xml-output" />
<link rel="TableOfContents" title=
"5.1 The Influence of Serialization Parameters upon the XML Output Method"
href="#XML_PARAMS" />
<link rel="TableOfContents" title="6 XHTML Output Method" href=
"#xhtml-output" />
<link rel="TableOfContents" title=
"6.1 The Influence of Serialization Parameters upon the XHTML Output Method"
href="#XHTML_PARAMS" />
<link rel="TableOfContents" title="7 HTML Output Method" href=
"#html-output" />
<link rel="TableOfContents" title="7.1 Markup for Elements" href=
"#HTML_MARKUP" />
<link rel="TableOfContents" title="7.2 Writing Attributes" href=
"#HTML_ATTRIBS" />
<link rel="TableOfContents" title="7.3 Writing Character Data"
href="#HTML_CHARDATA" />
<link rel="TableOfContents" title=
"7.4 The Influence of Serialization Parameters upon the HTML Output Method"
href="#HTML_PARAMS" />
<link rel="TableOfContents" title="8 Text Output Method" href=
"#text-output" />
<link rel="TableOfContents" title=
"8.1 The Influence of Serialization Parameters upon the Text Output Method"
href="#TEXT_PARAMS" />
<link rel="TableOfContents" title="9 Character Maps" href=
"#character-maps" />
<link rel="TableOfContents" title="10 Conformance" href=
"#conformance" />
<link rel="TableOfContents" title="A References" href=
"#references" />
<link rel="TableOfContents" title="A.1 Normative References" href=
"#normative-references" />
<link rel="TableOfContents" title="A.2 Informative References"
href="#informative-references" />
<link rel="TableOfContents" title="B Summary of Error Conditions"
href="#id-errors" />
<link rel="TableOfContents" title="C List of URI Attributes" href=
"#list-of-uri-attributes" />
<link rel="TableOfContents" title=
"D Checklist of Implementation-Defined Features" href=
"#implementation-defined-features" />
<link rel="TableOfContents" title=
"E Changes since the First Edition" href=
"#changes-since-edition-1" />
<link rel="TableOfContents" href="#accessors-list" title=
"F Accessor Summary" />
<link rel="TableOfContents" href="#infoset-construction-summary"
title="G Infoset Construction Summary" />
<link rel="TableOfContents" href="#psvi-construction-summary"
title="H PSVI Construction Summary" />
<link rel="TableOfContents" href="#infoset-mapping-summary" title=
"I Infoset Mapping Summary" />
</head>
<body>
<div class="head">
<p><a href="http://www.w3.org/"><img src=
"http://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width=
"72" /></a></p>
<h1><a name="title" id="title"></a>XSLT 2.0 and XQuery 1.0
Serialization (Second Edition)</h1>
<h2><a name="w3c-doctype" id="w3c-doctype"></a>W3C Recommendation
14 December 2010</h2>
<dl>
<dt>This version:</dt>
<dd><a href=
"http://www.w3.org/TR/2010/REC-xslt-xquery-serialization-20101214/">
http://www.w3.org/TR/2010/REC-xslt-xquery-serialization-20101214/</a></dd>
<dt>Latest version:</dt>
<dd><a href=
"http://www.w3.org/TR/xslt-xquery-serialization/">http://www.w3.org/TR/xslt-xquery-serialization/</a></dd>
<dt>Previous versions:</dt>
<dd><a href=
"http://www.w3.org/TR/2009/PER-xslt-xquery-serialization-20090421/">
http://www.w3.org/TR/2009/PER-xslt-xquery-serialization-20090421/,</a>
<a href=
"http://www.w3.org/TR/2007/REC-xslt-xquery-serialization-20070123/">
http://www.w3.org/TR/2007/REC-xslt-xquery-serialization-20070123/</a></dd>
<dt>Editors:</dt>
<dd>Scott Boag, IBM <a href=
"mailto:scott_boag@us.ibm.com">&lt;scott_boag@us.ibm.com&gt;</a></dd>
<dd>Michael Kay, Saxonica <a href=
"http://www.saxonica.com">&lt;http://www.saxonica.com&gt;</a></dd>
<dd>Joanne Tong, IBM <a href=
"mailto:joannet@ca.ibm.com">&lt;joannet@ca.ibm.com&gt;</a></dd>
<dd>Norman Walsh, Mark Logic <a href=
"mailto:Norman.Walsh@marklogic.com">&lt;Norman.Walsh@marklogic.com&gt;</a></dd>
<dd>Henry Zongaro, IBM <a href=
"mailto:zongaro@ca.ibm.com">&lt;zongaro@ca.ibm.com&gt;</a></dd>
</dl>
<p>Please refer to the <a href=
"http://www.w3.org/XML/2010/qt-errata/xslt-xquery-serialization-errata2e.html">
<strong>errata</strong></a> for this document, which may include
some normative corrections.</p>
<p>See also <a href=
"http://www.w3.org/2003/03/Translations/byTechnology?technology=xslt-xquery-serialization">
<strong>translations</strong></a>.</p>
<p>This document is also available in these non-normative formats:
<a href=
"http://www.w3.org/TR/2010/REC-xslt-xquery-serialization-20101214/xslt-xquery-serialization-20101214.xml">
XML</a> and&#160;<a href=
"http://www.w3.org/TR/2010/REC-xslt-xquery-serialization-20101214/xslt-xquery-serialization-diff-from-REC20070123.html">Change
markings relative to first edition</a>.</p>
<p class="copyright"><a href=
"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>&#160;©&#160;2010&#160;<a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup>
(<a href="http://www.csail.mit.edu/"><acronym title=
"Massachusetts Institute of Technology">MIT</acronym></a>, <a href=
"http://www.ercim.eu/"><acronym title=
"European Research Consortium for Informatics and Mathematics">ERCIM</acronym></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 />
<div>
<h2><a name="abstract" id="abstract"></a>Abstract</h2>
<p>This document defines serialization of an instance of the data
model as defined in <a href="#xpath-datamodel">[XQuery 1.0 and
XPath 2.0 Data Model]</a> into a sequence of octets. Serialization
is designed to be a component that can be used by other
specifications such as <a href="#xslt20">[XSL Transformations
(XSLT) Version 2.0]</a> or <a href="#xquery">[XQuery 1.0: An XML
Query Language]</a>.</p>
</div>
<div>
<h2><a name="status" id="status"></a>Status of this Document</h2>
<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 one document in a set of eight documents that are being
progressed to Edited Recommendation together (XPath 2.0, XQuery
1.0, XQueryX 1.0, XSLT 2.0, Data Model (XDM), Functions and
Operators, Formal Semantics, Serialization).</p>
<p>This document, published on 14 December 2010, is an Edited
<a href=
"http://www.w3.org/2004/02/Process-20040205/tr.html#RecsW3C">Recommendation</a>
of the W3C. This second edition is not a new version of this
specification; its purpose is to clarify a number of issues that
have become apparent since the first edition was published. All of
these clarifications (excepting trivial editorial fixes) have been
published in a separate errata document, and published in a
<a href="http://www.w3.org/2004/02/Process-20040205/tr.html#ProposedEditedRec">
Proposed Edited Recommendation</a> in April, 2009. The changes are
summarized in an appendix.</p>
<p>This document has been jointly developed by the W3C <a href=
"http://www.w3.org/XML/Query/">XML Query Working Group</a> and the
W3C <a href="http://www.w3.org/Style/XSL/">XSL Working Group</a>,
each of which is part of the <a href=
"http://www.w3.org/XML/Activity">XML Activity</a>.</p>
<p>This document has been reviewed by W3C Members, by software
developers, and by other W3C groups and interested parties, and is
endorsed by the Director as a W3C Recommendation. It is a stable
document and may be used as reference material or cited from
another document. W3C's role in making the Recommendation is to
draw attention to the specification and to promote its widespread
deployment. This enhances the functionality and interoperability of
the Web.</p>
<p>This document incorporates changes made against the <a href=
"http://www.w3.org/2004/02/Process-20040205/tr.html#RecsW3C">Recommendation</a>
of 23 January 2007 that resolve all errata known at the date of
publication. A list of the errata that have been applied, with
links to the Bugzilla database, is provided in <a href=
"#changes-since-edition-1"><b>E Changes since the First
Edition</b></a>. The version of this document with change
highlighting indicates where the textual changes have been made,
and cross-references each textual change to the erratum where it
originated. This document supersedes the <a href=
"http://www.w3.org/TR/2007/REC-xslt-xquery-serialization-20070123/">
first edition</a>.</p>
<p>This specification is designed to be referred to normatively
from other specifications defining a host language for it; it is
not intended to be implemented outside a host language. The
implementability of this specification has been tested in the
context of its normative inclusion in host languages defined by the
<a href="http://www.w3.org/TR/xquery/">XQuery 1.0</a> and <a href=
"http://www.w3.org/TR/xslt20/">XSLT 2.0</a> specifications; see the
<a href=
"http://www.w3.org/XML/Query/test-suite/XQTSReport.html">XQuery 1.0
implementation report</a> and the <a href=
"http://www.w3.org/XML/Group/xslt20-test/Documentation/reportSummary.html">
XSLT 2.0 implementation report</a> (member-only) for details.</p>
<p>Please report errors in and submit comments on this document
using W3C's <a href="http://www.w3.org/Bugs/Public/">public
Bugzilla system</a> (instructions can be found at <a href=
"http://www.w3.org/XML/2005/04/qt-bugzilla">http://www.w3.org/XML/2005/04/qt-bugzilla</a>).
If access to that system is not feasible, you may send your
comments to the W3C XSLT/XPath/XQuery public comments mailing list,
<a href=
"mailto:public-qt-comments@w3.org">public-qt-comments@w3.org</a>.
It will be very helpful if you include the string "[SER]" in the
subject line of your report, whether made in Bugzilla or in email.
Each Bugzilla entry and email message should contain only one error
report. Archives of the comments and responses are available at
<a href=
"http://lists.w3.org/Archives/Public/public-qt-comments/">http://lists.w3.org/Archives/Public/public-qt-comments/</a>.</p>
<p>This document was produced by groups 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/18797/status#disclosures">public
list of any patent disclosures</a> made in connection with the
deliverables of the XML Query Working Group and also maintains a
<a href=
"http://www.w3.org/2004/01/pp-impl/19552/status#disclosures">public
list of any patent disclosures</a> made in connection with the
deliverables of the XSL Working Group; those pages also include
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>
</div>
<div class="toc">
<h2><a name="contents" id="contents"></a>Table of Contents</h2>
<p class="toc">1 <a href="#intro">Introduction</a><br />
&#160;&#160;&#160;&#160;1.1 <a href=
"#terminology">Terminology</a><br />
2 <a href="#serdm">Sequence Normalization</a><br />
3 <a href="#serparam">Serialization Parameters</a><br />
4 <a href="#serphases">Phases of Serialization</a><br />
5 <a href="#xml-output">XML Output Method</a><br />
&#160;&#160;&#160;&#160;5.1 <a href="#XML_PARAMS">The Influence of
Serialization Parameters upon the XML Output Method</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.1 <a href=
"#XML_VERSION">XML Output Method: the version Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.2 <a href=
"#XML_ENCODING">XML Output Method: the encoding Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.3 <a href=
"#xml-indent">XML Output Method: the indent Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.4 <a href=
"#XML_CDATA-SECTION-ELEMENTS">XML Output Method: the
cdata-section-elements Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.5 <a href=
"#XML_OMIT-XML-DECLARATION">XML Output Method: the
omit-xml-declaration and standalone Parameters</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.6 <a href=
"#XML_DOCTYPE">XML Output Method: the doctype-system and
doctype-public Parameters</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.7 <a href=
"#xml-undeclare-NS">XML Output Method: the undeclare-prefixes
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.8 <a href=
"#XML_NORMALIZATION-FORM">XML Output Method: the normalization-form
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.9 <a href=
"#XML_MEDIA-TYPE">XML Output Method: the media-type
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.10 <a href=
"#XML_USE-CHARACTER-MAPS">XML Output Method: the use-character-maps
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.11 <a href=
"#XML_BYTE-ORDER-MARK">XML Output Method: the byte-order-mark
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.12 <a href=
"#XML_ESCAPE-URI-ATTRIBUTES">XML Output Method: the
escape-uri-attributes Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5.1.13 <a href=
"#XML_INCLUDE-CONTENT-TYPE">XML Output Method: the
include-content-type Parameter</a><br />
6 <a href="#xhtml-output">XHTML Output Method</a><br />
&#160;&#160;&#160;&#160;6.1 <a href="#XHTML_PARAMS">The Influence
of Serialization Parameters upon the XHTML Output Method</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.1 <a href=
"#XHTML_VERSION">XHTML Output Method: the version
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.2 <a href=
"#XHTML_ENCODING">XHTML Output Method: the encoding
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.3 <a href=
"#XHTML_INDENT">XHTML Output Method: the indent Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.4 <a href=
"#XHTML_CDATA-SECTION-ELEMENTS">XHTML Output Method: the
cdata-section-elements Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.5 <a href=
"#XHTML_OMIT-XML-DECLARATION">XHTML Output Method: the
omit-xml-declaration and standalone Parameters</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.6 <a href=
"#XHTML_DOCTYPE">XHTML Output Method: the doctype-system and
doctype-public Parameters</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.7 <a href=
"#XHTML_UNDECLARE-PREFIXES">XHTML Output Method: the
undeclare-prefixes Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.8 <a href=
"#XHTML_NORMALIZATION-FORM">XHTML Output Method: the
normalization-form Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.9 <a href=
"#XHTML_MEDIA-TYPE">XHTML Output Method: the media-type
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.10 <a href=
"#XHTML_USE-CHARACTER-MAPS">XHTML Output Method: the
use-character-maps Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.11 <a href=
"#XHTML_BYTE-ORDER-MARK">XHTML Output Method: the byte-order-mark
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.12 <a href=
"#XHTML_ESCAPE-URI-ATTRIBUTES">XHTML Output Method: the
escape-uri-attributes Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;6.1.13 <a href=
"#XHTML_INCLUDE-CONTENT-TYPE">XHTML Output Method: the
include-content-type Parameter</a><br />
7 <a href="#html-output">HTML Output Method</a><br />
&#160;&#160;&#160;&#160;7.1 <a href="#HTML_MARKUP">Markup for
Elements</a><br />
&#160;&#160;&#160;&#160;7.2 <a href="#HTML_ATTRIBS">Writing
Attributes</a><br />
&#160;&#160;&#160;&#160;7.3 <a href="#HTML_CHARDATA">Writing
Character Data</a><br />
&#160;&#160;&#160;&#160;7.4 <a href="#HTML_PARAMS">The Influence of
Serialization Parameters upon the HTML Output Method</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.1 <a href=
"#HTML_VERSION">HTML Output Method: the version Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.2 <a href=
"#HTML_ENCODING">HTML Output Method: the encoding
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.3 <a href=
"#HTML_INDENT">HTML Output Method: the indent Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.4 <a href=
"#HTML_CDATA-SECTION-ELEMENTS">HTML Output Method: the
cdata-section-elements Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.5 <a href=
"#HTML_OMIT-XML-DECLARATION">HTML Output Method: the
omit-xml-declaration and standalone Parameters</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.6 <a href=
"#HTML_DOCTYPE">HTML Output Method: the doctype-system and
doctype-public Parameters</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.7 <a href=
"#HTML_UNDECLARE-PREFIXES">HTML Output Method: the
undeclare-prefixes Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.8 <a href=
"#HTML_NORMALIZATION-FORM">HTML Output Method: the
normalization-form Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.9 <a href=
"#HTML_MEDIA-TYPE">HTML Output Method: the media-type
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.10 <a href=
"#HTML_USE-CHARACTER-MAPS">HTML Output Method: the
use-character-maps Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.11 <a href=
"#HTML_BYTE-ORDER-MARK">HTML Output Method: the byte-order-mark
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.12 <a href=
"#HTML_ESCAPE-URI-ATTRIBUTES">HTML Output Method: the
escape-uri-attributes Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;7.4.13 <a href=
"#HTML_INCLUDE-CONTENT-TYPE">HTML Output Method: the
include-content-type Parameter</a><br />
8 <a href="#text-output">Text Output Method</a><br />
&#160;&#160;&#160;&#160;8.1 <a href="#TEXT_PARAMS">The Influence of
Serialization Parameters upon the Text Output Method</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.1 <a href=
"#TEXT_VERSION">Text Output Method: the version Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.2 <a href=
"#TEXT_ENCODING">Text Output Method: the encoding
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.3 <a href=
"#TEXT_INDENT">Text Output Method: the indent Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.4 <a href=
"#TEXT_CDATA-SECTION-ELEMENTS">Text Output Method: the
cdata-section-elements Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.5 <a href=
"#TEXT_OMIT-XML-DECLARATION">Text Output Method: the
omit-xml-declaration and standalone Parameters</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.6 <a href=
"#TEXT_DOCTYPE">Text Output Method: the doctype-system and
doctype-public Parameters</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.7 <a href=
"#TEXT_UNDECLARE-PREFIXES">Text Output Method: the
undeclare-prefixes Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.8 <a href=
"#TEXT_NORMALIZATION-FORM">Text Output Method: the
normalization-form Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.9 <a href=
"#TEXT_MEDIA-TYPE">Text Output Method: the media-type
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.10 <a href=
"#TEXT_USE-CHARACTER-MAPS">Text Output Method: the
use-character-maps Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.11 <a href=
"#TEXT_BYTE-ORDER-MARK">Text Output Method: the byte-order-mark
Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.12 <a href=
"#TEXT_ESCAPE-URI-ATTRIBUTES">Text Output Method: the
escape-uri-attributes Parameter</a><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;8.1.13 <a href=
"#TEXT_INCLUDE-CONTENT-TYPE">Text Output Method: the
include-content-type Parameter</a><br />
9 <a href="#character-maps">Character Maps</a><br />
10 <a href="#conformance">Conformance</a><br /></p>
<h3><a name="appendices" id="appendices"></a>Appendices</h3>
<p class="toc">A <a href="#references">References</a><br />
&#160;&#160;&#160;&#160;A.1 <a href=
"#normative-references">Normative References</a><br />
&#160;&#160;&#160;&#160;A.2 <a href=
"#informative-references">Informative References</a><br />
B <a href="#id-errors">Summary of Error Conditions</a><br />
C <a href="#list-of-uri-attributes">List of URI
Attributes</a><br />
D <a href="#implementation-defined-features">Checklist of
Implementation-Defined Features</a> (Non-Normative)<br />
E <a href="#changes-since-edition-1">Changes since the First
Edition</a> (Non-Normative)<br /></p>
</div>
<hr />
<div class="body">
<div class="div1">
<h2><a name="intro" id="intro"></a>1 Introduction</h2>
<p>This document defines serialization of the W3C XQuery 1.0 and
XPath 2.0 Data Model (XDM), which is the data model of at least
<a href="#xpath20">[XML Path Language (XPath) 2.0]</a>, <a href=
"#xslt20">[XSL Transformations (XSLT) Version 2.0]</a>, and
<a href="#xquery">[XQuery 1.0: An XML Query Language]</a>, and any
other specifications that reference it.</p>
<p>Serialization is the process of converting an instance of the
<a href="#xpath-datamodel">[XQuery 1.0 and XPath 2.0 Data
Model]</a> into a sequence of octets. Serialization is well-defined
for most data model instances.</p>
<div class="div2">
<h3><a name="terminology" id="terminology"></a>1.1 Terminology</h3>
<p>In this specification, where they appear in upper case, the
words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", "MAY",
"REQUIRED", and "RECOMMENDED" are to be interpreted as described in
<a href="#RFC2119">[RFC2119]</a>.</p>
<p>[<a name="serializer" id="serializer" title=
"serializer">Definition</a>: As is indicated in <a href=
"#conformance"><b>10 Conformance</b></a>, conformance criteria for
serialization are determined by other specifications that refer to
this specification. A <b>serializer</b> is software that implements
some or all of the requirements of this specification in accordance
with such conformance criteria.] A serializer is not
<strong>REQUIRED</strong> to directly provide a programming
interface that permits a user to set serialization parameters or to
provide an input sequence for serialization. <span>In this
document, material labeled as "Note" and examples are provided for
explanatory purposes and are not normative.</span></p>
<p>Certain aspects of serialization are described in this
specification as <a title="implementation-defined" href=
"#impdef">implementation-defined</a> or <a title=
"implementation-dependent" href=
"#impdep">implementation-dependent</a>.</p>
<p>[<a name="impdef" id="impdef" title=
"implementation-defined">Definition</a>:
<b>Implementation-defined</b> indicates an aspect that
<strong>MAY</strong> differ between <a title="serializer" href=
"#serializer">serializers</a>, but whose actual behavior
<strong>MUST</strong> be specified either by another specification
that sets conformance criteria for serialization (see <a href=
"#conformance"><b>10 Conformance</b></a>) or in documentation that
accompanies the <a title="serializer" href=
"#serializer">serializer</a>.]</p>
<p>[<a name="impdep" id="impdep" title=
"implementation-dependent">Definition</a>:
<b>Implementation-dependent</b> indicates an aspect that
<strong>MAY</strong> differ between <a title="serializer" href=
"#serializer">serializers</a>, and whose actual behavior is not
<strong>REQUIRED</strong> to be specified either by another
specification that sets conformance criteria for serialization (see
<a href="#conformance"><b>10 Conformance</b></a>) or in
documentation that accompanies the <a title="serializer" href=
"#serializer">serializer</a>.]</p>
<p>[<a name="serial-err" id="serial-err" title=
"serialization error">Definition</a>: In some instances, the
sequence that is input to serialization cannot be successfully
converted into a sequence of octets given the set of serialization
parameter (<a href="#serparam"><b>3 Serialization
Parameters</b></a>) values specified. A <b>serialization error</b>
is said to occur in such an instance.] In some cases, a <a title=
"serializer" href="#serializer">serializer</a> is
<strong>REQUIRED</strong> to signal such an error. What it means to
signal a serialization error is determined by the relevant
conformance criteria (<a href="#conformance"><b>10
Conformance</b></a>) to which the <a title="serializer" href=
"#serializer">serializer</a> conforms. In other cases, there is an
<a title="implementation-defined" href=
"#impdef">implementation-defined</a> choice between signaling a
serialization error and performing a recovery action. Such a
recovery action will allow a <a title="serializer" href=
"#serializer">serializer</a> to produce a sequence of octets that
might not fully reflect the usual requirements of the parameter
settings that are in effect.</p>
<p>Many terms used in this document are defined in the XPath
specification <a href="#xpath20">[XML Path Language (XPath)
2.0]</a> or the Data Model specification <a href=
"#xpath-datamodel">[XQuery 1.0 and XPath 2.0 Data Model]</a>.
Particular attention is drawn to the following:</p>
<ul>
<li>
<p>[<a name="dt-atomization" id="dt-atomization" title=
"atomize">Definition</a>: The term <b>atomization</b> is defined in
<a href="http://www.w3.org/TR/xpath20/#id-atomization">Section
2.4.2 Atomization</a><sup><small>XP</small></sup>. It is a process
that takes as input a sequence of <a title="node" href=
"#dt-node">nodes</a> and <a href=
"http://www.w3.org/TR/xpath20/#dt-atomic-value">atomic
values</a><sup><small>XP</small></sup>, and returns a sequence of
<a href="http://www.w3.org/TR/xpath20/#dt-atomic-value">atomic
values</a><sup><small>XP</small></sup>, in which the <a title=
"node" href="#dt-node">nodes</a> are replaced by their <a href=
"http://www.w3.org/TR/xpath20/#dt-typed-value">typed
values</a><sup><small>XP</small></sup> as defined in <a href=
"#xpath-datamodel">[XQuery 1.0 and XPath 2.0 Data Model]</a>.]</p>
</li>
<li>
<p>[<a name="dt-node" id="dt-node" title="node">Definition</a>: The
term <b>Node</b> is defined as part of <a href=
"http://www.w3.org/TR/xpath-datamodel/#Node">Section 6
Nodes</a><sup><small>DM</small></sup>. There are seven kinds of
<a title="node" href="#dt-node">nodes</a> in the data model:
document, element, attribute, text, namespace, processing
instruction, and comment.]</p>
</li>
<li>
<p>[<a name="dt-sequence" id="dt-sequence" title=
"sequence">Definition</a>: The term <b>sequence</b> is defined in
<a href="http://www.w3.org/TR/xpath20/#id-basics">Section 2
Basics</a><sup><small>XP</small></sup>. A <a title="sequence" href=
"#dt-sequence">sequence</a> is an ordered collection of zero or
more items.]</p>
</li>
<li>
<p>[<a name="dt-string-value" id="dt-string-value" title=
"string value">Definition</a>: The term <b>string value</b> is
defined in <a href=
"http://www.w3.org/TR/xpath-datamodel/#dm-string-value">Section
5.13 string-value Accessor</a><sup><small>DM</small></sup>. Every
<a title="node" href="#dt-node">node</a> has a <a title=
"string value" href="#dt-string-value">string value</a>. For
example, the <a title="string value" href="#dt-string-value">string
value</a> of an element is the concatenation of the <a title=
"string value" href="#dt-string-value">string values</a> of all its
descendant text <a title="node" href="#dt-node">nodes</a>.]</p>
</li>
<li>
<p>[<a name="dt-expanded-qname" id="dt-expanded-qname" title=
"expanded QName">Definition</a>: The term <b>expanded QName</b> is
defined in <a href=
"http://www.w3.org/TR/xpath20/#id-basics">Section 2
Basics</a><sup><small>XP</small></sup>. An <a title=
"expanded QName" href="#dt-expanded-qname">expanded QName</a>
consists of an optional namespace URI and a local name. An
<a title="expanded QName" href="#dt-expanded-qname">expanded
QName</a> also retains its original namespace prefix (if any), to
facilitate casting the expanded QName into a string.]</p>
</li>
<li>
<p>[<a name="null-namespace-URI" id="null-namespace-URI" title=
"null namespace URI">Definition</a>: An element or attribute that
is in no namespace, or an <a title="expanded QName" href=
"#dt-expanded-qname">expanded-QName</a> whose namespace part is an
empty sequence, is referred to as having a <b>null namespace
URI</b>].</p>
</li>
<li>
<p>[<a name="non-null-namespace-URI" id="non-null-namespace-URI"
title="non-null namespace URI">Definition</a>: An element or
attribute that does not have a <a title="null namespace URI" href=
"#null-namespace-URI">null namespace URI</a>, is referred to as
having a <b>non-null namespace URI</b>].</p>
</li>
</ul>
</div>
</div>
<div class="div1">
<h2><a name="serdm" id="serdm"></a>2 Sequence Normalization</h2>
<p>An instance of the data model that is input to the serialization
process is a sequence. Prior to serializing a sequence using any of
the output methods whose behavior is specified by this document
(<a href="#serparam"><b>3 Serialization Parameters</b></a>), the
<a title="serializer" href="#serializer">serializer</a>
<strong>MUST</strong> first compute a normalized sequence for
serialization; it is the normalized sequence that is actually
serialized. [<a name="sequence-normalization" id=
"sequence-normalization" title=
"sequence normalization">Definition</a>: The purpose of <b>sequence
normalization</b> is to create a sequence that can be serialized as
a well-formed XML document or external general parsed entity, that
also reflects the content of the input sequence to the extent
possible.] [<a name="result-tree" id="result-tree" title=
"result tree">Definition</a>: The result of the <a title=
"sequence normalization" href="#sequence-normalization">sequence
normalization</a> process is a <b>result tree</b>.]</p>
<p>The normalized sequence for serialization is constructed by
applying all of the following rules in order, with the initial
sequence being input to the first step, and the sequence that
results from any step being used as input to the subsequent step.
For any <a title="implementation-defined" href=
"#impdef">implementation-defined</a> output method, it is <a title=
"implementation-defined" href="#impdef">implementation-defined</a>
whether this sequence normalization process takes place.</p>
<p>Where the process of converting the input sequence to a
normalized sequence indicates that a value <strong>MUST</strong> be
cast to <code>xs:string</code>, that operation is defined in
<a href=
"http://www.w3.org/TR/xpath-functions/#casting-to-string">Section
17.1.2 Casting to xs:string and
xs:untypedAtomic</a><sup><small>FO</small></sup> of <a href=
"#xpath-functions">[XQuery 1.0 and XPath 2.0 Functions and
Operators]</a>. <span>Where a step in the sequence normalization
process indicates that a node should be copied, the copy is
performed in the same way as an XSLT <code>xsl:copy-of</code>
instruction that has a <code>validation</code> attribute whose
value is <code>preserve</code> and has a <code>select</code>
attribute whose effective value is the node, as described in
<a href="http://www.w3.org/TR/xslt20/#copy-of">Section 11.9.2 Deep
Copy</a><sup><small>XT</small></sup> of <a href="#xslt20">[XSL
Transformations (XSLT) Version 2.0]</a>, or equivalently in the
same way as an XQuery content expression as described in Step 1e of
<a href="http://www.w3.org/TR/xquery/#id-content">Section 3.7.1.3
Content</a><sup><small>XQ</small></sup> of <a href=
"#xquery">[XQuery 1.0: An XML Query Language]</a>, where the
construction mode is <code>preserve</code>.</span> The steps in
computing the normalized sequence are:</p>
<ol class="enumar">
<li>
<p>If the sequence that is input to serialization is empty, create
a sequence <em>S<sub>1</sub></em> that consists of a zero-length
string. Otherwise, copy each item in the sequence that is input to
serialization to create the new sequence
<em>S<sub>1</sub></em>.</p>
</li>
<li>
<p>For each item in <em>S<sub>1</sub></em>, if the item is atomic,
obtain the lexical representation of the item by casting it to an
<code>xs:string</code> and copy the string representation to the
new sequence; otherwise, copy the item, which will be a <a title=
"node" href="#dt-node">node</a>, to the new sequence. The new
sequence is <em>S<sub>2</sub></em>.</p>
</li>
<li>
<p>For each subsequence of adjacent strings in
<em>S<sub>2</sub></em>, copy a single string to the new sequence
equal to the values of the strings in the subsequence concatenated
in order, each separated by a single space. Copy all other items to
the new sequence. The new sequence is <em>S<sub>3</sub></em>.</p>
</li>
<li>
<p>For each item in <em>S<sub>3</sub></em>, if the item is a
string, create a text <a title="node" href="#dt-node">node</a> in
the new sequence whose <a title="string value" href=
"#dt-string-value">string value</a> is equal to the string;
otherwise, copy the item to the new sequence. The new sequence is
<em>S<sub>4</sub></em>.</p>
</li>
<li>
<p>For each item in <em>S<sub>4</sub></em>, if the item is a
document <a title="node" href="#dt-node">node</a>, copy its
children to the new sequence; otherwise, copy the item to the new
sequence. The new sequence is <em>S<sub>5</sub></em>.</p>
</li>
<li>
<p>For each subsequence of adjacent text nodes in
<em>S<sub>5</sub></em>, copy a single text node to the new sequence
equal to the values of the text nodes in the subsequence
concatenated in order. Any text nodes with values of zero length
are dropped. Copy all other items to the new sequence. The new
sequence is <em>S<sub>6</sub></em>.</p>
</li>
<li>
<p>It is a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSENR0001"
title="err:SENR0001">err:SENR0001</a>] if an item in
<em>S<sub>6</sub></em> is an attribute <a title="node" href=
"#dt-node">node</a> or a namespace <a title="node" href=
"#dt-node">node</a>. Otherwise, construct a new sequence,
<em>S<sub>7</sub></em>, that consists of a single document
<a title="node" href="#dt-node">node</a> and copy all the items in
the sequence, which are all <a title="node" href=
"#dt-node">nodes</a>, as children of that document <a title="node"
href="#dt-node">node</a>.</p>
</li>
</ol>
<p><em>S<sub>7</sub></em> is the normalized sequence.</p>
<p>The <a title="result tree" href="#result-tree">result tree</a>
rooted at the document <a title="node" href="#dt-node">node</a>
that is created by the final step of this sequence normalization
process is the instance of the data model to which the rules of the
appropriate output method are applied. If the sequence
normalization process results in a <a title="serialization error"
href="#serial-err">serialization error</a>, the <a title=
"serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>The sequence normalization process for a sequence
<code>$seq</code> is equivalent to constructing a document
<a title="node" href="#dt-node">node</a> using the XSLT
instruction:</p>
<div class="exampleInner">
<pre>
&lt;xsl:document&gt;

  &lt;xsl:copy-of select="$seq" validation="preserve"/&gt;

&lt;/xsl:document&gt;
</pre></div>
<p>or the XQuery expression:</p>
<div class="exampleInner">
<pre>

declare construction preserve;



document {

  for $s in $seq return

    if ($s instance of document-node())

    then $s/child::node()

    else $s

}
</pre></div>
<p>This process results in a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSENR0001"
title="err:SENR0001">err:SENR0001</a>] if sequences contain
parentless attribute and/or namespace <a title="node" href=
"#dt-node">nodes</a>.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div1">
<h2><a name="serparam" id="serparam"></a>3 Serialization
Parameters</h2>
<p>There are a number of parameters that influence how
serialization is performed. <a title="host language" href=
"#host-language">Host languages</a> <strong>MAY</strong> allow
users to specify any or all of these parameters, but they are not
<strong>REQUIRED</strong> to be able to do so. However, the
<a title="host language" href="#host-language">host language</a>
specification <strong>MUST</strong> specify how the value of all
applicable parameters is to be determined.</p>
<p>It is a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSEPM0016"
title="err:SEPM0016">err:SEPM0016</a>] if a parameter value is
invalid for the given parameter. It is the responsibility of the
<a title="host language" href="#host-language">host language</a> to
specify how invalid values should be handled at the level of that
language.</p>
<p>The following serialization parameters are defined:</p>
<table border="1" summary="Serialization parameters">
<col width="180" span="1" />
<col span="1" />
<thead>
<tr>
<th align="left">Serialization parameter name</th>
<th align="left">Permitted values for parameter</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" colspan="1"><code>byte-order-mark</code></td>
<td rowspan="1" colspan="1">One of the enumerated values
<code>yes</code> or <code>no</code>. This parameter indicates
whether the serialized sequence of octets is to be preceded by a
Byte Order Mark. (See Section 5.1 of <a href=
"#UNICODE-ENCODING">[Unicode Encoding]</a>.) The actual octet order
used is <a title="implementation-dependent" href=
"#impdep">implementation-dependent</a>. If the encoding defines no
Byte Order Mark, or if the Byte Order Mark is prohibited for the
specific Unicode encoding or implementation environment, then this
parameter is ignored.</td>
</tr>
<tr>
<td rowspan="1" colspan="1">
<code>cdata-section-elements</code></td>
<td rowspan="1" colspan="1">A list of expanded QNames, possibly
empty.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>doctype-public</code></td>
<td rowspan="1" colspan="1"><span>A string of <a href=
"http://www.w3.org/TR/REC-xml/#NT-PubidChar">PubidChar</a><sup><small>XML</small></sup>
characters.</span> <span>This parameter may be absent.</span></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>doctype-system</code></td>
<td rowspan="1" colspan="1"><span>A string of Unicode
characters</span> <span>that does not include both an apostrophe
(#x27) and a quotation mark (#x22) character.</span> <span>This
parameter may be absent.</span></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>encoding</code></td>
<td rowspan="1" colspan="1">A string of Unicode characters in the
range #x21 to #x7E (that is, printable ASCII characters); the value
<strong>SHOULD</strong> be a charset registered with the Internet
Assigned Numbers Authority <a href="#IANA">[IANA]</a>, <a href=
"#RFC2278">[RFC2278]</a> or begin with the characters
<code>x-</code> or <code>X-</code>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>escape-uri-attributes</code></td>
<td rowspan="1" colspan="1">One of the enumerated values
<code>yes</code> or <code>no</code>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>include-content-type</code></td>
<td rowspan="1" colspan="1">One of the enumerated values
<code>yes</code> or <code>no</code>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>indent</code></td>
<td rowspan="1" colspan="1">One of the enumerated values
<code>yes</code> or <code>no</code>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>media-type</code></td>
<td rowspan="1" colspan="1">A string of Unicode characters
specifying the media type (MIME content type) <a href=
"#RFC2046">[RFC2046]</a>; the charset parameter of the media type
<strong>MUST NOT</strong> be specified explicitly in the value of
the <code>media-type</code> parameter. If the destination of the
serialized output is annotated with a media type, this parameter
<strong>MAY</strong> be used to provide such an annotation. For
example, it <strong>MAY</strong> be used to set the media type in
an HTTP header.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>method</code></td>
<td rowspan="1" colspan="1">An expanded QName with a <a title=
"null namespace URI" href="#null-namespace-URI">null namespace
URI</a>, and the local part of the name equal to one of
<code>xml</code>, <code>xhtml</code>, <code>html</code> or
<code>text</code>, or having a <a title="non-null namespace URI"
href="#non-null-namespace-URI">non-null namespace URI</a>. If the
namespace URI is non-null, the parameter specifies an <a title=
"implementation-defined" href="#impdef">implementation-defined</a>
output method.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>normalization-form</code></td>
<td rowspan="1" colspan="1">One of the enumerated values
<code>NFC</code>, <code>NFD</code>, <code>NFKC</code>,
<code>NFKD</code>, <code>fully-normalized</code>, <code>none</code>
or an <a title="implementation-defined" href=
"#impdef">implementation-defined</a> value.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>omit-xml-declaration</code></td>
<td rowspan="1" colspan="1">One of the enumerated values
<code>yes</code> or <code>no</code>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>standalone</code></td>
<td rowspan="1" colspan="1">One of the enumerated values
<code>yes</code>, <code>no</code> or <code>omit</code>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>undeclare-prefixes</code></td>
<td rowspan="1" colspan="1">One of the enumerated values
<code>yes</code> or <code>no</code>.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>use-character-maps</code></td>
<td rowspan="1" colspan="1">A list of pairs, possibly empty, with
each pair consisting of a single Unicode character and a string of
Unicode characters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><code>version</code></td>
<td rowspan="1" colspan="1">A string of Unicode characters.</td>
</tr>
</tbody>
</table>
<p>The value of the <code>method</code> parameter is an <a title=
"expanded QName" href="#dt-expanded-qname">expanded QName</a>. If
the value has a <a title="null namespace URI" href=
"#null-namespace-URI">null namespace URI</a>, then the local name
identifies a method specified in this document and
<strong>MUST</strong> be one of <code>xml</code>,
<code>html</code>, <code>xhtml</code>, or <code>text</code>; in
this case, the output method specified <strong>MUST</strong> be
used for serializing. If the namespace URI is non-null, then it
identifies an <a title="implementation-defined" href=
"#impdef">implementation-defined</a> output method; the behavior in
this case is not specified by this document.</p>
<p>In those cases where they have no important effect on the
content of the serialized result, details of the output methods
defined by this specification are left unspecified and are regarded
as <a title="implementation-dependent" href=
"#impdep">implementation-dependent</a>. Whether a <a title=
"serializer" href="#serializer">serializer</a> uses apostrophes or
quotation marks to delimit attribute values in the XML output
method is an example of such a detail.</p>
<p>The detailed semantics of each parameter will be described
separately for each output method <span>for which it is
applicable</span>. <span>If the semantics of a parameter are not
described for an output method, then it is not applicable to that
output method.</span></p>
<p>Implementations <strong>MAY</strong> define additional
serialization parameters, and <strong>MAY</strong> allow users to
do so. For this purpose, the name of a serialization parameter is
considered to be a QName; the parameters listed above are QNames in
no namespace, while any additional serialization parameters must
have names that are namespace-qualified. If the serialization
method is one of the four methods <code>xml</code>,
<code>html</code>, <code>xhtml</code>, or <code>text</code>, then
the additional serialization parameters <strong>MAY</strong> affect
the output of the serializer to the extent (but only to the extent)
that this specification leaves the output <a title=
"implementation-defined" href="#impdef">implementation-defined</a>
or <a title="implementation-dependent" href=
"#impdep">implementation-dependent</a>. For example, such
parameters might control whether namespace declarations on an
element are written before or after the attributes of the element,
or they might define the number of space or tab characters to be
inserted when the <code>indent</code> parameter is set to
<code>yes</code>; but they could not instruct the serializer to
suppress the error that occurs when the HTML output method
encounters illegal characters (see error [<a href="#ERRSERE0014"
title="err:SERE0014">err:SERE0014</a>]).</p>
</div>
<div class="div1">
<h2><a name="serphases" id="serphases"></a>4 Phases of
Serialization</h2>
<p>Serialization comprises five phases of processing (preceded
optionally by the sequence normalization process described in
<a href="#serdm"><b>2 Sequence Normalization</b></a>).</p>
<p>For an <a title="implementation-defined" href=
"#impdef">implementation-defined</a> output method, any of these
phases <strong>MAY</strong> be skipped or <strong>MAY</strong> be
performed in a different order than is specified here. For the
output methods defined in this specification, these phases are
carried out sequentially as follows:</p>
<ol class="enumar">
<li>
<p>A <code>meta</code> element is added to the normalized sequence
along with discarding an existing <code>meta</code> element, as
controlled by the <code>include-content-type</code> parameter for
the XHTML and HTML output methods.</p>
</li>
<li>
<p><em>Markup generation</em> produces the character representation
of those parts of the serialized result that describe the structure
of the normalized sequence. In the cases of the XML, HTML and XHTML
output methods, this phase produces the character representations
of the following:</p>
<ul>
<li>
<p>the document type declaration;</p>
</li>
<li>
<p>start tags and end tags (except for attribute values, whose
representation is produced by the character expansion phase);</p>
</li>
<li>
<p>processing instructions; and</p>
</li>
<li>
<p>comments.</p>
</li>
</ul>
<p>In the cases of the XML and XHTML output methods, this phase
also produces the following:</p>
<ul>
<li>
<p>the XML or text declaration; and</p>
</li>
<li>
<p>empty element tags (except for the attribute values);</p>
</li>
</ul>
<p>In the case of the text output method, <span>this phase replaces
the single document node produced by <a title=
"sequence normalization" href="#sequence-normalization">sequence
normalization</a> with a new document node that has exactly one
child, which is a text node. The string value of the new text node
is the string value of the document node that was produced by
sequence normalization.</span></p>
</li>
<li>
<p><em>Character expansion</em> is concerned with the
representation of characters appearing in text and attribute
<a title="node" href="#dt-node">nodes</a> in the normalized
sequence. For each text and attribute <a title="node" href=
"#dt-node">node</a>, the following rules are applied in
sequence.</p>
<ol class="enumla">
<li>
<p>If the node is an attribute that is a <a title=
"URI attribute values" href="#uri-attribute-values">URI attribute
value</a> and the <code>escape-uri-attributes</code> parameter is
set to require escaping of URI attributes, apply <a title=
"URI Escaping" href="#uri-escaping">URI escaping</a> as defined
below, and skip rules b-e. Otherwise, continue with rule b.</p>
<p>[<a name="uri-escaping" id="uri-escaping" title=
"URI Escaping">Definition</a>: <b>URI escaping</b> consists of the
following three steps applied in sequence to the content of
<a title="URI attribute values" href="#uri-attribute-values">URI
attribute values</a>:]</p>
<ol class="enumlr">
<li>
<p>normalize to NFC using the method defined in <a href=
"http://www.w3.org/TR/xpath-functions/#func-normalize-unicode">Section
7.4.6 fn:normalize-unicode</a><sup><small>FO</small></sup></p>
</li>
<li>
<p>percent-encode any special characters in the URI using the
method defined in <a href=
"http://www.w3.org/TR/xpath-functions/#func-escape-html-uri">Section
7.4.12 fn:escape-html-uri</a><sup><small>FO</small></sup></p>
</li>
<li>
<p>escape according to HTML rules any characters (such as
<code>&lt;</code> and <code>&amp;</code>) where HTML requires
escaping, and any characters that cannot be represented in the
selected encoding. For example, replace <code>&lt;</code> with
<code>&amp;lt;</code>. (See also section <a href=
"#HTML_CHARDATA"><b>7.3 Writing Character Data</b></a>)</p>
</li>
</ol>
<p>[<a name="uri-attribute-values" id="uri-attribute-values" title=
"URI attribute values">Definition</a>: The values of attributes
listed in <a href="#list-of-uri-attributes"><b>C List of URI
Attributes</b></a> are <b>URI attribute values</b>. Attributes are
not considered to be URI attributes simply because they are
namespace declaration attributes or have the type annotation
<code>xs:anyURI</code>.]</p>
</li>
<li>
<p>If the node is a text node whose parent element is selected by
the rules of the <code>cdata-section-elements</code> parameter for
the applicable output method, create CDATA sections as described
below, and skip rules c-e. Otherwise, continue with rule c.</p>
<p>Apply the following two processes in sequence to create CDATA
sections</p>
<ol class="enumlr">
<li>
<p><a title="Unicode Normalization" href=
"#unicode-normalization">Unicode Normalization</a> if requested by
the <code>normalization-form</code> parameter.</p>
</li>
<li>
<p>apply changes as detailed in the description of the
<code>cdata-section-elements</code> parameter for the applicable
output method.</p>
</li>
</ol>
</li>
<li>
<p>Apply character mapping as determined by the
<code>use-character-maps</code> parameter for the applicable output
method. For characters that were substituted by this process, skip
rules d and e. For the remaining characters that were not modified
by character mapping, continue with rule d.</p>
</li>
<li>
<p>Apply <a title="Unicode Normalization" href=
"#unicode-normalization">Unicode Normalization</a> if requested by
the <code>normalization-form</code> parameter.</p>
<p>[<a name="unicode-normalization" id="unicode-normalization"
title="Unicode Normalization">Definition</a>: <b>Unicode
Normalization</b> is the process of removing alternate
representations of equivalent sequences from textual data, to
convert the data into a form that can be binary-compared for
equivalence, as specified in <a href=
"#UNICODE-NORMALIZATION-FORM">[UAX #15: Unicode Normalization
Forms]</a>. For specific recommendations for character
normalization on the World Wide Web, see <a href=
"#charmod-norm">[Character Model for the World Wide Web 1.0:
Normalization]</a>.]</p>
<p>The meanings associated with the possible values of the
<code>normalization-form</code> parameter are defined in section
<a href="#XML_NORMALIZATION-FORM"><b>5.1.8 XML Output Method: the
normalization-form Parameter</b></a>.</p>
<p>Continue with step e.</p>
</li>
<li>
<p>Escape according to XML or HTML rules, as determined by the
applicable output method, any characters (such as <code>&lt;</code>
and <code>&amp;</code>) where XML or HTML requires escaping, and
any characters that cannot be represented in the selected encoding.
For example, replace <code>&lt;</code> with <code>&amp;lt;</code>.
(See also section <a href="#HTML_CHARDATA"><b>7.3 Writing Character
Data</b></a>). For characters such as <code>&gt;</code> where XML
defines a built-in entity but does not require its use in all
circumstances, it is implementation-dependent whether the character
is escaped.</p>
</li>
</ol>
</li>
<li>
<p><em>Indentation</em>, as controlled by the <code>indent</code>
parameter, MAY add or remove whitespace according to the rules
defined by the applicable output method.</p>
</li>
<li>
<p><em>Encoding</em>, as controlled by the <code>encoding</code>
parameter, converts the character stream produced by the previous
phases into an octet stream.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>Serialization is only defined in terms of encoding the result as
a stream of octets. However, a <a title="serializer" href=
"#serializer">serializer</a> may provide an option that allows the
encoding phase to be skipped, so that the result of serialization
is a stream of Unicode characters. The effect of any such option is
<a title="implementation-defined" href=
"#impdef">implementation-defined</a>, and a <a title="serializer"
href="#serializer">serializer</a> is not required to support such
an option.</p>
</td>
</tr>
</table>
</blockquote>
</li>
</ol>
</div>
<div class="div1">
<h2><a name="xml-output" id="xml-output"></a>5 XML Output
Method</h2>
<p>The XML output method serializes the normalized sequence as an
XML entity that <strong>MUST</strong> satisfy the rules for either
a well-formed XML document entity or a well-formed XML external
general parsed entity, or both. A <a title="serialization error"
href="#serial-err">serialization error</a> [<a href="#ERRSERE0003"
title="err:SERE0003">err:SERE0003</a>] results if the <a title=
"serializer" href="#serializer">serializer</a> is unable to satisfy
those rules, except for content modified by the character expansion
phase of serialization, as described in <a href="#serphases"><b>4
Phases of Serialization</b></a>. The effects of the character
expansion phase could result in the serialized output being not
well-formed, but will not result in a <a title=
"serialization error" href="#serial-err">serialization error</a>.
If a <a title="serialization error" href=
"#serial-err">serialization error</a> results, the <a title=
"serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error.</p>
<p>If the document <a title="node" href="#dt-node">node</a> of the
normalized sequence has a single element <a title="node" href=
"#dt-node">node</a> child and no text <a title="node" href=
"#dt-node">node</a> children, then the serialized output is a
well-formed XML document entity, and the serialized output
<strong>MUST</strong> conform to the appropriate version of the XML
Namespaces Recommendation <a href="#xml-names">[XML Names]</a> or
<a href="#xml-names11">[XML Names 1.1]</a>. If the normalized
sequence does not take this form, then the serialized output is a
well-formed XML external general parsed entity, which, when
referenced within a trivial XML document wrapper like this:</p>
<div class="exampleInner">
<pre>
&lt;?xml version="<em>version</em>"?&gt;
&lt;!DOCTYPE doc [
&lt;!ENTITY e SYSTEM "<em>entity-URI</em>"&gt;
]&gt;
&lt;doc&gt;&amp;e;&lt;/doc&gt;
</pre></div>
<p>where <code>entity-URI</code> is a URI for the entity, and the
value of the <code>version</code> pseudo-attribute is the value of
the <code>version</code> parameter, produces a document which
<strong>MUST</strong> itself be a well-formed XML document
conforming to the corresponding version of the XML Namespaces
Recommendation <a href="#xml-names">[XML Names]</a> or <a href=
"#xml-names11">[XML Names 1.1]</a>.</p>
<p>[<a name="reconstructed-tree" id="reconstructed-tree" title=
"reconstructed tree">Definition</a>: A <b>reconstructed tree</b>
may be constructed by parsing the XML document and converting it
into an instance of the data model as specified in <a href=
"#xpath-datamodel">[XQuery 1.0 and XPath 2.0 Data Model]</a>.] The
result of serialization <strong>MUST</strong> be such that the
<a title="reconstructed tree" href=
"#reconstructed-tree">reconstructed tree</a> is the same as the
<a title="result tree" href="#result-tree">result tree</a> except
for the following permitted differences:</p>
<ul>
<li>
<p>If the document was produced by adding a document wrapper, as
described above, then it will contain an extra <code>doc</code>
element as the document element.</p>
</li>
<li>
<p>The order of attribute and namespace <a title="node" href=
"#dt-node">nodes</a> in the two trees <strong>MAY</strong> be
different.</p>
</li>
<li>
<p>The following properties of corresponding <a title="node" href=
"#dt-node">nodes</a> in the two trees <strong>MAY</strong> be
different:</p>
<ul>
<li>
<p>the base-uri property of document <a title="node" href=
"#dt-node">nodes</a> and element <a title="node" href=
"#dt-node">nodes</a>;</p>
</li>
<li>
<p>the document-uri and unparsed-entities properties of document
<a title="node" href="#dt-node">nodes</a>;</p>
</li>
<li>
<p>the type-name and typed-value properties of element and
attribute <a title="node" href="#dt-node">nodes</a>;</p>
</li>
<li>
<p>the nilled property of element <a title="node" href=
"#dt-node">nodes</a>;</p>
</li>
<li>
<p>the content property of text <a title="node" href=
"#dt-node">nodes</a>, due to the effect of the <code>indent</code>
and <code>use-character-maps</code> parameters.</p>
</li>
</ul>
</li>
<li>
<p>The <a title="reconstructed tree" href=
"#reconstructed-tree">reconstructed tree</a> <strong>MAY</strong>
contain additional attributes and text <a title="node" href=
"#dt-node">nodes</a> resulting from the expansion of default and
fixed values in its DTD or schema; also, in the presence of a DTD,
non-CDATA attributes may lose whitespace characters as a result of
attribute value normalization.</p>
</li>
<li>
<p>The type annotations of the <a title="node" href=
"#dt-node">nodes</a> in the two trees <strong>MAY</strong> be
different. Type annotations in a <a title="result tree" href=
"#result-tree">result tree</a> are discarded when the tree is
serialized. Any new type annotations obtained by parsing the
document will depend on whether the serialized XML document is
assessed against a schema, and this <strong>MAY</strong> result in
type annotations that are different from those in the original
<a title="result tree" href="#result-tree">result tree</a>.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>In order to influence the type annotations in the instance of
the data model that would result from processing a serialized XML
document, the author of the XSLT stylesheet, XQuery expression or
other process might wish to create the instance of the data model
that is input to the serialization process so that it makes use of
mechanisms provided by <a href="#xmlschema-1">[XML Schema]</a>,
such as <code>xsi:type</code> and <code>xsi:schemaLocation</code>
attributes. The serialization process will not automatically create
such attributes in the serialized document if those attributes were
not part of the <a title="result tree" href="#result-tree">result
tree</a> that is to be serialized.</p>
<p>Similarly, it is possible that an element <a title="node" href=
"#dt-node">node</a> in the instance of the data model that is to be
serialized has the <code>nilled</code> property with the value
<code>true</code>, but no <code>xsi:nil</code> attribute. The
serialization process will not create such an attribute in the
serialized document simply to reflect the value of the property.
The value of the <code>nilled</code> property has no direct effect
on the serialized result.</p>
</td>
</tr>
</table>
</blockquote>
</li>
<li>
<p>Additional namespace <a title="node" href="#dt-node">nodes</a>
<strong>MAY</strong> be present in the <a title=
"reconstructed tree" href="#reconstructed-tree">reconstructed
tree</a> if the serialization process did not undeclare one or more
namespaces, as described in <a href="#xml-undeclare-NS"><b>5.1.7
XML Output Method: the undeclare-prefixes Parameter</b></a>, and
the starting instance of the data model contained an element
<a title="node" href="#dt-node">node</a> with a namespace <a title=
"node" href="#dt-node">node</a> that declared some prefix, but a
child element of that <a title="node" href="#dt-node">node</a> did
not have any namespace <a title="node" href="#dt-node">node</a>
that declared the same prefix.</p>
<p>The <a title="result tree" href="#result-tree">result tree</a>
<strong>MAY</strong> contain namespace <a title="node" href=
"#dt-node">nodes</a> that are not present in the <a title=
"reconstructed tree" href="#reconstructed-tree">reconstructed
tree</a>, as the process of creating an instance of the data model
<strong>MAY</strong> ignore namespace declarations in some
circumstances. See <a href=
"http://www.w3.org/TR/xpath-datamodel/#const-infoset-element">Section
6.2.3 Construction from an Infoset</a><sup><small>DM</small></sup>
and <a href=
"http://www.w3.org/TR/xpath-datamodel/#const-psvi-element">Section
6.2.4 Construction from a PSVI</a><sup><small>DM</small></sup> of
<a href="#xpath-datamodel">[XQuery 1.0 and XPath 2.0 Data
Model]</a> for additional information.</p>
</li>
<li>
<p>If the <code>indent</code> parameter has the value
<code>yes</code>,</p>
<ul>
<li>
<p>additional text <a title="node" href="#dt-node">nodes</a>
consisting of whitespace characters <strong>MAY</strong> be present
in the <a title="reconstructed tree" href=
"#reconstructed-tree">reconstructed tree</a>; and</p>
</li>
<li>
<p>text <a title="node" href="#dt-node">nodes</a> in the <a title=
"result tree" href="#result-tree">result tree</a> that contained
only whitespace characters <strong>MAY</strong> correspond to text
<a title="node" href="#dt-node">nodes</a> in the <a title=
"reconstructed tree" href="#reconstructed-tree">reconstructed
tree</a> that contain additional whitespace characters that were
not present in the <a title="result tree" href=
"#result-tree">result tree</a></p>
</li>
</ul>
<p>See <a href="#xml-indent"><b>5.1.3 XML Output Method: the indent
Parameter</b></a> for more information on the <code>indent</code>
parameter.</p>
</li>
<li>
<p>Additional <a title="node" href="#dt-node">nodes</a>
<strong>MAY</strong> be present in the <a title=
"reconstructed tree" href="#reconstructed-tree">reconstructed
tree</a> due to the effect of character mapping in the character
expansion phase, and the values of attribute <a title="node" href=
"#dt-node">nodes</a> and text <a title="node" href=
"#dt-node">nodes</a> in the <a title="reconstructed tree" href=
"#reconstructed-tree">reconstructed tree</a> <strong>MAY</strong>
be different from those in the <a title="result tree" href=
"#result-tree">result tree</a>, due to the effects of URI
expansion, character mapping and <a title="Unicode Normalization"
href="#unicode-normalization">Unicode Normalization</a> in the
character expansion phase of serialization.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>The <code>use-character-maps</code> parameter can cause
arbitrary characters to be inserted into the serialized XML
document in an unescaped form, including characters that would be
considered to be part of XML markup. Such characters could result
in arbitrary new element <a title="node" href="#dt-node">nodes</a>,
attribute <a title="node" href="#dt-node">nodes</a>, and so on, in
the <a title="reconstructed tree" href=
"#reconstructed-tree">reconstructed tree</a> that results from
processing the serialized XML document.</p>
</td>
</tr>
</table>
</blockquote>
</li>
</ul>
<p>A consequence of this rule is that certain characters
<strong>MUST</strong> be output as character references, to ensure
that they survive the round trip through serialization and parsing.
Specifically, CR, NEL and LINE SEPARATOR characters in text
<a title="node" href="#dt-node">nodes</a> <strong>MUST</strong> be
output respectively as "<code>&amp;#xD;</code>",
"<code>&amp;#x85;</code>", and "<code>&amp;#x2028;</code>", or
their equivalents; while CR, NL, TAB, NEL and LINE SEPARATOR
characters in attribute <a title="node" href="#dt-node">nodes</a>
<strong>MUST</strong> be output respectively as
"<code>&amp;#xD;</code>", "<code>&amp;#xA;</code>",
"<code>&amp;#x9;</code>", "<code>&amp;#x85;</code>", and
"<code>&amp;#x2028;</code>", or their equivalents. In addition, the
non-whitespace control characters #x1 through #x1F and #x7F through
#x9F in text <a title="node" href="#dt-node">nodes</a> and
attribute <a title="node" href="#dt-node">nodes</a>
<strong>MUST</strong> be output as character references.</p>
<p>For example, an attribute with the value "x" followed by "y"
separated by a newline will result in the output
<code>"x&amp;#xA;y"</code> (or with any equivalent character
reference). The XML output cannot be "x" followed by a literal
newline followed by a "y" because after parsing, the attribute
value would be <code>"x y"</code> as a consequence of the XML
attribute normalization rules.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>XML 1.0 did not permit an XML processor to normalize NEL or LINE
SEPARATOR characters to a LINE FEED character. However, if a
document entity that specifies version 1.1 invokes an external
general parsed entity with no text declaration or a text
declaration that specifies version 1.0, the external parsed entity
is processed according to the rules of XML 1.1. For this reason,
NEL and LINE SEPARATOR characters in text and attribute <a title=
"node" href="#dt-node">nodes</a> must always be escaped using
character references, regardless of the value of the
<code>version</code> parameter.</p>
<p>XML 1.0 permitted control characters in the range #x7F through
#x9F to appear as literal characters in an XML document, but XML
1.1 requires such characters, other than NEL, to be escaped as
character references. An external general parsed entity with no
text declaration or a text declaration that specifies a version
pseudo-attribute with value <code>1.0</code> that is invoked by an
XML 1.1 document entity must follow the rules of XML 1.1.
Therefore, the non-whitespace control characters in the ranges #x1
through #x1F and #x7F through #x9F must always be escaped,
regardless of the value of the <code>version</code> parameter.</p>
</td>
</tr>
</table>
</blockquote>
<p>It is a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSEPM0004"
title="err:SEPM0004">err:SEPM0004</a>] to specify the
doctype-system parameter, or to specify the standalone parameter
with a value other than <code>omit</code>, if the instance of the
data model contains text <a title="node" href="#dt-node">nodes</a>
or multiple element <a title="node" href="#dt-node">nodes</a> as
children of the root <a title="node" href="#dt-node">node</a>. The
<a title="serializer" href="#serializer">serializer</a>
<strong>MUST</strong> either signal the error, or recover by
ignoring the request to output a document type declaration or
<code>standalone</code> parameter.</p>
<div class="div2">
<h3><a name="XML_PARAMS" id="XML_PARAMS"></a>5.1 The Influence of
Serialization Parameters upon the XML Output Method</h3>
<div class="div3">
<h4><a name="XML_VERSION" id="XML_VERSION"></a>5.1.1 XML Output
Method: the <code>version</code> Parameter</h4>
<p>The <code>version</code> parameter specifies the version of XML
and the version of Namespaces in XML to be used for outputting the
instance of the data model. The version output in the XML
declaration (if an XML declaration is not omitted)
<strong>MUST</strong> correspond to the version of XML that the
<a title="serializer" href="#serializer">serializer</a> used for
outputting the instance of the data model. <span>The value of the
<code>version</code> parameter <strong>MUST</strong> match the
<a href=
"http://www.w3.org/TR/REC-xml/#NT-VersionNum">VersionNum</a>
<sup><small>XML</small></sup> production of the XML Recommendation
<a href="#xml">[XML10]</a> or <a href="#xml11">[XML11]</a>.</span>
A serialization error [<a href="#ERRSESU0013" title=
"err:SESU0013">err:SESU0013</a>] results if the value of the
<code>version</code> parameter specifies a version of XML that is
not supported by the <a title="serializer" href=
"#serializer">serializer</a>; the <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> signal the
error.</p>
<p>If the serialized result would contain an <a href=
"http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</a>
<sup><small>Names</small></sup> that contains a character that is
not permitted by the version of Namespaces in XML specified by the
<code>version</code> parameter, a <a title="serialization error"
href="#serial-err">serialization error</a> [<a href="#ERRSERE0005"
title="err:SERE0005">err:SERE0005</a>] results. The <a title=
"serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error.</p>
<p>If the serialized result would contain a character that is not
permitted by the version of XML specified by the
<code>version</code> parameter, a <a title="serialization error"
href="#serial-err">serialization error</a> [<a href="#ERRSERE0006"
title="err:SERE0006">err:SERE0006</a>] results. The <a title=
"serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error.</p>
<div class="exampleOuter">
<p>For example, if the <code>version</code> parameter has the value
<code>1.0</code>, and the instance of the data model contains a
non-whitespace control character in the range #x1 to #x1F, a
<a title="serialization error" href="#serial-err">serialization
error</a> [<a href="#ERRSERE0006" title=
"err:SERE0006">err:SERE0006</a>] results. If the
<code>version</code> parameter has the value <code>1.1</code> and a
comment <a title="node" href="#dt-node">node</a> in the instance of
the data model contains a non-whitespace control character in the
range #x1 to #x1F or a control character other than NEL in the
range #x7F to #x9F, a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSERE0006"
title="err:SERE0006">err:SERE0006</a>] results.</p>
</div>
</div>
<div class="div3">
<h4><a name="XML_ENCODING" id="XML_ENCODING"></a>5.1.2 XML Output
Method: the <code>encoding</code> Parameter</h4>
<p>The <code>encoding</code> parameter specifies the encoding to be
used for outputting the instance of the data model. <a title=
"serializer" href="#serializer">Serializers</a> are
<strong>REQUIRED</strong> to support values of <code>UTF-8</code>
and <code>UTF-16</code>. A <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSESU0007"
title="err:SESU0007">err:SESU0007</a>] occurs if an output encoding
other than <code>UTF-8</code> or <code>UTF-16</code> is requested
and the <a title="serializer" href="#serializer">serializer</a>
does not support that encoding. The <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> signal the
error, or recover by using <code>UTF-8</code> or
<code>UTF-16</code> instead. The <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST NOT</strong> use an
encoding whose name does not match the <a href=
"http://www.w3.org/TR/REC-xml/#NT-EncName">EncName</a>
<sup><small>XML</small></sup> production of the XML Recommendation
<a href="#xml">[XML10]</a>.</p>
<p>When outputting a newline character in the instance of the data
model, the <a title="serializer" href="#serializer">serializer</a>
is free to represent it using any character sequence that will be
normalized to a newline character by an XML parser, unless a
specific mapping for the newline character is provided in a
character map (see <a href="#character-maps"><b>9 Character
Maps</b></a>).</p>
<p>When outputting any other character that is defined in the
selected encoding, the character <strong>MUST</strong> be output
using the correct representation of that character in the selected
encoding.</p>
<p>It is possible that the instance of the data model will contain
a character that cannot be represented in the encoding that the
<a title="serializer" href="#serializer">serializer</a> is using
for output. In this case, if the character occurs in a context
where XML recognizes character references (that is, in the value of
an attribute <a title="node" href="#dt-node">node</a> or text
<a title="node" href="#dt-node">node</a>), then the character
<strong>MUST</strong> be output as a character reference. A
<a title="serialization error" href="#serial-err">serialization
error</a> [<a href="#ERRSERE0008" title=
"err:SERE0008">err:SERE0008</a>] occurs if such a character appears
in a context where character references are not allowed (for
example, if the character occurs in the name of an element). The
<a title="serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error.</p>
<div class="exampleOuter">
<p>For example, if a text <a title="node" href="#dt-node">node</a>
contains the character LATIN SMALL LETTER E WITH ACUTE (#xE9), and
the value of the <code>encoding</code> parameter is
<code>US-ASCII</code>, the character <strong>MUST</strong> be
serialized as a character reference. If a comment <a title="node"
href="#dt-node">node</a> contains the same character, a <a title=
"serialization error" href="#serial-err">serialization error</a>
[<a href="#ERRSERE0008" title="err:SERE0008">err:SERE0008</a>]
results.</p>
</div>
</div>
<div class="div3">
<h4><a name="xml-indent" id="xml-indent"></a>5.1.3 XML Output
Method: the <code>indent</code> Parameter</h4>
<p>If the <code>indent</code> parameter has the value
<code>yes</code>, then the XML output method <strong>MAY</strong>
output whitespace in addition to the whitespace in the instance of
the data model in order to indent the result so that a person will
find it easier to read; if the <code>indent</code> parameter has
the value <code>no</code>, it <strong>MUST NOT</strong> output any
additional whitespace. If the XML output method does output
additional whitespace, it <strong>MUST</strong> use an algorithm to
output additional whitespace that satisfies all of the following
constraints:</p>
<ul>
<li>
<p>Whitespace characters <strong>MUST NOT</strong> be added
adjacent to a text <a title="node" href="#dt-node">node</a> that
contains non-whitespace characters.</p>
</li>
<li>
<p>Whitespace characters <strong>MUST NOT</strong> be added other
than adjacent to an element <a title="node" href=
"#dt-node">node</a>, that is, immediately before a start tag or
immediately after an end tag.</p>
</li>
<li>
<p>Whitespace characters <strong>MUST NOT</strong> be inserted in a
part of the result document that is controlled by an
<code>xml:space</code> attribute with value <code>preserve</code>.
(See <a href="#xml">[XML10]</a> for more information about the
<code>xml:space</code> attribute.)</p>
</li>
<li>
<p>Whitespace characters <strong>SHOULD NOT</strong> be added in
places where the characters would constitute significant
whitespace, for example, in the content of an element <span>that is
annotated with a type other than <code>xs:untyped</code> or
<code>xs:anyType</code>, and</span> whose content model is known to
be mixed.</p>
</li>
</ul>
<p>In any location where the above rules allow the addition of
whitespace characters, existing whitespace characters
<strong>MAY</strong> also be removed or replaced. For example, a
tab <strong>MAY</strong> be inserted as a replacement for existing
spaces.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>The effect of these rules is to ensure that whitespace is only
added in places where (a) XSLT's
<code>&lt;xsl:strip-space&gt;</code> declaration could cause it to
be removed, and (b) it does not affect the <a title="string value"
href="#dt-string-value">string value</a> of any element <a title=
"node" href="#dt-node">node</a> with simple content. It is usually
not safe to indent document types that include elements with mixed
content.</p>
</td>
</tr>
</table>
</blockquote>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>The whitespace added may possibly be based on whitespace
stripped from either the source document or the stylesheet (in the
case of XSLT), or guided by other means that might depend on the
<a title="host language" href="#host-language">host language</a>,
in the case of an instance of the data model created using some
other process.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="XML_CDATA-SECTION-ELEMENTS" id=
"XML_CDATA-SECTION-ELEMENTS"></a>5.1.4 XML Output Method: the
<code>cdata-section-elements</code> Parameter</h4>
<p>The <code>cdata-section-elements</code> parameter contains a
list of expanded QNames. If the expanded QName of the parent of a
text <a title="node" href="#dt-node">node</a> is a member of the
list, then the text <a title="node" href="#dt-node">node</a>
<strong>MUST</strong> be output as a CDATA section, except in those
circumstances described below.</p>
<p>If the text <a title="node" href="#dt-node">node</a> contains
the sequence of characters <code>]]&gt;</code>, then the currently
open CDATA section <strong>MUST</strong> be closed following the
<code>]]</code> and a new CDATA section opened before the
<code>&gt;</code>.</p>
<p>If the text <a title="node" href="#dt-node">node</a> contains
characters that are not representable in the character encoding
being used to output the instance of the data model, then the
currently open CDATA section <strong>MUST</strong> be closed before
such characters, the characters <strong>MUST</strong> be output
using character references or entity references, and a new CDATA
section <strong>MUST</strong> be opened for any further characters
in the text <a title="node" href="#dt-node">node</a>.</p>
<p>CDATA sections <strong>MUST NOT</strong> be used except where
they have been explicitly requested by the user, either by using
the <code>cdata-section-elements</code> parameter, or by using some
other <a title="implementation-defined" href=
"#impdef">implementation-defined</a> mechanism.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>This is phrased to permit an implementor to provide an option
that attempts to preserve CDATA sections present in the source
document.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="XML_OMIT-XML-DECLARATION" id=
"XML_OMIT-XML-DECLARATION"></a>5.1.5 XML Output Method: the
<code>omit-xml-declaration</code> and <code>standalone</code>
Parameters</h4>
<p>The XML output method <strong>MUST</strong> output an XML
declaration if the <code>omit-xml-declaration</code> parameter has
the value <code>no</code>. The XML declaration
<strong>MUST</strong> include both version information and an
encoding declaration. If the <code>standalone</code> parameter has
the value <code>yes</code> or the value <code>no</code>, the XML
declaration <strong>MUST</strong> include a standalone document
declaration with the same value as the value of the
<code>standalone</code> parameter. If the <code>standalone</code>
parameter has the value <code>omit</code>, the XML declaration
<strong>MUST NOT</strong> include a standalone document
declaration; this ensures that it is both an XML declaration
(allowed at the beginning of a document entity) and a text
declaration (allowed at the beginning of an external general parsed
entity).</p>
<p>A <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSEPM0009"
title="err:SEPM0009">err:SEPM0009</a>] results if the
<code>omit-xml-declaration</code> parameter has the value
<code>yes</code>, and</p>
<ul>
<li>
<p>the <code>standalone</code> parameter has a value other than
<code>omit</code>; or</p>
</li>
<li>
<p>the <code>version</code> parameter has a value other than
<code>1.0</code> and the <code>doctype-system</code> parameter is
specified.</p>
</li>
</ul>
The <a title="serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error.
<p>Otherwise, if the <code>omit-xml-declaration</code> parameter
has the value <code>yes</code>, the XML output method <strong>MUST
NOT</strong> output an XML declaration.</p>
</div>
<div class="div3">
<h4><a name="XML_DOCTYPE" id="XML_DOCTYPE"></a>5.1.6 XML Output
Method: the <code>doctype-system</code> and
<code>doctype-public</code> Parameters</h4>
<p>If the <code>doctype-system</code> parameter is specified, the
XML output method <strong>MUST</strong> output a document type
declaration immediately before the first element. The name
following <code>&lt;!DOCTYPE</code> <strong>MUST</strong> be the
name of the first element, if any. If the
<code>doctype-public</code> parameter is also specified, then the
XML output method <strong>MUST</strong> output <code>PUBLIC</code>
followed by the public identifier and then the system identifier;
otherwise, it <strong>MUST</strong> output <code>SYSTEM</code>
followed by the system identifier. The internal subset
<strong>MUST</strong> be empty. The <code>doctype-public</code>
parameter <strong>MUST</strong> be ignored unless the
<code>doctype-system</code> parameter is specified.</p>
</div>
<div class="div3">
<h4><a name="xml-undeclare-NS" id="xml-undeclare-NS"></a>5.1.7 XML
Output Method: the <code>undeclare-prefixes</code> Parameter</h4>
<p>The Data Model allows an element <a title="node" href=
"#dt-node">node</a> that binds a non-empty prefix to have a child
element <a title="node" href="#dt-node">node</a> that does not bind
that same prefix. In <em>Namespaces in XML 1.1</em> (<a href=
"#xml-names11">[XML Names 1.1]</a>), this can be represented
accurately by undeclaring prefixes. For the undeclaring prefix of
the child element node, if the <code>undeclare-prefixes</code>
parameter has the value <code>yes</code>, the output method is XML
or XHTML, and the <code>version</code> parameter value is greater
than <code>1.0</code>, the <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> undeclare its
namespace. If the <code>undeclare-prefixes</code> parameter has the
value <code>no</code> and the output method is XML or XHTML, then
the undeclaration of prefixes <strong>MUST NOT</strong> occur.</p>
<div class="exampleOuter">
<p>Consider an element <code>x:foo</code> with four in-scope
namespaces that associate prefixes with URIs as follows:</p>
<ul>
<li>
<p><code>x</code> is associated with
<code>http://example.org/x</code></p>
</li>
<li>
<p><code>y</code> is associated with
<code>http://example.org/y</code></p>
</li>
<li>
<p><code>z</code> is associated with
<code>http://example.org/z</code></p>
</li>
<li>
<p><code>xml</code> is associated with
<code>http://www.w3.org/XML/1998/namespace</code></p>
</li>
</ul>
<p>Suppose that it has a child element <code>x:bar</code> with
three in-scope namespaces:</p>
<ul>
<li>
<p><code>x</code> is associated with
<code>http://example.org/x</code></p>
</li>
<li>
<p><code>y</code> is associated with
<code>http://example.org/y</code></p>
</li>
<li>
<p><code>xml</code> is associated with
<code>http://www.w3.org/XML/1998/namespace</code></p>
</li>
</ul>
<p>If namespace undeclaration is in effect, it will be serialized
this way:</p>
<div class="exampleInner">
<pre>
&lt;x:foo xmlns:x="http://example.org/x"
       xmlns:y="http://example.org/y"
       xmlns:z="http://example.org/z"&gt;
       
       &lt;x:bar xmlns:z=""&gt;...&lt;/x:bar&gt;
       
&lt;/x:foo&gt;
</pre></div>
</div>
<p>In <em>Namespaces in XML</em> 1.0 (<a href="#xml-names">[XML
Names]</a>), prefix undeclaration is not possible. If the output
method is XML or XHTML, the value of the
<code>undeclare-prefixes</code> parameter is <code>yes</code>, and
the value of the <code>version</code> parameter is
<code>1.0</code>, a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSEPM0010"
title="err:SEPM0010">err:SEPM0010</a>] results; the <a title=
"serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error.</p>
</div>
<div class="div3">
<h4><a name="XML_NORMALIZATION-FORM" id=
"XML_NORMALIZATION-FORM"></a>5.1.8 XML Output Method: the
<code>normalization-form</code> Parameter</h4>
<p>The <code>normalization-form</code> parameter is applicable to
the XML output method. The values <code>NFC</code> and
<code>none</code> <strong>MUST</strong> be supported by the
<a title="serializer" href="#serializer">serializer</a>. A
<a title="serialization error" href="#serial-err">serialization
error</a> [<a href="#ERRSESU0011" title=
"err:SESU0011">err:SESU0011</a>] results if the value of the
<code>normalization-form</code> parameter specifies a normalization
form that is not supported by the <a title="serializer" href=
"#serializer">serializer</a>; the <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> signal the
error.</p>
<p>The meanings associated with the possible values of the
<code>normalization-form</code> parameter are as follows:</p>
<ul>
<li>
<p><code>NFC</code> specifies the serialized result will be in
Normalization Form C, using the rules specified in <a href=
"#charmod-norm">[Character Model for the World Wide Web 1.0:
Normalization]</a>.</p>
</li>
<li>
<p><code>NFD</code> specifies the serialized result will be in
Normalization Form D, as specified in <a href=
"#UNICODE-NORMALIZATION-FORM">[UAX #15: Unicode Normalization
Forms]</a>.</p>
</li>
<li>
<p><code>NFKC</code> specifies the serialized result will be in
Normalization Form KC, as specified in <a href=
"#UNICODE-NORMALIZATION-FORM">[UAX #15: Unicode Normalization
Forms]</a>.</p>
</li>
<li>
<p><code>NFKD</code> specifies the serialized result will be in
Normalization Form KD, as specified in <a href=
"#UNICODE-NORMALIZATION-FORM">[UAX #15: Unicode Normalization
Forms]</a>.</p>
</li>
<li>
<p><code>fully-normalized</code> specifies the serialized result
will be in fully normalized text, as specified in <a href=
"#charmod-norm">[Character Model for the World Wide Web 1.0:
Normalization]</a>.</p>
</li>
<li>
<p><code>none</code> specifies that no <a title=
"Unicode Normalization" href="#unicode-normalization">Unicode
Normalization</a> will be applied.</p>
</li>
<li>
<p>An <a title="implementation-defined" href=
"#impdef">implementation-defined</a> value has an <a title=
"implementation-defined" href="#impdef">implementation-defined</a>
effect.</p>
</li>
</ul>
<p>If the value of the parameter is <code>fully-normalized</code>,
then no <em>relevant construct</em> of the parsed entity created by
the <a title="serializer" href="#serializer">serializer</a> may
start with a composing character. The term <em>relevant
construct</em> has the meaning defined in section 2.13 of <a href=
"#xml11">[XML11]</a>. If this condition is not satisfied, a
<a title="serialization error" href="#serial-err">serialization
error</a> [<a href="#ERRSERE0012" title=
"err:SERE0012">err:SERE0012</a>] <strong>MUST</strong> be
signaled.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>Specifying <code>fully-normalized</code> as the value of this
parameter does not guarantee that the XML document output by the
<a title="serializer" href="#serializer">serializer</a> will in
fact be fully normalized as defined in <a href=
"#xml11">[XML11]</a>. This is because the <a title="serializer"
href="#serializer">serializer</a> does not check that the text is
<code>include normalized</code>, which would involve checking all
external entities that it refers to (such as an external DTD).
Furthermore, the <a title="serializer" href=
"#serializer">serializer</a> does not check whether any character
escape generated using character maps represents a composing
character.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="XML_MEDIA-TYPE" id="XML_MEDIA-TYPE"></a>5.1.9 XML
Output Method: the <code>media-type</code> Parameter</h4>
<p>The <code>media-type</code> parameter is applicable to the XML
output method. See <a href="#serparam"><b>3 Serialization
Parameters</b></a> for more information.</p>
</div>
<div class="div3">
<h4><a name="XML_USE-CHARACTER-MAPS" id=
"XML_USE-CHARACTER-MAPS"></a>5.1.10 XML Output Method: the
<code>use-character-maps</code> Parameter</h4>
<p>The <code>use-character-maps</code> parameter is applicable to
the XML output method. The result of serialization using the XML
output method is not guaranteed to be well-formed XML if character
maps have been specified. See <a href="#character-maps"><b>9
Character Maps</b></a> for more information.</p>
</div>
<div class="div3">
<h4><a name="XML_BYTE-ORDER-MARK" id=
"XML_BYTE-ORDER-MARK"></a>5.1.11 XML Output Method: the
<code>byte-order-mark</code> Parameter</h4>
<p>The <code>byte-order-mark</code> parameter is applicable to the
XML output method. See <a href="#serparam"><b>3 Serialization
Parameters</b></a> for more information.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>The byte order mark may be undesirable under certain
circumstances; for example, to concatenate resulting XML fragments
without additional processing to remove the byte order mark.
Therefore this specification does not mandate the
<code>byte-order-mark</code> parameter to have the value
<code>yes</code> when the encoding is UTF-16, even though the XML
1.0 and XML 1.1 specifications state that entities encoded in
UTF-16 must begin with a byte order mark. Consequently, this
specification does not guarantee that the resulting XML fragment,
without a byte order mark, will not cause an error when processed
by a conforming XML processor.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="XML_ESCAPE-URI-ATTRIBUTES" id=
"XML_ESCAPE-URI-ATTRIBUTES"></a>5.1.12 XML Output Method: the
<code>escape-uri-attributes</code> Parameter</h4>
<p>The <code>escape-uri-attributes</code> parameter is not
applicable to the XML output method. It is the responsibility of
the <a title="host language" href="#host-language">host
language</a> to specify whether an error occurs if this parameter
is specified in combination with the XML output method, or if the
parameter is simply dropped.</p>
</div>
<div class="div3">
<h4><a name="XML_INCLUDE-CONTENT-TYPE" id=
"XML_INCLUDE-CONTENT-TYPE"></a>5.1.13 XML Output Method: the
<code>include-content-type</code> Parameter</h4>
<p>The <code>include-content-type</code> parameter is not
applicable to the XML output method. It is the responsibility of
the <a title="host language" href="#host-language">host
language</a> to specify whether an error occurs if this parameter
is specified in combination with the XML output method, or if the
parameter is simply dropped.</p>
</div>
</div>
</div>
<div class="div1">
<h2><a name="xhtml-output" id="xhtml-output"></a>6 XHTML Output
Method</h2>
<p>The XHTML output method serializes the instance of the data
model as XML, using the HTML compatibility guidelines defined in
the XHTML specification.</p>
<p>It is entirely the responsibility of the person or process that
creates the instance of the data model to ensure that the instance
of the data model conforms to the <a href="#xhtml1">[XHTML 1.0]</a>
or <a href="#xhtml11">[XHTML 1.1]</a> specification. It is not an
error if the instance of the data model is invalid XHTML. Equally,
it is entirely under the control of the person or process that
creates the instance of the data model whether the output conforms
to XHTML 1.0 Strict, XHTML 1.0 Transitional, or any other specific
definition of XHTML.</p>
<p>The serialization of the instance of the data model follows the
same rules as for the XML output method, with the
<span>general</span> exceptions noted below <span>and
parameter-specific exceptions in <a href="#XHTML_PARAMS"><b>6.1 The
Influence of Serialization Parameters upon the XHTML Output
Method</b></a></span>. These differences are based on the HTML
compatibility guidelines published in Appendix C of <a href=
"#xhtml1">[XHTML 1.0]</a>, which are designed to ensure that as far
as possible, XHTML is rendered correctly on user agents designed
originally to handle HTML.</p>
<ul>
<li>
<p>[<a name="XHTMLEMPTY" id="XHTMLEMPTY" title=
"EMPTY">Definition</a>: The following XHTML elements have an
<b>EMPTY</b> content model: <code>area</code>, <code>base</code>,
<code>br</code>, <code>col</code>, <code>hr</code>,
<code>img</code>, <code>input</code>, <code>link</code>,
<code>meta</code>, <code>basefont</code>, <code>frame</code>,
<code>isindex</code>, and <code>param</code>.] Given an empty
instance of an XHTML element whose content model is not <a title=
"EMPTY" href="#XHTMLEMPTY">EMPTY</a> (for example, an empty title
or paragraph) the <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST NOT</strong> use the
minimized form. That is, it <strong>MUST</strong> output
<code>&lt;p&gt;&lt;/p&gt;</code> and not
<code>&lt;p&#160;/&gt;</code>.</p>
</li>
<li>
<p><span>If an element that has no children is an XHTML element
with an <a title="EMPTY" href="#XHTMLEMPTY">EMPTY</a> content
model,</span> the <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> use the
minimized tag syntax, for example <code>&lt;br&#160;/&gt;</code>,
as the alternative syntax <code>&lt;br&gt;&lt;/br&gt;</code>
allowed by XML gives uncertain results in many existing user
agents. The <a title="serializer" href="#serializer">serializer</a>
<strong>MUST</strong> include a space before the trailing
<code>/&gt;</code>, e.g. <code>&lt;br&#160;/&gt;</code>,
<code>&lt;hr&#160;/&gt;</code> and
<code>&lt;img&#160;src="karen.jpg"&#160;alt="Karen"&#160;/&gt;</code>.</p>
</li>
<li>
<p>The <a title="serializer" href="#serializer">serializer</a>
<strong>MUST NOT</strong> use the entity reference
<code>&amp;apos;</code> which, although legal in XML and therefore
in XHTML, is not defined in HTML and is not recognized by all HTML
user agents.</p>
</li>
<li>
<p>The <a title="serializer" href="#serializer">serializer</a>
<strong>SHOULD</strong> output namespace declarations in a way that
is consistent with the requirements of the XHTML DTD if this is
possible. The XHTML 1.0 DTDs require the declaration
<code>xmlns="http://www.w3.org/1999/xhtml"</code> to appear on the
<code>html</code> element, and only on the <code>html</code>
element. The <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> output namespace
declarations that are consistent with the namespace <a title="node"
href="#dt-node">nodes</a> present in the <a title="result tree"
href="#result-tree">result tree</a>, but it <strong>MUST</strong>
avoid outputting redundant namespace declarations on elements where
the DTD would make them invalid.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>If the <code>html</code> element is generated by an XSLT literal
result element of the form <code>&lt;html
xmlns="http://www.w3.org/1999/xhtml"&gt; ... &lt;/html&gt;</code>,
or by an XQuery direct element constructor of the same form, then
the <code>html</code> element in the result document will have a
<a title="node" href="#dt-node">node</a> name whose prefix is "",
which will satisfy the requirements of the DTD. In other cases the
prefix assigned to the element is implementation-dependent.</p>
</td>
</tr>
</table>
</blockquote>
</li>
</ul>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>Appendix C of <a href="#xhtml1">[XHTML 1.0]</a> describes a
number of compatibility guidelines for users of XHTML who wish to
render their XHTML documents with HTML user agents. In some cases,
such as the guideline on the form empty elements should take, only
the serialization process itself has the ability to follow the
guideline. In such cases, those guidelines are reflected in the
requirements on the <a title="serializer" href=
"#serializer">serializer</a> described above.</p>
<p>In all other cases, the guidelines can be adhered to by the
instance of the data model that is input to the serialization
process. The guideline on the use of whitespace characters in
attribute values is one such example. Another example is that
<code>xml:lang="..."</code> does not serialize to both
<code>xml:lang="..."</code> and <code>lang="..."</code> as required
by some legacy user agents. It is the responsibility of the person
or process that creates the instance of the data model that is
input to the serialization process to ensure it is created in a way
that is consistent with the guidelines. No <a title=
"serialization error" href="#serial-err">serialization error</a>
results if the input instance of the data model does not adhere to
the guidelines.</p>
</td>
</tr>
</table>
</blockquote>
<div class="div2">
<h3><a name="XHTML_PARAMS" id="XHTML_PARAMS"></a>6.1 The Influence
of Serialization Parameters upon the XHTML Output Method</h3>
<div class="div3">
<h4><a name="XHTML_VERSION" id="XHTML_VERSION"></a>6.1.1 XHTML
Output Method: the <code>version</code> Parameter</h4>
<p>The behavior for <code>version</code> parameter for the XHTML
output method is described in <a href="#XML_VERSION"><b>5.1.1 XML
Output Method: the version Parameter</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_ENCODING" id="XHTML_ENCODING"></a>6.1.2 XHTML
Output Method: the <code>encoding</code> Parameter</h4>
<p>The behavior for <code>encoding</code> parameter for the XHTML
output method is described in <a href="#XML_ENCODING"><b>5.1.2 XML
Output Method: the encoding Parameter</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_INDENT" id="XHTML_INDENT"></a>6.1.3 XHTML Output
Method: the <code>indent</code> Parameter</h4>
<p>If the <code>indent</code> parameter has the value
<code>yes</code>, the serializer <strong>MAY</strong> add or remove
whitespace as it serializes the <a title="result tree" href=
"#result-tree">result tree</a>, <span>if it observes the following
constraints.</span></p>
<ul>
<li>
<p><span>Whitespace <strong>MUST NOT</strong> be added other than
before or after an element, or adjacent to an existing whitespace
character.</span></p>
</li>
<li>
<p><span>Whitespace <strong>MUST NOT</strong> be added or removed
adjacent to an inline element. The inline elements are those
elements in the XHTML namespace in the %inline category of any of
the XHTML 1.0 DTD's, in the %inline.class category of the XHTML 1.1
DTD, and elements in the XHTML namespace with local names
<code>ins</code> and <code>del</code> if they are used as inline
elements (i.e., if they do not contain element
children).</span></p>
</li>
<li>
<p><span>Whitespace <strong>MUST NOT</strong> be added or removed
inside a formatted element, the formatted elements being those in
the XHTML namespace with local names <code>pre</code>,
<code>script</code>, <code>style</code>, and
<code>textarea</code>.</span></p>
</li>
</ul>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p><span>The effect of the above constraints is to ensure any
insertion or deletion of whitespace would not affect how a
conforming HTML user agent would render the output, assuming the
serialized document does not refer to any HTML style
sheets.</span></p>
<p>The HTML definition of whitespace is different from the XML
definition: see section 9.1 of <a href="#html401">[HTML]</a> 4.01
specification.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="XHTML_CDATA-SECTION-ELEMENTS" id=
"XHTML_CDATA-SECTION-ELEMENTS"></a>6.1.4 XHTML Output Method: the
<code>cdata-section-elements</code> Parameter</h4>
<p>The behavior for <code>cdata-section-elements</code> parameter
for the XHTML output method is described in <a href=
"#XML_CDATA-SECTION-ELEMENTS"><b>5.1.4 XML Output Method: the
cdata-section-elements Parameter</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_OMIT-XML-DECLARATION" id=
"XHTML_OMIT-XML-DECLARATION"></a>6.1.5 XHTML Output Method: the
<code>omit-xml-declaration</code> and <code>standalone</code>
Parameters</h4>
<p>The behavior for <code>omit-xml-declaration</code> and
<code>standalone</code> parameters for the XHTML output method is
described in <a href="#XML_OMIT-XML-DECLARATION"><b>5.1.5 XML
Output Method: the omit-xml-declaration and standalone
Parameters</b></a>.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>As with the XML output method, the XHTML output method specifies
that an XML declaration will be output unless it is suppressed
using the <code>omit-xml-declaration</code> parameter. Appendix C.1
of <a href="#xhtml1">[XHTML 1.0]</a> provides advice on the
consequences of including, or omitting, the XML declaration.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="XHTML_DOCTYPE" id="XHTML_DOCTYPE"></a>6.1.6 XHTML
Output Method: the <code>doctype-system</code> and
<code>doctype-public</code> Parameters</h4>
<p>The behavior for <code>doctype-system</code> and
<code>doctype-public</code> parameters for the XHTML output method
is described in <a href="#XML_DOCTYPE"><b>5.1.6 XML Output Method:
the doctype-system and doctype-public Parameters</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_UNDECLARE-PREFIXES" id=
"XHTML_UNDECLARE-PREFIXES"></a>6.1.7 XHTML Output Method: the
<code>undeclare-prefixes</code> Parameter</h4>
<p>The behavior for <code>undeclare-prefixes</code> parameter for
the XHTML output method is described in <a href=
"#xml-undeclare-NS"><b>5.1.7 XML Output Method: the
undeclare-prefixes Parameter</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_NORMALIZATION-FORM" id=
"XHTML_NORMALIZATION-FORM"></a>6.1.8 XHTML Output Method: the
<code>normalization-form</code> Parameter</h4>
<p>The behavior for <code>normalization-form</code> parameter for
the XHTML output method is described in <a href=
"#XML_NORMALIZATION-FORM"><b>5.1.8 XML Output Method: the
normalization-form Parameter</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_MEDIA-TYPE" id="XHTML_MEDIA-TYPE"></a>6.1.9
XHTML Output Method: the <code>media-type</code> Parameter</h4>
<p>The behavior for <code>media-type</code> parameter for the XHTML
output method is described in <a href="#XML_MEDIA-TYPE"><b>5.1.9
XML Output Method: the media-type Parameter</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_USE-CHARACTER-MAPS" id=
"XHTML_USE-CHARACTER-MAPS"></a>6.1.10 XHTML Output Method: the
<code>use-character-maps</code> Parameter</h4>
<p>The behavior for <code>use-character-maps</code> parameter for
the XHTML output method is described in <a href=
"#XML_USE-CHARACTER-MAPS"><b>5.1.10 XML Output Method: the
use-character-maps Parameter</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_BYTE-ORDER-MARK" id=
"XHTML_BYTE-ORDER-MARK"></a>6.1.11 XHTML Output Method: the
<code>byte-order-mark</code> Parameter</h4>
<p>The behavior for <code>byte-order-mark</code> parameter for the
XHTML output method is described in <a href=
"#XML_BYTE-ORDER-MARK"><b>5.1.11 XML Output Method: the
byte-order-mark Parameter</b></a>.</p>
</div>
<div class="div3">
<h4><a name="XHTML_ESCAPE-URI-ATTRIBUTES" id=
"XHTML_ESCAPE-URI-ATTRIBUTES"></a>6.1.12 XHTML Output Method: the
<code>escape-uri-attributes</code> Parameter</h4>
<p>If the <code>escape-uri-attributes</code> parameter has the
value <code>yes</code>, the XHTML output method
<strong>MUST</strong> apply <a title="URI Escaping" href=
"#uri-escaping">URI escaping</a> to <a title="URI attribute values"
href="#uri-attribute-values">URI attribute values</a>, except that
relative URIs <strong>MUST NOT</strong> be absolutized.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>This escaping is deliberately confined to non-ASCII characters,
because escaping of ASCII characters is not always appropriate, for
example when URIs or URI fragments are interpreted locally by the
HTML user agent. Even in the case of non-ASCII characters, escaping
can sometimes cause problems. More precise control of <a title=
"URI Escaping" href="#uri-escaping">URI escaping</a> is therefore
available by setting <code>escape-uri-attributes</code> to
<code>no</code>, and controlling the escaping of URIs by using
methods defined in <a href=
"http://www.w3.org/TR/xpath-functions/#func-encode-for-uri">Section
7.4.10 fn:encode-for-uri</a><sup><small>FO</small></sup> and
<a href=
"http://www.w3.org/TR/xpath-functions/#func-iri-to-uri">Section
7.4.11 fn:iri-to-uri</a><sup><small>FO</small></sup>.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="XHTML_INCLUDE-CONTENT-TYPE" id=
"XHTML_INCLUDE-CONTENT-TYPE"></a>6.1.13 XHTML Output Method: the
<code>include-content-type</code> Parameter</h4>
<p>If the instance of the data model includes a <code>head</code>
element in the XHTML namespace, and the
<code>include-content-type</code> parameter has the value
<code>yes</code>, the XHTML output method <strong>MUST</strong> add
a <code>meta</code> element as the first child element of the
<code>head</code> element, specifying the character encoding
actually used.</p>
<div class="exampleOuter">
<p>For example,</p>
<div class="exampleInner">
<pre>
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" /&gt;
...
</pre></div>
</div>
<p>The content type <strong>SHOULD</strong> be set to the value
given for the <code>media-type</code> parameter.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>It is recommended that the <a title="host language" href=
"#host-language">host language</a> use as default value for this
parameter one of the MIME types (<a href="#RFC2046">[RFC2046]</a>)
registered for XHTML. Currently, these are <code>text/html</code>
(registered by <a href="#RFC2854">[RFC2854]</a>) and
<code>application/xhtml+xml</code> (registered by <a href=
"#RFC3236">[RFC3236]</a>). Note that some user agents fail to
recognize the charset parameter if the content type is not
<code>text/html</code>.</p>
</td>
</tr>
</table>
</blockquote>
<p>If a <code>meta</code> element has been added to the
<code>head</code> element as described above, then any existing
<code>meta</code> element child of the <code>head</code> element
having an <code>http-equiv</code> attribute with the value
"Content-Type", making the comparison without consideration of
casing and leading/trailing spaces, <strong>MUST</strong> be
discarded.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>This process removes possible parameters in the attribute value.
For example,</p>
<div class="exampleInner">
<pre>
&lt;meta http-equiv="Content-Type" content="text/html;version='3.0'" /&gt;
</pre></div>
<p>in the data model instance would be replaced by,</p>
<div class="exampleInner">
<pre>
&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /&gt;
</pre></div>
</td>
</tr>
</table>
</blockquote>
</div>
</div>
</div>
<div class="div1">
<h2><a name="html-output" id="html-output"></a>7 HTML Output
Method</h2>
<p>The HTML output method serializes the instance of the data model
as HTML.</p>
<div class="exampleOuter">
<p>For example, the following XSL stylesheet generates html
output,</p>
<div class="exampleInner">
<pre>
&lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
&lt;xsl:output method="html" version="4.0"/&gt;
&lt;xsl:template match="/"&gt;
  &lt;html&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/html&gt;
&lt;/xsl:template&gt;
...
&lt;/xsl:stylesheet&gt;
</pre></div>
</div>
<p>In the example, the <code>version</code> attribute of the
<code>xsl:output</code> element indicates the version of the HTML
Recommendation <a href="#html401">[HTML]</a> to which the
serialized result is to conform.</p>
<p>It is entirely the responsibility of the person or process that
creates the instance of the data model to ensure that the instance
of the data model conforms to the HTML Recommendation <a href=
"#html401">[HTML]</a>. It is not an error if the instance of the
data model is invalid HTML. Equally, it is entirely under the
control of the person or process that creates the instance of the
data model whether the output conforms to HTML.</p>
<div class="div2">
<h3><a name="HTML_MARKUP" id="HTML_MARKUP"></a>7.1 Markup for
Elements</h3>
<p>The HTML output method <strong>MUST NOT</strong> output an
element differently from the XML output method unless the expanded
QName of the element has a <a title="null namespace URI" href=
"#null-namespace-URI">null namespace URI</a>. [<a name="XML-ISLAND"
id="XML-ISLAND" title="XML Island">Definition</a>: An element whose
expanded QName has a <a title="non-null namespace URI" href=
"#non-null-namespace-URI">non-null namespace URI</a>
<strong>MUST</strong> be output as XML. This is known as an <b>XML
Island</b>.] If the expanded QName of the element has a <a title=
"null namespace URI" href="#null-namespace-URI">null namespace
URI</a>, but the local part of the expanded QName is not recognized
as the name of an HTML element, the element <strong>MUST</strong>
be output in the same way as a non-empty, inline element such as
<code>span</code>. In particular:</p>
<ol class="enumar">
<li>
<p>If the <a title="result tree" href="#result-tree">result
tree</a> contains namespace <a title="node" href=
"#dt-node">nodes</a> for namespaces other than the XML namespace,
the HTML output method <strong>MUST</strong> represent these
namespaces using attributes named <code>xmlns</code> or
<code>xmlns:</code><em>prefix</em> in the same way as the XML
output method would represent them when the <code>version</code>
parameter is set to <code>1.0</code>.</p>
</li>
<li>
<p>If the <a title="result tree" href="#result-tree">result
tree</a> contains elements or attributes whose names have a
<a title="non-null namespace URI" href=
"#non-null-namespace-URI">non-null namespace URI</a>, the HTML
output method <strong>MUST</strong> generate namespace-prefixed
QNames for these <a title="node" href="#dt-node">nodes</a> in the
same way as the XML output method would do when the
<code>version</code> parameter is set to <code>1.0</code>.</p>
</li>
<li>
<p>Where special rules are defined later in this section for
serializing specific HTML elements and attributes, these rules
<strong>MUST NOT</strong> be applied to an element or attribute
whose name has a <a title="non-null namespace URI" href=
"#non-null-namespace-URI">non-null namespace URI</a>. However, the
generic rules for the HTML output method that apply to all elements
and attributes, for example the rules for escaping special
characters in the text and the rules for indentation,
<strong>MUST</strong> be used also for namespaced elements and
attributes.</p>
</li>
<li>
<p>When serializing an element whose name is not defined in the
HTML specification, but that is in the null namespace, the HTML
output method <strong>MUST</strong> apply the same rules (for
example, indentation rules) as when serializing a <code>span</code>
element. The descendants of such an element <strong>MUST</strong>
be serialized as if they were descendants of a <code>span</code>
element.</p>
</li>
<li>
<p>When serializing an element whose name is in a non-null
namespace, the HTML output method <strong>MUST</strong> apply the
same rules (for example, indentation rules) as when serializing a
<code>div</code> element. The descendants of such an element
<strong>MUST</strong> be serialized as if they were descendants of
a <code>div</code> element. <span>, except for the influence of the
<code>cdata-section-elements</code> serialization parameter on any
text node children of the element.</span></p>
</li>
</ol>
<p>The HTML output method <strong>MUST NOT</strong> output an
end-tag for an <span>empty element if the element type has an empty
content model.</span> For HTML 4.0, the <span>element types that
have an empty content model are</span> <code>area</code>,
<code>base</code>, <code>basefont</code>, <code>br</code>,
<code>col</code>, <code>frame</code>, <code>hr</code>,
<code>img</code>, <code>input</code>, <code>isindex</code>,
<code>link</code>, <code>meta</code> and <code>param</code>. For
example, an element written as <code>&lt;br/&gt;</code> or
<code>&lt;br&gt;&lt;/br&gt;</code> in an XSLT stylesheet
<strong>MUST</strong> be output as <code>&lt;br&gt;</code>.</p>
<p>The HTML output method <strong>MUST</strong> recognize the names
of HTML elements regardless of case. For example, elements named
<code>br</code>, <code>BR</code> or <code>Br</code>
<strong>MUST</strong> all be recognized as the HTML <code>br</code>
element and output without an end-tag.</p>
<p>The HTML output method <strong>MUST NOT</strong> perform
escaping for the content of the <code>script</code> and
<code>style</code> elements.</p>
<div class="exampleOuter">
<p>For example, a <code>script</code> element created by an XQuery
direct element constructor or an XSLT literal result element, such
as:</p>
<div class="exampleInner">
<pre>
&lt;script&gt;if (a &amp;lt; b) foo()&lt;/script&gt;
</pre></div>
<p>or</p>
<div class="exampleInner">
<pre>
&lt;script&gt;&lt;![CDATA[if (a &lt; b) foo()]]&gt;&lt;/script&gt;
</pre></div>
<p><strong>MUST</strong> be output as</p>
<div class="exampleInner">
<pre>
&lt;script&gt;if (a &lt; b) foo()&lt;/script&gt;
</pre></div>
</div>
<div class="exampleOuter">
<p>A common requirement is to output a <code>script</code> element
as shown in the example below:</p>
<div class="exampleInner">
<pre>
&lt;script type="application/ecmascript"&gt;
      document.write ("&lt;em&gt;This won't work&lt;/em&gt;")
&lt;/script&gt;
</pre></div>
<p>This is illegal HTML, for the reasons explained in section B.3.2
of the <a href="#html401">[HTML]</a> 4.01 specification.
Nevertheless, it is possible to output this fragment, using either
of the following constructs:</p>
<p>Firstly, by use of a <code>script</code> element created by an
XQuery direct element constructor or an XSLT literal result
element:</p>
<div class="exampleInner">
<pre>
&lt;script type="application/ecmascript"&gt;
      document.write ("&lt;em&gt;This won't work&lt;/em&gt;")
&lt;/script&gt;
</pre></div>
<p>Secondly, by constructing the markup from ordinary text
characters:</p>
<div class="exampleInner">
<pre>
&lt;script type="application/ecmascript"&gt;
      document.write ("&amp;lt;em&amp;gt;This won't work&amp;lt;/em&amp;gt;")
&lt;/script&gt;
</pre></div>
<p>As the <a href="#html401">[HTML]</a> specification points out,
the correct way to write this is to use the escape conventions for
the specific scripting language. For JavaScript, it can be written
as:</p>
<div class="exampleInner">
<pre>
&lt;script type="application/ecmascript"&gt;
      document.write ("&amp;lt;em&amp;gt;This will work&amp;lt;\/em&amp;gt;")
&lt;/script&gt;
</pre></div>
<p>The <a href="#html401">[HTML]</a> 4.01 specification also shows
examples of how to write this in various other scripting languages.
The escaping <strong>MUST</strong> be done manually; it will not be
done by the <a title="serializer" href=
"#serializer">serializer</a>.</p>
</div>
</div>
<div class="div2">
<h3><a name="HTML_ATTRIBS" id="HTML_ATTRIBS"></a>7.2 Writing
Attributes</h3>
<p>The HTML output method <strong>MUST NOT</strong> escape
"<code>&lt;</code>" characters occurring in attribute values.</p>
<p>The HTML output method <strong>MUST</strong> output boolean
attributes (that is attributes with only a single allowed value
that is equal to the name of the attribute) in minimized form.</p>
<div class="exampleOuter">
<p>For example, a start-tag created using the following XQuery
direct element constructor or XSLT literal result element</p>
<div class="exampleInner">
<pre>
&lt;OPTION selected="selected"&gt;
</pre></div>
<p><strong>MUST</strong> be output as</p>
<div class="exampleInner">
<pre>
&lt;OPTION selected&gt;
</pre></div>
</div>
<p>The HTML output method <strong>MUST NOT</strong> escape a
<code>&amp;</code> character occurring in an attribute value
immediately followed by a <code>{</code> character (see <a href=
"http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.7.1.1">Section
B.7.1</a> of the HTML Recommendation <a href=
"#html401">[HTML]</a>).</p>
<div class="exampleOuter">
<p>For example, a start-tag created using the following XQuery
direct element constructor or XSLT literal result element</p>
<div class="exampleInner">
<pre>
&lt;BODY bgcolor='&amp;amp;{{randomrbg}};'&gt;
</pre></div>
<p><strong>MUST</strong> be output as</p>
<div class="exampleInner">
<pre>
&lt;BODY bgcolor='&amp;{randomrbg};'&gt;
</pre></div>
</div>
<p>See <a href="#HTML_PARAMS"><b>7.4 The Influence of Serialization
Parameters upon the HTML Output Method</b></a> for additional
directives on how attributes may be written.</p>
</div>
<div class="div2">
<h3><a name="HTML_CHARDATA" id="HTML_CHARDATA"></a>7.3 Writing
Character Data</h3>
<p>The HTML output method <strong>MAY</strong> output a character
using a character entity reference in preference to using a numeric
character reference, if an entity is defined for the character in
the version of HTML that the output method is using. Entity
references and character references <strong>SHOULD</strong> be used
only where the character is not present in the selected encoding,
or where the visual representation of the character is unclear (as
with <code>&amp;nbsp;</code>, for example).</p>
<p>When outputting a sequence of whitespace characters in the
instance of the data model, within an element where whitespace is
treated normally (but not in elements such as <code>pre</code> and
<code>textarea</code>), the HTML output method <strong>MAY</strong>
represent it using any sequence of whitespace that will be treated
in the same way by an HTML user agent. See section 3.5 of <a href=
"#xhtml-modularization">[XHTML Modularization]</a> for some
additional information on handling of whitespace by an HTML user
agent.</p>
<p>Certain characters, specifically the control characters
#x7F-#x9F, are legal in XML but not in HTML. It is a <a title=
"serialization error" href="#serial-err">serialization error</a>
[<a href="#ERRSERE0014" title="err:SERE0014">err:SERE0014</a>] to
use the HTML output method when such characters appear in the
instance of the data model. The <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> signal the
error.</p>
<p>The HTML output method <strong>MUST</strong> terminate
processing instructions with <code>&gt;</code> rather than
<code>?&gt;</code>. It is a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSERE0015"
title="err:SERE0015">err:SERE0015</a>] to use the HTML output
method when <code>&gt;</code> appears within a processing
instruction in the data model instance being serialized.</p>
</div>
<div class="div2">
<h3><a name="HTML_PARAMS" id="HTML_PARAMS"></a>7.4 The Influence of
Serialization Parameters upon the HTML Output Method</h3>
<div class="div3">
<h4><a name="HTML_VERSION" id="HTML_VERSION"></a>7.4.1 HTML Output
Method: the <code>version</code> Parameter</h4>
<p>The <code>version</code> attribute indicates the version of the
HTML Recommendation <a href="#html401">[HTML]</a> to which the
serialized result is to conform. If the <a title="serializer" href=
"#serializer">serializer</a> does not support the version of HTML
specified by this parameter, it <strong>MUST</strong> signal a
<a title="serialization error" href="#serial-err">serialization
error</a> [<a href="#ERRSESU0013" title=
"err:SESU0013">err:SESU0013</a>].</p>
</div>
<div class="div3">
<h4><a name="HTML_ENCODING" id="HTML_ENCODING"></a>7.4.2 HTML
Output Method: the <code>encoding</code> Parameter</h4>
<p>The <code>encoding</code> parameter specifies the encoding to be
used. <a title="serializer" href="#serializer">Serializers</a> are
<strong>REQUIRED</strong> to support values of <code>UTF-8</code>
and <code>UTF-16</code>. A <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSESU0007"
title="err:SESU0007">err:SESU0007</a>] occurs if an output encoding
other than <code>UTF-8</code> or <code>UTF-16</code> is requested
and the <a title="serializer" href="#serializer">serializer</a>
does not support that encoding. The <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> signal the
error.</p>
<p>It is possible that the instance of the data model will contain
a character that cannot be represented in the encoding that the
<a title="serializer" href="#serializer">serializer</a> is using
for output. In this case, if the character occurs in a context
where HTML recognizes character references, then the character
<strong>MUST</strong> be output as a character entity reference or
decimal numeric character reference; otherwise (for example, in a
<code>script</code> or <code>style</code> element or in a comment),
the <a title="serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSERE0008"
title="err:SERE0008">err:SERE0008</a>].</p>
<p>See <a href="#HTML_INCLUDE-CONTENT-TYPE"><b>7.4.13 HTML Output
Method: the include-content-type Parameter</b></a> regarding how
this parameter is used with the <code>include-content-type</code>
parameter.</p>
</div>
<div class="div3">
<h4><a name="HTML_INDENT" id="HTML_INDENT"></a>7.4.3 HTML Output
Method: the <code>indent</code> Parameter</h4>
<p>If the <code>indent</code> parameter has the value
<code>yes</code>, then the HTML output method <strong>MAY</strong>
add or remove whitespace as it serializes the <a title=
"result tree" href="#result-tree">result tree</a>, <span>if it
observes the following constraints.</span></p>
<ul>
<li>
<p><span>Whitespace <strong>MUST NOT</strong> be added other than
before or after an element, or adjacent to an existing whitespace
character.</span></p>
</li>
<li>
<p><span>Whitespace <strong>MUST NOT</strong> be added or removed
adjacent to an inline element. The inline elements are those
included in the <code>%inline</code> category of any of the HTML
4.01 DTD's, as well as the <code>ins</code> and <code>del</code>
elements if they are used as inline elements (i.e., if they do not
contain element children).</span></p>
</li>
<li>
<p><span>Whitespace <strong>MUST NOT</strong> be added or removed
inside a formatted element, the formatted elements being
<code>pre</code>, <code>script</code>, <code>style</code>, and
<code>textarea</code>.</span></p>
</li>
</ul>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p><span>The effect of the above constraints is to ensure any
insertion or deletion of whitespace would not affect how a
conforming HTML user agent would render the output, assuming the
serialized document does not refer to any HTML style
sheets.</span></p>
<p>Note that the HTML definition of whitespace is different from
the XML definition (see section 9.1 of the <a href=
"#html401">[HTML]</a> specification).</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="HTML_CDATA-SECTION-ELEMENTS" id=
"HTML_CDATA-SECTION-ELEMENTS"></a>7.4.4 HTML Output Method: the
<code>cdata-section-elements</code> Parameter</h4>
<p>The <code>cdata-section-elements</code> parameter is not
applicable to the HTML output method, except in the case of
<a title="XML Island" href="#XML-ISLAND">XML Islands</a>.</p>
</div>
<div class="div3">
<h4><a name="HTML_OMIT-XML-DECLARATION" id=
"HTML_OMIT-XML-DECLARATION"></a>7.4.5 HTML Output Method: the
<code>omit-xml-declaration</code> and <code>standalone</code>
Parameters</h4>
<p>The <code>omit-xml-declaration</code> and
<code>standalone</code> parameters are not applicable to the HTML
output method.</p>
</div>
<div class="div3">
<h4><a name="HTML_DOCTYPE" id="HTML_DOCTYPE"></a>7.4.6 HTML Output
Method: the <code>doctype-system</code> and
<code>doctype-public</code> Parameters</h4>
<p>If the <code>doctype-public</code> or
<code>doctype-system</code> parameters are specified, then the HTML
output method <strong>MUST</strong> output a document type
declaration immediately before the first element. The name
following <code>&lt;!DOCTYPE</code> <strong>MUST</strong> be
<code>HTML</code> or <code>html</code>. If the
<code>doctype-public</code> parameter is specified, then the output
method <strong>MUST</strong> output <code>PUBLIC</code> followed by
the specified public identifier; if the <code>doctype-system</code>
parameter is also specified, it <strong>MUST</strong> also output
the specified system identifier following the public identifier. If
the <code>doctype-system</code> parameter is specified but the
<code>doctype-public</code> parameter is not specified, then the
output method <strong>MUST</strong> output <code>SYSTEM</code>
followed by the specified system identifier.</p>
</div>
<div class="div3">
<h4><a name="HTML_UNDECLARE-PREFIXES" id=
"HTML_UNDECLARE-PREFIXES"></a>7.4.7 HTML Output Method: the
<code>undeclare-prefixes</code> Parameter</h4>
<p>The <code>undeclare-prefixes</code> parameter is not applicable
to the HTML output method.</p>
</div>
<div class="div3">
<h4><a name="HTML_NORMALIZATION-FORM" id=
"HTML_NORMALIZATION-FORM"></a>7.4.8 HTML Output Method: the
<code>normalization-form</code> Parameter</h4>
<p>The <code>normalization-form</code> parameter is applicable to
the HTML output method. The values <code>NFC</code> and
<code>none</code> <strong>MUST</strong> be supported by the
<a title="serializer" href="#serializer">serializer</a>. A
<a title="serialization error" href="#serial-err">serialization
error</a> [<a href="#ERRSESU0011" title=
"err:SESU0011">err:SESU0011</a>] results if the value of the
<code>normalization-form</code> parameter specifies a normalization
form that is not supported by the <a title="serializer" href=
"#serializer">serializer</a>; the <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> signal the
error.</p>
</div>
<div class="div3">
<h4><a name="HTML_MEDIA-TYPE" id="HTML_MEDIA-TYPE"></a>7.4.9 HTML
Output Method: the <code>media-type</code> Parameter</h4>
<p>The <code>media-type</code> parameter is applicable to the HTML
output method. See <a href="#serparam"><b>3 Serialization
Parameters</b></a> for more information. See <a href=
"#HTML_INCLUDE-CONTENT-TYPE"><b>7.4.13 HTML Output Method: the
include-content-type Parameter</b></a> regarding how this parameter
is used with the <code>include-content-type</code> parameter.</p>
</div>
<div class="div3">
<h4><a name="HTML_USE-CHARACTER-MAPS" id=
"HTML_USE-CHARACTER-MAPS"></a>7.4.10 HTML Output Method: the
<code>use-character-maps</code> Parameter</h4>
<p>The <code>use-character-maps</code> parameter is applicable to
the HTML output method. See <a href="#character-maps"><b>9
Character Maps</b></a> for more information.</p>
</div>
<div class="div3">
<h4><a name="HTML_BYTE-ORDER-MARK" id=
"HTML_BYTE-ORDER-MARK"></a>7.4.11 HTML Output Method: the
<code>byte-order-mark</code> Parameter</h4>
<p>The <code>byte-order-mark</code> parameter is applicable to the
HTML output method. See <a href="#serparam"><b>3 Serialization
Parameters</b></a> for more information.</p>
</div>
<div class="div3">
<h4><a name="HTML_ESCAPE-URI-ATTRIBUTES" id=
"HTML_ESCAPE-URI-ATTRIBUTES"></a>7.4.12 HTML Output Method: the
<code>escape-uri-attributes</code> Parameter</h4>
<p>If the <code>escape-uri-attributes</code> parameter has the
value <code>yes</code>, the HTML output method
<strong>MUST</strong> apply <a title="URI Escaping" href=
"#uri-escaping">URI escaping</a> to <a title="URI attribute values"
href="#uri-attribute-values">URI attribute values</a>, except that
relative URIs <strong>MUST NOT</strong> be absolutized.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>This escaping is deliberately confined to non-ASCII characters,
because escaping of ASCII characters is not always appropriate, for
example when URIs or URI fragments are interpreted locally by the
HTML user agent. Even in the case of non-ASCII characters, escaping
can sometimes cause problems. More precise control of <a title=
"URI Escaping" href="#uri-escaping">URI escaping</a> is therefore
available by setting <code>escape-uri-attributes</code> to
<code>no</code>, and controlling the escaping of URIs by using
methods defined in <a href=
"http://www.w3.org/TR/xpath-functions/#func-encode-for-uri">Section
7.4.10 fn:encode-for-uri</a><sup><small>FO</small></sup> and
<a href=
"http://www.w3.org/TR/xpath-functions/#func-iri-to-uri">Section
7.4.11 fn:iri-to-uri</a><sup><small>FO</small></sup>.</p>
</td>
</tr>
</table>
</blockquote>
</div>
<div class="div3">
<h4><a name="HTML_INCLUDE-CONTENT-TYPE" id=
"HTML_INCLUDE-CONTENT-TYPE"></a>7.4.13 HTML Output Method: the
<code>include-content-type</code> Parameter</h4>
<p>If there is a <code>head</code> element, and the
<code>include-content-type</code> parameter has the value
<code>yes</code>, the HTML output method <strong>MUST</strong> add
a <code>meta</code> element as the first child element of the
<code>head</code> element specifying the character encoding
actually used.</p>
<div class="exampleOuter">
<p>For example,</p>
<div class="exampleInner">
<pre>
&lt;HEAD&gt;
&lt;META http-equiv="Content-Type" content="text/html; charset=EUC-JP"&gt;
...
</pre></div>
</div>
<p>The content type <strong>MUST</strong> be set to the value given
for the <code>media-type</code> parameter.</p>
<p>If a <code>meta</code> element has been added to the
<code>head</code> element as described above, then any existing
<code>meta</code> element child of the <code>head</code> element
having an <code>http-equiv</code> attribute with the value
"Content-Type"<span>, making the comparison without consideration
of case and leading or trailing spaces,</span>
<strong>MUST</strong> be discarded.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>This process removes possible parameters in the attribute value.
For example,</p>
<div class="exampleInner">
<pre>
&lt;meta http-equiv="Content-Type" content="text/html;version='3.0'"/&gt;
</pre></div>
<p>in the data model instance would be replaced by,</p>
<div class="exampleInner">
<pre>
&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"/&gt;
</pre></div>
</td>
</tr>
</table>
</blockquote>
</div>
</div>
</div>
<div class="div1">
<h2><a name="text-output" id="text-output"></a>8 Text Output
Method</h2>
<p>The Text output method serializes the instance of the data model
by outputting the <a title="string value" href=
"#dt-string-value">string value</a> of the document <a title="node"
href="#dt-node">node</a> created by <span>the markup generation
step of the <a title="" href="#serphases">phases of
serialization</a></span> without any escaping.</p>
<p>A newline character in the instance of the data model
<strong>MAY</strong> be output using any character sequence that is
conventionally used to represent a line ending in the chosen system
environment.</p>
<div class="div2">
<h3><a name="TEXT_PARAMS" id="TEXT_PARAMS"></a>8.1 The Influence of
Serialization Parameters upon the Text Output Method</h3>
<div class="div3">
<h4><a name="TEXT_VERSION" id="TEXT_VERSION"></a>8.1.1 Text Output
Method: the <code>version</code> Parameter</h4>
<p>The <code>version</code> parameter is not applicable to the Text
output method.</p>
</div>
<div class="div3">
<h4><a name="TEXT_ENCODING" id="TEXT_ENCODING"></a>8.1.2 Text
Output Method: the <code>encoding</code> Parameter</h4>
<p>The <code>encoding</code> parameter identifies the encoding that
the Text output method <strong>MUST</strong> use to convert
sequences of characters to sequences of bytes. <a title=
"serializer" href="#serializer">Serializers</a> are
<strong>REQUIRED</strong> to support values of <code>UTF-8</code>
and <code>UTF-16</code>. A <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSESU0007"
title="err:SESU0007">err:SESU0007</a>] occurs if the <a title=
"serializer" href="#serializer">serializer</a> does not support the
encoding specified by the <code>encoding</code> parameter. The
<a title="serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error. If the instance of the data
model contains a character that cannot be represented in the
encoding that the <a title="serializer" href=
"#serializer">serializer</a> is using for output, the <a title=
"serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal a <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSERE0008"
title="err:SERE0008">err:SERE0008</a>].</p>
</div>
<div class="div3">
<h4><a name="TEXT_INDENT" id="TEXT_INDENT"></a>8.1.3 Text Output
Method: the <code>indent</code> Parameter</h4>
<p>The <code>indent</code> parameter is not applicable to the Text
output method.</p>
</div>
<div class="div3">
<h4><a name="TEXT_CDATA-SECTION-ELEMENTS" id=
"TEXT_CDATA-SECTION-ELEMENTS"></a>8.1.4 Text Output Method: the
<code>cdata-section-elements</code> Parameter</h4>
<p>The <code>cdata-section-elements</code> parameter is not
applicable to the Text output method.</p>
</div>
<div class="div3">
<h4><a name="TEXT_OMIT-XML-DECLARATION" id=
"TEXT_OMIT-XML-DECLARATION"></a>8.1.5 Text Output Method: the
<code>omit-xml-declaration</code> and <code>standalone</code>
Parameters</h4>
<p>The <code>omit-xml-declaration</code> and
<code>standalone</code> parameters are not applicable to the Text
output method.</p>
</div>
<div class="div3">
<h4><a name="TEXT_DOCTYPE" id="TEXT_DOCTYPE"></a>8.1.6 Text Output
Method: the <code>doctype-system</code> and
<code>doctype-public</code> Parameters</h4>
<p>The <code>doctype-system</code> and <code>doctype-public</code>
parameters are not applicable to the Text output method.</p>
</div>
<div class="div3">
<h4><a name="TEXT_UNDECLARE-PREFIXES" id=
"TEXT_UNDECLARE-PREFIXES"></a>8.1.7 Text Output Method: the
<code>undeclare-prefixes</code> Parameter</h4>
<p>The <code>undeclare-prefixes</code> parameter is not applicable
to the Text output method.</p>
</div>
<div class="div3">
<h4><a name="TEXT_NORMALIZATION-FORM" id=
"TEXT_NORMALIZATION-FORM"></a>8.1.8 Text Output Method: the
<code>normalization-form</code> Parameter</h4>
<p>The <code>normalization-form</code> parameter is applicable to
the Text output method. The values <code>NFC</code> and
<code>none</code> <strong>MUST</strong> be supported by the
<a title="serializer" href="#serializer">serializer</a>. A
<a title="serialization error" href="#serial-err">serialization
error</a> [<a href="#ERRSESU0011" title=
"err:SESU0011">err:SESU0011</a>] results if the value of the
<code>normalization-form</code> parameter specifies a normalization
form that is not supported by the <a title="serializer" href=
"#serializer">serializer</a>; the <a title="serializer" href=
"#serializer">serializer</a> <strong>MUST</strong> signal the
error.</p>
</div>
<div class="div3">
<h4><a name="TEXT_MEDIA-TYPE" id="TEXT_MEDIA-TYPE"></a>8.1.9 Text
Output Method: the <code>media-type</code> Parameter</h4>
<p>The <code>media-type</code> parameter is applicable to the Text
output method. See <a href="#serparam"><b>3 Serialization
Parameters</b></a> for more information.</p>
</div>
<div class="div3">
<h4><a name="TEXT_USE-CHARACTER-MAPS" id=
"TEXT_USE-CHARACTER-MAPS"></a>8.1.10 Text Output Method: the
<code>use-character-maps</code> Parameter</h4>
<p>The <code>use-character-maps</code> parameter is applicable to
the Text output method. See <a href="#character-maps"><b>9
Character Maps</b></a> for more information.</p>
</div>
<div class="div3">
<h4><a name="TEXT_BYTE-ORDER-MARK" id=
"TEXT_BYTE-ORDER-MARK"></a>8.1.11 Text Output Method: the
<code>byte-order-mark</code> Parameter</h4>
<p>The <code>byte-order-mark</code> parameter is applicable to the
Text output method. See <a href="#serparam"><b>3 Serialization
Parameters</b></a> for more information.</p>
</div>
<div class="div3">
<h4><a name="TEXT_ESCAPE-URI-ATTRIBUTES" id=
"TEXT_ESCAPE-URI-ATTRIBUTES"></a>8.1.12 Text Output Method: the
<code>escape-uri-attributes</code> Parameter</h4>
<p>The <code>escape-uri-attributes</code> parameter is not
applicable to the Text output method.</p>
</div>
<div class="div3">
<h4><a name="TEXT_INCLUDE-CONTENT-TYPE" id=
"TEXT_INCLUDE-CONTENT-TYPE"></a>8.1.13 Text Output Method: the
<code>include-content-type</code> Parameter</h4>
<p>The <code>include-content-type</code> parameter is not
applicable to the Text output method.</p>
</div>
</div>
</div>
<div class="div1">
<h2><a name="character-maps" id="character-maps"></a>9 Character
Maps</h2>
<p>The <code>use-character-maps</code> parameter is a list of
characters and corresponding string substitutions.</p>
<p>Character maps allow a specific character appearing in a text or
attribute <a title="node" href="#dt-node">node</a> in the instance
of the data model to be replaced with a specified string of
characters during serialization. The string that is substituted is
output "as is," and the <a title="serializer" href=
"#serializer">serializer</a> performs no checks that the resulting
document is well-formed. This mechanism can therefore be used to
introduce arbitrary markup in the serialized output. See <a href=
"http://www.w3.org/TR/xslt20/#character-maps">Section 20.1
Character Maps</a><sup><small>XT</small></sup> of <a href=
"#xslt20">[XSL Transformations (XSLT) Version 2.0]</a> for examples
of using character mapping in XSLT.</p>
<p>Character mapping is applied to the characters that actually
appear in a text or attribute <a title="node" href=
"#dt-node">node</a> in the instance of the data model, before any
other serialization operations such as escaping or <a title=
"Unicode Normalization" href="#unicode-normalization">Unicode
Normalization</a> are applied. If a character is mapped, then it is
not subjected to XML or HTML escaping, nor to Unicode
Normalization. The string that is substituted for a character is
not validated or processed in any way by the <a title="serializer"
href="#serializer">serializer</a>, except for translation into the
target encoding. In particular, it is not subjected to XML or HTML
escaping, it is not subjected to Unicode Normalization, and it is
not subjected to further character mapping.</p>
<p>Character mapping is not applied to characters in text <a title=
"node" href="#dt-node">nodes</a> whose parent elements are listed
in the <code>cdata-section-elements</code> parameter, nor to
characters for which output escaping has been disabled (disabling
output escaping is an <a href="#xslt20">[XSL Transformations (XSLT)
Version 2.0]</a> feature), nor to characters in attribute values
that are subject to <a title="URI Escaping" href=
"#uri-escaping">URI escaping</a> defined for the HTML and XHTML
output methods, unless <a title="URI Escaping" href=
"#uri-escaping">URI escaping</a> has been disabled using the
<code>escape-uri-attributes</code> parameter in the output
definition.</p>
<p>On serialization, occurrences of a character specified in the
<code>use-character-maps</code> in text <a title="node" href=
"#dt-node">nodes</a> and attribute values are replaced by the
corresponding string from the <code>use-character-maps</code>
parameter.</p>
<blockquote>
<table width="90%" summary="Note">
<tr>
<td width="10%" align="left" valign="top"><b>Note:</b></td>
<td align="left" valign="top">
<p>Using a character map can result in non-well-formed documents if
the string contains XML-significant characters. For example, it is
possible to create documents containing unmatched start and end
tags, references to entities that are not declared, or attributes
that contain tags or unescaped quotation marks.</p>
</td>
</tr>
</table>
</blockquote>
<p>If a character is mapped, then it is not subjected to XML or
HTML escaping.</p>
<p>A <a title="serialization error" href=
"#serial-err">serialization error</a> [<a href="#ERRSERE0008"
title="err:SERE0008">err:SERE0008</a>] occurs if character mapping
causes the output of a string containing a character that cannot be
represented in the encoding that the <a title="serializer" href=
"#serializer">serializer</a> is using for output. The <a title=
"serializer" href="#serializer">serializer</a>
<strong>MUST</strong> signal the error.</p>
</div>
<div class="div1">
<h2><a name="conformance" id="conformance"></a>10 Conformance</h2>
<p>[<a name="host-language" id="host-language" title=
"host language">Definition</a>: Serialization is intended primarily
as a component of a <b>host language</b> such as <a href=
"#xslt20">[XSL Transformations (XSLT) Version 2.0]</a> or <a href=
"#xquery">[XQuery 1.0: An XML Query Language]</a>.] Therefore, this
document relies on specifications that use it to specify
conformance criteria for Serialization in their respective
environments. Specifications that set conformance criteria for
their use of Serialization <strong>MUST NOT</strong> change the
semantic definitions of Serialization as given in this
specification, except by subsetting and/or compatible extensions.
It is the responsibility of the <a title="host language" href=
"#host-language">host language</a> to specify how <a title=
"serialization error" href="#serial-err">serialization errors</a>
should be handled.</p>
<p>Certain facilities in this specification are described as
producing <a title="implementation-defined" href=
"#impdef">implementation-defined</a> results. A claim that asserts
conformance with this specification <strong>MUST</strong> be
accompanied by documentation stating the effect of each
implementation-defined feature. For convenience, a non-normative
checklist of implementation-defined features is provided at
<a href="#implementation-defined-features"><b>D Checklist of
Implementation-Defined Features</b></a>.</p>
</div>
</div>
<div class="back">
<div class="div1">
<h2><a name="references" id="references"></a>A References</h2>
<div class="div2">
<h3><a name="normative-references" id=
"normative-references"></a>A.1 Normative References</h3>
<dl>
<dt class="label"><span><a name="charmod-norm" id=
"charmod-norm"></a>Character Model for the World Wide Web 1.0:
Normalization</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/charmod-norm/"><cite>Character
Model for the World Wide Web 1.0: Normalization</cite></a>, Tex
Texin, Martin J. Dürst, Richard Ishida, <em>et. al.</em>, Editors.
World Wide Web Consortium, 27&#160;Oct&#160;2005. This version is
http://www.w3.org/TR/2005/WD-charmod-norm-20051027/. The <a href=
"http://www.w3.org/TR/charmod-norm/">latest version</a> is
available at http://www.w3.org/TR/charmod-norm/.</div>
</dd>
<dt class="label"><span><a name="xpath-datamodel" id=
"xpath-datamodel"></a>XQuery 1.0 and XPath 2.0 Data
Model</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xpath-datamodel/"><cite>XQuery
1.0 and XPath 2.0 Data Model (XDM) (Second Edition)</cite></a>,
Anders Berglund, Mary Fernández, Ashok Malhotra, Jonathan Marsh,
Marton Nagy, Norman Walsh, Editors. World Wide Web Consortium, 14
December 2010. This version is
http://www.w3.org/TR/2010/REC-xpath-datamodel-20101214/. The
<a href="http://www.w3.org/TR/xpath-datamodel/">latest version</a>
is available at http://www.w3.org/TR/xpath-datamodel/.</div>
</dd>
<dt class="label"><span><a name="xpath-functions" id=
"xpath-functions"></a>XQuery 1.0 and XPath 2.0 Functions and
Operators</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xpath-functions/"><cite>XQuery
1.0 and XPath 2.0 Functions and Operators (Second
Edition)</cite></a>, Ashok Malhotra, Jim Melton, Norman Walsh, and
Michael Kay, Editors. World Wide Web Consortium, 14 December 2010.
This version is
http://www.w3.org/TR/2010/REC-xpath-functions-20101214/. The
<a href="http://www.w3.org/TR/xpath-functions/">latest version</a>
is available at http://www.w3.org/TR/xpath-functions/.</div>
</dd>
<dt class="label"><span><a name="html401" id=
"html401"></a>HTML</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/html401/"><cite>HTML 4.01
Specification</cite></a>, Ian Jacobs, David Raggett, and Arnaud Le
Hors, Editors. World Wide Web Consortium, 24&#160;Dec&#160;1999.
This version is http://www.w3.org/TR/1999/REC-html401-19991224/.
The <a href="http://www.w3.org/TR/html401/">latest version</a> is
available at http://www.w3.org/TR/html401/.</div>
</dd>
<dt class="label"><span><a name="IANA" id=
"IANA"></a>IANA</span></dt>
<dd>
<div><a href=
"http://www.iana.org/assignments/character-sets"><cite>Character
Sets</cite></a>. Internet Assigned Numbers Authority. Jan
2005.</div>
</dd>
<dt class="label"><span><a name="RFC2046" id=
"RFC2046"></a>RFC2046</span></dt>
<dd>
<div><a href=
"http://www.ietf.org/rfc/rfc2046.txt"><cite>Multipurpose Internet
Mail Extensions (MIME) Part Two: Media Types</cite></a>, N. Freed,
N. Borenstein. Network Working Group, IETF, Nov 1996.</div>
</dd>
<dt class="label"><span><a name="RFC2119" id=
"RFC2119"></a>RFC2119</span></dt>
<dd>
<div><a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words
for use in RFCs to Indicate Requirement Levels</cite></a>, S.
Bradner. Network Working Group, IETF, Mar 1997.</div>
</dd>
<dt class="label"><span><a name="RFC2278" id=
"RFC2278"></a>RFC2278</span></dt>
<dd>
<div><a href="http://www.ietf.org/rfc/rfc2278.txt"><cite>IANA
Charset Registration Procedures</cite></a>, N. Freed and J. Postel
Network Working Group, IETF, Jan 1998.</div>
</dd>
<dt class="label"><span><a name="RFC2854" id=
"RFC2854"></a>RFC2854</span></dt>
<dd>
<div><a href="http://www.ietf.org/rfc/rfc2854.txt"><cite>The
'text/html' Media Type</cite></a>, D. Connolly, L. Masinter.
Network Working Group, IETF, Jun 2000.</div>
</dd>
<dt class="label"><span><a name="RFC3236" id=
"RFC3236"></a>RFC3236</span></dt>
<dd>
<div><a href="http://www.ietf.org/rfc/rfc3236.txt"><cite>The
'application/xhtml+xml' Media Type</cite></a>, M. Baker and P.
Stark. Network Working Group, IETF, Jan 2002.</div>
</dd>
<dt class="label"><span><a name="UNICODE-ENCODING" id=
"UNICODE-ENCODING"></a>Unicode Encoding</span></dt>
<dd>
<div><a href="http://www.unicode.org/reports/tr17/"><cite>Unicode
Character Encoding Model</cite></a>, Unicode Consortium. Unicode
Standard Annex #17.</div>
</dd>
<dt class="label"><span><a name="UNICODE-NORMALIZATION-FORM" id=
"UNICODE-NORMALIZATION-FORM"></a>UAX #15: Unicode Normalization
Forms</span></dt>
<dd>
<div><a href="http://www.unicode.org/reports/tr15/"><cite>Unicode
Normalization Forms</cite></a>, Unicode Consortium. Unicode
Standard Annex #15.</div>
</dd>
<dt class="label"><span><a name="xhtml1" id="xhtml1"></a>XHTML
1.0</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xhtml1/"><cite>XHTML™ 1.0 The
Extensible HyperText Markup Language (Second Edition)</cite></a>,
Steven Pemberton, Editor. World Wide Web Consortium,
01&#160;Aug&#160;2002. This version is
http://www.w3.org/TR/2002/REC-xhtml1-20020801/. The <a href=
"http://www.w3.org/TR/xhtml1/">latest version</a> is available at
http://www.w3.org/TR/xhtml1/.</div>
</dd>
<dt class="label"><span><a name="xhtml11" id="xhtml11"></a>XHTML
1.1</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xhtml11/"><cite>XHTML™ 1.1 -
Module-based XHTML</cite></a>, Murray Altheim and Shane McCarron,
Editors. World Wide Web Consortium, 31&#160;May&#160;2001. This
version is http://www.w3.org/TR/2001/REC-xhtml11-20010531. The
<a href="http://www.w3.org/TR/xhtml11/">latest version</a> is
available at http://www.w3.org/TR/xhtml11/. <a href=
"http://www.w3.org/TR/xhtml11/"><cite>XHTML™ 1.1 - Module-based
XHTML - Second Edition</cite></a>, Masayasu Ishikawa and Shane
McCarron, Editors. World Wide Web Consortium,
16&#160;Feb&#160;2007. This version is
http://www.w3.org/TR/2007/WD-xhtml11-20070216. The <a href=
"http://www.w3.org/TR/xhtml11/">latest version</a> is available at
http://www.w3.org/TR/xhtml11/.</div>
</dd>
<dt class="label"><span><a name="xml" id=
"xml"></a>XML10</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xml/"><cite>Extensible Markup
Language (XML) 1.0 (Fifth Edition)</cite></a>, Jean Paoli, C. M.
Sperberg-McQueen, François Yergeau, <em>et. al.</em>, Editors.
World Wide Web Consortium, 26&#160;Nov&#160;2008. This version is
http://www.w3.org/TR/2008/REC-xml-20081126/. The <a href=
"http://www.w3.org/TR/xml/">latest version</a> is available at
http://www.w3.org/TR/xml/.</div>
</dd>
<dt class="label"><span><a name="xml11" id=
"xml11"></a>XML11</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xml11/"><cite>Extensible Markup
Language (XML) 1.1 (Second Edition)</cite></a>, François Yergeau,
Tim Bray, Jean Paoli, <em>et. al.</em>, Editors. World Wide Web
Consortium, 16&#160;Aug&#160;2006. This version is
http://www.w3.org/TR/2006/REC-xml11-20060816. The <a href=
"http://www.w3.org/TR/xml11/">latest version</a> is available at
http://www.w3.org/TR/xml11/.</div>
</dd>
<dt class="label"><span><a name="xml-names" id="xml-names"></a>XML
Names</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xml-names/"><cite>Namespaces in
XML 1.0 (Second Edition)</cite></a>, Richard Tobin, Dave Hollander,
Tim Bray, and Andrew Layman, Editors. World Wide Web Consortium,
16&#160;Aug&#160;2006. This version is
http://www.w3.org/TR/2006/REC-xml-names-20060816/. The <a href=
"http://www.w3.org/TR/xml-names/">latest version</a> is available
at http://www.w3.org/TR/xml-names/.</div>
</dd>
<dt class="label"><span><a name="xml-names11" id=
"xml-names11"></a>XML Names 1.1</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xml-names11/"><cite>Namespaces
in XML 1.1 (Second Edition)</cite></a>, Andrew Layman, Dave
Hollander, Richard Tobin, and Tim Bray, Editors. World Wide Web
Consortium, 16&#160;Aug&#160;2006. This version is
http://www.w3.org/TR/2006/REC-xml-names11-20060816. The <a href=
"http://www.w3.org/TR/xml-names11/">latest version</a> is available
at http://www.w3.org/TR/xml-names11/.</div>
</dd>
<dt class="label"><span><a name="xmlschema-1" id=
"xmlschema-1"></a>XML Schema</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xmlschema-1/"><cite>XML Schema
Part 1: Structures Second Edition</cite></a>, Henry S. Thompson,
Murray Maloney, David Beech, and Noah Mendelsohn, Editors. World
Wide Web Consortium, 28&#160;Oct&#160;2004. This version is
http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/. The <a href=
"http://www.w3.org/TR/xmlschema-1/">latest version</a> is available
at http://www.w3.org/TR/xmlschema-1/.</div>
</dd>
<dt class="label"><span><a name="xpath20" id="xpath20"></a>XML Path
Language (XPath) 2.0</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xpath20/"><cite>XML Path
Language (XPath) 2.0 (Second Edition)</cite></a>, Don Chamberlin,
Jonathan Robie, Anders Berglund, Scott Boag, <em>et. al.</em>,
Editors. World Wide Web Consortium, 14 December 2010. This version
is http://www.w3.org/TR/2010/REC-xpath20-20101214/. The <a href=
"http://www.w3.org/TR/xpath20/">latest version</a> is available at
http://www.w3.org/TR/xpath20/.</div>
</dd>
<dt class="label"><span><a name="xquery" id="xquery"></a>XQuery
1.0: An XML Query Language</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xquery/"><cite>XQuery 1.0: An
XML Query Language (Second Edition)</cite></a>, Don Chamberlin,
Jonathan Robie, Anders Berglund, Scott Boag, <em>et. al.</em>,
Editors. World Wide Web Consortium, 14 December 2010. This version
is http://www.w3.org/TR/2010/REC-xquery-20101214/. The <a href=
"http://www.w3.org/TR/xquery/">latest version</a> is available at
http://www.w3.org/TR/xquery/.</div>
</dd>
<dt class="label"><span><a name="xslt20" id="xslt20"></a>XSL
Transformations (XSLT) Version 2.0</span></dt>
<dd>
<div><a href="http://www.w3.org/TR/xslt20/"><cite>XSL
Transformations (XSLT) Version 2.0 (Second Edition)</cite></a>
(planned), Michael Kay, Editor. World Wide Web Consortium, 14
December 2010. The <a href="http://www.w3.org/TR/xslt20/">latest
version</a> is available at http://www.w3.org/TR/xslt20/.</div>
</dd>
</dl>
</div>
<div class="div2">
<h3><a name="informative-references" id=
"informative-references"></a>A.2 Informative References</h3>
<dl>
<dt class="label"><span><a name="xhtml-modularization" id=
"xhtml-modularization"></a>XHTML Modularization</span></dt>
<dd>
<div><a href=
"http://www.w3.org/TR/xhtml-modularization/"><cite>XHTML™
Modularization 1.1</cite></a>, Subramanian Peruvemba, Mark Birbeck,
Shane McCarron, <em>et. al.</em>, Editors. World Wide Web
Consortium, 08&#160;Oct&#160;2008. This version is
http://www.w3.org/TR/2008/REC-xhtml-modularization-20081008. The
<a href="http://www.w3.org/TR/xhtml-modularization/">latest
version</a> is available at
http://www.w3.org/TR/xhtml-modularization/. <a href=
"http://www.w3.org/TR/xhtml-modularization/"><cite>Modularization
of XHTML™ 1.0 - Second Edition</cite></a>, , , , <em>et. al.</em>,
Editors. World Wide Web Consortium, 18&#160;Feb&#160;2004. This
version is
http://www.w3.org/TR/2004/WD-xhtml-modularization-20040218. The
<a href="http://www.w3.org/TR/xhtml-modularization/">latest
version</a> is available at
http://www.w3.org/TR/xhtml-modularization/.</div>
</dd>
</dl>
</div>
</div>
<div class="div1">
<h2><a name="id-errors" id="id-errors"></a>B Summary of Error
Conditions</h2>
<p>This document uses the <code>err</code> prefix which represents
the same namespace URI (http://www.w3.org/2005/xqt-errors) as
defined in <a href="#xpath20">[XML Path Language (XPath) 2.0]</a>.
Use of this namespace prefix binding in this document is not
normative.</p>
<dl>
<dt><a name="ERRSENR0001" id="ERRSENR0001"></a>err:SENR0001</dt>
<dd>
<p>It is an error if an item in <em>S<sub>6</sub></em> in <a title=
"sequence normalization" href="#sequence-normalization">sequence
normalization</a> is an attribute node or a namespace node.</p>
</dd>
<dt><a name="ERRSERE0003" id="ERRSERE0003"></a>err:SERE0003</dt>
<dd>
<p>It is an error if the <a title="serializer" href=
"#serializer">serializer</a> is unable to satisfy the rules for
either a well-formed XML document entity or a well-formed XML
external general parsed entity, or both, except for content
modified by the character expansion phase of serialization.</p>
</dd>
<dt><a name="ERRSEPM0004" id="ERRSEPM0004"></a>err:SEPM0004</dt>
<dd>
<p>It is an error to specify the doctype-system parameter, or to
specify the standalone parameter with a value other than
<code>omit</code>, if the instance of the data model contains text
nodes or multiple element nodes as children of the root node.</p>
</dd>
<dt><a name="ERRSERE0005" id="ERRSERE0005"></a>err:SERE0005</dt>
<dd>
<p>It is an error if the serialized result would contain an
<a href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</a>
<sup><small>Names</small></sup> that contains a character that is
not permitted by the version of Namespaces in XML specified by the
<code>version</code> parameter.</p>
</dd>
<dt><a name="ERRSERE0006" id="ERRSERE0006"></a>err:SERE0006</dt>
<dd>
<p>It is an error if the serialized result would contain a
character that is not permitted by the version of XML specified by
the <code>version</code> parameter.</p>
</dd>
<dt><a name="ERRSESU0007" id="ERRSESU0007"></a>err:SESU0007</dt>
<dd>
<p>It is an error if an output encoding other than
<code>UTF-8</code> or <code>UTF-16</code> is requested and the
<a title="serializer" href="#serializer">serializer</a> does not
support that encoding.</p>
</dd>
<dt><a name="ERRSERE0008" id="ERRSERE0008"></a>err:SERE0008</dt>
<dd>
<p>It is an error if a character that cannot be represented in the
encoding that the <a title="serializer" href=
"#serializer">serializer</a> is using for output appears in a
context where character references are not allowed (for example if
the character occurs in the name of an element).</p>
</dd>
<dt><a name="ERRSEPM0009" id="ERRSEPM0009"></a>err:SEPM0009</dt>
<dd>
<p>It is an error if the <code>omit-xml-declaration</code>
parameter has the value <code>yes</code>, and the
<code>standalone</code> attribute has a value other than
<code>omit</code>; or the <code>version</code> parameter has a
value other than <code>1.0</code> and the
<code>doctype-system</code> parameter is specified.</p>
</dd>
<dt><a name="ERRSEPM0010" id="ERRSEPM0010"></a>err:SEPM0010</dt>
<dd>
<p>It is an error if the output method is <code>xml</code>, the
value of the <code>undeclare-prefixes</code> parameter is
<code>yes</code>, and the value of the <code>version</code>
parameter is 1.0.</p>
</dd>
<dt><a name="ERRSESU0011" id="ERRSESU0011"></a>err:SESU0011</dt>
<dd>
<p>It is an error if the value of the
<code>normalization-form</code> parameter specifies a normalization
form that is not supported by the <a title="serializer" href=
"#serializer">serializer</a>.</p>
</dd>
<dt><a name="ERRSERE0012" id="ERRSERE0012"></a>err:SERE0012</dt>
<dd>
<p>It is an error if the value of the
<code>normalization-form</code> parameter is
<code>fully-normalized</code> and any relevant construct of the
result begins with a combining character.</p>
</dd>
<dt><a name="ERRSESU0013" id="ERRSESU0013"></a>err:SESU0013</dt>
<dd>
<p>It is an error if the <a title="serializer" href=
"#serializer">serializer</a> does not support the version of XML or
HTML specified by the <code>version</code> parameter.</p>
</dd>
<dt><a name="ERRSERE0014" id="ERRSERE0014"></a>err:SERE0014</dt>
<dd>
<p>It is an error to use the HTML output method when characters
which are legal in XML but not in HTML, specifically the control
characters #x7F-#x9F, appear in the instance of the data model.</p>
</dd>
<dt><a name="ERRSERE0015" id="ERRSERE0015"></a>err:SERE0015</dt>
<dd>
<p>It is an error to use the HTML output method when
<code>&gt;</code> appears within a processing instruction in the
data model instance being serialized.</p>
</dd>
<dt><a name="ERRSEPM0016" id="ERRSEPM0016"></a>err:SEPM0016</dt>
<dd>
<p>It is a an error if a parameter value is invalid for the defined
domain.</p>
</dd>
</dl>
</div>
<div class="div1">
<h2><a name="list-of-uri-attributes" id=
"list-of-uri-attributes"></a>C List of URI Attributes</h2>
<p>The following list of attributes are declared as type
<code>%URI</code> or <code>%UriList</code> for a given HTML or
XHTML element, with the exception of the <code>name</code>
attribute for element <code>A</code> which is not a URI type. The
<code>name</code> attribute for element <code>A</code> should be
escaped as is recommended by the HTML Recommendation <a href=
"#html401">[HTML]</a> in Appendix B.2.1.</p>
<table width="500" border="1" summary="Attributes of type URI">
<col width="200" span="1" />
<col width="300" span="1" />
<thead>
<tr>
<th align="left">Attributes</th>
<th align="left">Elements</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" colspan="1">action</td>
<td rowspan="1" colspan="1">FORM</td>
</tr>
<tr>
<td rowspan="1" colspan="1">archive</td>
<td rowspan="1" colspan="1">OBJECT</td>
</tr>
<tr>
<td rowspan="1" colspan="1">background</td>
<td rowspan="1" colspan="1">BODY</td>
</tr>
<tr>
<td rowspan="1" colspan="1">cite</td>
<td rowspan="1" colspan="1">BLOCKQUOTE, DEL, INS, Q</td>
</tr>
<tr>
<td rowspan="1" colspan="1">classid</td>
<td rowspan="1" colspan="1">OBJECT</td>
</tr>
<tr>
<td rowspan="1" colspan="1">codebase</td>
<td rowspan="1" colspan="1">APPLET, OBJECT</td>
</tr>
<tr>
<td rowspan="1" colspan="1">data</td>
<td rowspan="1" colspan="1">OBJECT</td>
</tr>
<tr>
<td rowspan="1" colspan="1">datasrc</td>
<td rowspan="1" colspan="1">BUTTON, DIV, INPUT, OBJECT, SELECT,
SPAN, TABLE, TEXTAREA</td>
</tr>
<tr>
<td rowspan="1" colspan="1">for</td>
<td rowspan="1" colspan="1">SCRIPT</td>
</tr>
<tr>
<td rowspan="1" colspan="1">href</td>
<td rowspan="1" colspan="1">A, AREA, BASE, LINK</td>
</tr>
<tr>
<td rowspan="1" colspan="1">longdesc</td>
<td rowspan="1" colspan="1">FRAME, IFRAME, IMG</td>
</tr>
<tr>
<td rowspan="1" colspan="1">name</td>
<td rowspan="1" colspan="1">A</td>
</tr>
<tr>
<td rowspan="1" colspan="1">profile</td>
<td rowspan="1" colspan="1">HEAD</td>
</tr>
<tr>
<td rowspan="1" colspan="1">src</td>
<td rowspan="1" colspan="1">FRAME, IFRAME, IMG, INPUT, SCRIPT</td>
</tr>
<tr>
<td rowspan="1" colspan="1">usemap</td>
<td rowspan="1" colspan="1">IMG, INPUT, OBJECT</td>
</tr>
</tbody>
</table>
</div>
<div class="div1">
<h2><a name="implementation-defined-features" id=
"implementation-defined-features"></a>D Checklist of
Implementation-Defined Features (Non-Normative)</h2>
<p>This appendix provides a summary of Serialization features whose
effect is explicitly <a title="implementation-defined" href=
"#impdef">implementation-defined</a>. The conformance rules (see
<a href="#conformance"><b>10 Conformance</b></a>) require vendors
to provide documentation that explains how these choices have been
exercised.</p>
<ol>
<li>For any <a title="implementation-defined" href=
"#impdef">implementation-defined</a> output method, it is <a title=
"implementation-defined" href="#impdef">implementation-defined</a>
whether <a title="sequence normalization" href=
"#sequence-normalization">sequence normalization</a> process takes
place. (See <a href="#serdm"><b>2 Sequence
Normalization</b></a>)</li>
<li>If the namespace URI is non-null for the <code>method</code>
serialization parameter, then the parameter specifies an <a title=
"implementation-defined" href="#impdef">implementation-defined</a>
output method. (See <a href="#serparam"><b>3 Serialization
Parameters</b></a>)</li>
<li>The effect of additional serialization parameters on the output
of the serializer, where the name of such a parameter must be
namespace-qualified, is <a title="implementation-defined" href=
"#impdef">implementation-defined</a> or <a title=
"implementation-dependent" href=
"#impdep">implementation-dependent</a>. The extent of this effect
on the output must not override the provisions of this
specification. (See <a href="#serparam"><b>3 Serialization
Parameters</b></a>)</li>
<li>The effect of providing an option that allows the encoding
phase to be skipped, so that the result of serialization is a
stream of Unicode characters, is <a title="implementation-defined"
href="#impdef">implementation-defined</a>. The <a title=
"serializer" href="#serializer">serializer</a> is not required to
support such an option. (See <a href="#serphases"><b>4 Phases of
Serialization</b></a>)</li>
<li>An <a title="serializer" href="#serializer">serializer</a> may
provide an <a title="implementation-defined" href=
"#impdef">implementation-defined</a> mechanism to place CDATA
sections in the <a title="result tree" href="#result-tree">result
tree</a>. (See <a href="#XML_CDATA-SECTION-ELEMENTS"><b>5.1.4 XML
Output Method: the cdata-section-elements Parameter</b></a>)</li>
<li>If the value of the <code>normalization-form</code> form
parameter is not <code>NFC</code>, <code>NFD</code>,
<code>NFKC</code>, <code>NFKD</code>,
<code>fully-normalized</code>, or <code>none</code> then the
meaning of the value and its effect is <a title=
"implementation-defined" href="#impdef">implementation-defined</a>.
(See <a href="#XML_NORMALIZATION-FORM"><b>5.1.8 XML Output Method:
the normalization-form Parameter</b></a>)</li>
</ol>
</div>
<div class="div1">
<h2><a name="changes-since-edition-1" id=
"changes-since-edition-1"></a>E Changes since the First Edition
(Non-Normative)</h2>
<p>The changes made to this document are described in detail in the
<a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html">
Errata</a> to the first edition. The rationale for each erratum is
explained in the corresponding Bugzilla database entry. The
following table summarizes the errata that have been applied.</p>
<table border="1" cellpadding="5" width="100%">
<thead>
<tr>
<td rowspan="1" colspan="1">Erratum</td>
<td rowspan="1" colspan="1">Bugzilla</td>
<td rowspan="1" colspan="1">Category</td>
<td rowspan="1" colspan="1">Description</td>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E1">
E1</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=4372">4372</a></td>
<td rowspan="1" colspan="1">substantive</td>
<td rowspan="1" colspan="1">This erratum places constraints on the
type of string that is valid for the doctype-public attribute of
xsl:output.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E2">
E2</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=4557">4557</a></td>
<td rowspan="1" colspan="1">editorial</td>
<td rowspan="1" colspan="1">This erratum corrects an editorial
error concerning the number of phases of serialization.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E3">
E3</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=5066">5066</a></td>
<td rowspan="1" colspan="1">editorial</td>
<td rowspan="1" colspan="1">This erratum corrects an editorial
error concerning the currently registered XHTML media types.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E4">
E4</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=5433">5433</a></td>
<td rowspan="1" colspan="1">substantive</td>
<td rowspan="1" colspan="1">This erratum clarifies how descendant
elements of an XML island must be serialized according to the HTML
output method.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E5">
E5</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=5439">5439</a></td>
<td rowspan="1" colspan="1">substantive</td>
<td rowspan="1" colspan="1">This erratum aligns the description of
the effect of the include-content-type serialization parameter of
the HTML output method with that of the XHTML output method.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E6">
E6</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=5458">5458</a></td>
<td rowspan="1" colspan="1">substantive</td>
<td rowspan="1" colspan="1">This erratum ensures that the sequence
normalization process preserves any type annotations associated
with nodes in the input sequence.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E7">
E7</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=5300">5300</a></td>
<td rowspan="1" colspan="1">substantive</td>
<td rowspan="1" colspan="1">This erratum clarifies how elements
with empty content models are to be serialized under the HTML and
XHTML output methods.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E8">
E8</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=5441">5441</a></td>
<td rowspan="1" colspan="1">substantive</td>
<td rowspan="1" colspan="1">This erratum ensures that Unicode
normalization applies to all characters that might be adjacent in
the serialized result produced by the text output method, including
those that are in text nodes that are separated by element nodes in
the data model instance.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E9">
E9</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=5993">5993</a></td>
<td rowspan="1" colspan="1">substantive</td>
<td rowspan="1" colspan="1">This erratum makes previously
non-normative text that describes how the xhtml and html output
methods must behave if the indent parameter has the value yes into
normative text.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E10">
E10</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=6466">6466</a></td>
<td rowspan="1" colspan="1">substantive</td>
<td rowspan="1" colspan="1">This erratum specifies the syntactic
constraints on the values of the doctype-public and doctype-system
serialization parameters.</td>
</tr>
<tr>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/XML/2007/qt-errata/xslt-xquery-serialization-errata.html#E11">
E11</a></td>
<td rowspan="1" colspan="1"><a href=
"http://www.w3.org/Bugs/Public/show_bug.cgi?id=6376">6376</a></td>
<td rowspan="1" colspan="1">editorial</td>
<td rowspan="1" colspan="1">This erratum makes clear which parts of
the recommendation are not considered to be normative.</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>