index.html 836 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 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698
<?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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 15.3), see www.w3.org" />
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8" />
<title>XProc: An XML Pipeline Language</title>
<link rel="alternate" title="XML" href="langspec.xml" />
<link rel="alternate" title="Latest editor's draft" href=
"http://www.w3.org/XML/XProc/docs/langspec.html" />
<link rel="alternate" title="Latest Public Working Draft" href=
"http://www.w3.org/TR/xproc/" />
<link rel="alternate" href=
"http://www.w3.org/TR/2010/PR-xproc-20100309/" title=
"09 Mar 2010 Working Draft" />
<link rel="alternate" href=
"http://www.w3.org/TR/2010/WD-xproc-20100105/" title=
"05 Jan 2010 Working Draft" />
<link rel="alternate" href=
"http://www.w3.org/TR/2009/CR-xproc-20090528/" title=
"28 May 2009 Working Draft" />
<link rel="stylesheet" type="text/css" href=
"http://www.w3.org/StyleSheets/TR/base.css" />
<link rel="stylesheet" type="text/css" href="xproc.css" />
<link rel="stylesheet" type="text/css" href=
"http://www.w3.org/StyleSheets/TR/W3C-REC.css" />
</head>
<body>
<div class="specification">
<div class="head" id="spec.head">
<p><a href="http://www.w3.org/"><img height="48" width="72" alt=
"W3C" src="http://www.w3.org/Icons/w3c_home" /></a></p>
<h1>XProc: An XML Pipeline Language</h1>
<h2>W3C Recommendation 11 May 2010</h2>
<dl>
<dt>This Version:</dt>
<dd><a href=
"http://www.w3.org/TR/2010/REC-xproc-20100511/">http://www.w3.org/TR/2010/REC-xproc-20100511/</a></dd>
<dt>Latest Version:</dt>
<dd><a href=
"http://www.w3.org/TR/xproc/">http://www.w3.org/TR/xproc/</a></dd>
<dt>Previous versions:</dt>
<dd><a href=
"http://www.w3.org/TR/2010/PR-xproc-20100309/">http://www.w3.org/TR/2010/PR-xproc-20100309/</a><br />

<a href=
"http://www.w3.org/TR/2010/WD-xproc-20100105/">http://www.w3.org/TR/2010/WD-xproc-20100105/</a><br />

<a href=
"http://www.w3.org/TR/2009/CR-xproc-20090528/">http://www.w3.org/TR/2009/CR-xproc-20090528/</a><br />
</dd>
<dt>Editors:</dt>
<dd><span class="personname">Norman Walsh</span>, <span class=
"orgname">MarkLogic Corporation</span> <tt class=
"email">&lt;<a href=
"mailto:norman.walsh@marklogic.com">norman.walsh@marklogic.com</a>&gt;</tt></dd>
<dd><span class="personname">Alex Milowski</span>, <span class=
"orgname">Invited expert</span> <tt class="email">&lt;<a href=
"mailto:alex@milowski.org">alex@milowski.org</a>&gt;</tt></dd>
<dd><span class="personname">Henry S. Thompson</span>, <span class=
"orgname">University of Edinburgh</span> <tt class=
"email">&lt;<a href=
"mailto:ht@inf.ed.ac.uk">ht@inf.ed.ac.uk</a>&gt;</tt></dd>
</dl>
<p>Please refer to the <a href=
"http://www.w3.org/XML/2010/xproc-errata.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=xproc">
<strong>translations</strong></a>.</p>
<p>This document is also available in these non-normative formats:
<a href="langspec.xml">XML</a></p>
<p class="copyright"><a href=
"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
© 2010 <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.org/"><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>
<hr />
<div class="abstract">
<h2>Abstract</h2>
<p>This specification describes the syntax and semantics of
<em class="citetitle">XProc: An XML Pipeline Language</em>, a
language for describing operations to be performed on XML
documents.</p>
<p>An XML Pipeline specifies a sequence of operations to be
performed on zero or more XML documents. Pipelines generally accept
zero or more XML documents as input and produce zero or more XML
documents as output. Pipelines are made up of simple steps which
perform atomic operations on XML documents and constructs similar
to conditionals, iteration, and exception handlers which control
which steps are executed.</p>
</div>
<div class="status">
<h2>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 document is a <a href=
"http://www.w3.org/2005/10/Process-20051014/tr.html#q74">W3C
Recommendation</a>. It implements the requirements and use cases
documented in [<a href="#use-cases"><span class="abbrev">XProc
Requirements</span></a>]. This document is a product of the
<a href="http://www.w3.org/XML/Processing/">XML Processing Model
Working Group</a> as part of the W3C <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>Please report errors in this document to the public mailing list
<a href=
"mailto:public-xml-processing-model-comments@w3.org">public-xml-processing-model-comments@w3.org</a>
(public <a href=
"http://lists.w3.org/Archives/Public/public-xml-processing-model-comments/">
archives</a> are available).</p>
<p>There is an <a href=
"http://www.w3.org/XML/XProc/2010/02/ir.html">Implementation Report
for XProc</a>. It documents the performance of implementations
against the <a href="http://tests.xproc.org/">XProc Test
Suite</a>.</p>
<p>This document was produced by a group operating under the
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
February 2004 W3C Patent Policy</a>. W3C maintains a <a href=
"http://www.w3.org/2004/01/pp-impl/38398/status">public list of any
patent disclosures</a> made in connection with the deliverables of
the group; that page also includes instructions for disclosing a
patent. An individual who has actual knowledge of a patent which
the individual believes contains <a href=
"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">
Essential Claim(s)</a> must disclose the information in accordance
with <a href=
"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">
section 6 of the W3C Patent Policy</a>.</p>
</div>
</div>
<hr />
<div id="spectoc">
<div class="toc">
<h2 id="TableOfContents">Table of Contents</h2>
<dl class="toc">
<dt><span>1&#160;<a href=
"#introduction">Introduction</a></span></dt>
<dt><span>2&#160;<a href="#pipeline-concepts">Pipeline
Concepts</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.1&#160;<a href="#step-concept">Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.1.1&#160;<a href="#step-names">Step
names</a></span></dt>
</dl>
</dd>
<dt><span>2.2&#160;<a href="#input-output">Inputs and
Outputs</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.2.1&#160;<a href="#external-docs">External
Documents</a></span></dt>
<dt><span>2.2.2&#160;<a href="#binary">Non-XML
Documents</a></span></dt>
</dl>
</dd>
<dt><span>2.3&#160;<a href="#primary-input-output">Primary Inputs
and Outputs</a></span></dt>
<dt><span>2.4&#160;<a href=
"#connections">Connections</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.4.1&#160;<a href="#namespace-fixup">Namespace Fixup on
Outputs</a></span></dt>
</dl>
</dd>
<dt><span>2.5&#160;<a href=
"#environment">Environment</a></span></dt>
<dt><span>2.6&#160;<a href="#xpath-context">XPaths in
XProc</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.6.1&#160;<a href="#xpath10-processors">XPath 1.0
processors</a></span></dt>
<dt><span>2.6.2&#160;<a href="#xpath20-processors">XPath 2.0
processors</a></span></dt>
</dl>
</dd>
<dt><span>2.7&#160;<a href="#xpath-extension-functions">XPath
Extension Functions</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.7.1&#160;<a href="#f.system-property">System
Properties</a></span></dt>
<dt><span>2.7.2&#160;<a href="#f.step-available">Step
Available</a></span></dt>
<dt><span>2.7.3&#160;<a href="#f.value-available">Value
Available</a></span></dt>
<dt><span>2.7.4&#160;<a href="#f.iteration-position">Iteration
Position</a></span></dt>
<dt><span>2.7.5&#160;<a href="#f.iteration-size">Iteration
Size</a></span></dt>
<dt><span>2.7.6&#160;<a href="#f.base-uri">Base URI</a></span></dt>
<dt><span>2.7.7&#160;<a href="#f.resolve-uri">Resolve
URI</a></span></dt>
<dt><span>2.7.8&#160;<a href="#f.version-available">Version
Available</a></span></dt>
<dt><span>2.7.9&#160;<a href="#f.xpath-version-available">XPath
Version Available</a></span></dt>
<dt><span>2.7.10&#160;<a href=
"#other-xpath-extension-functions">Other XPath Extension
Functions</a></span></dt>
</dl>
</dd>
<dt><span>2.8&#160;<a href="#psvi-support">PSVIs in
XProc</a></span></dt>
<dt><span>2.9&#160;<a href="#variables">Variables</a></span></dt>
<dt><span>2.10&#160;<a href="#options">Options</a></span></dt>
<dt><span>2.11&#160;<a href=
"#parameters">Parameters</a></span></dt>
<dt><span>2.12&#160;<a href="#security-considerations">Security
Considerations</a></span></dt>
<dt><span>2.13&#160;<a href="#versioning-considerations">Versioning
Considerations</a></span></dt>
<dd>
<dl class="toc">
<dt><span>2.13.1&#160;<a href="#vers-backcomp">Backwards-compatible
Mode</a></span></dt>
<dt><span>2.13.2&#160;<a href="#vers-forwcomp">Forwards-compatible
Mode</a></span></dt>
</dl>
</dd>
</dl>
</dd>
<dt><span>3&#160;<a href="#syntax">Syntax Overview</a></span></dt>
<dd>
<dl class="toc">
<dt><span>3.1&#160;<a href="#namespaces">XProc
Namespaces</a></span></dt>
<dt><span>3.2&#160;<a href="#scoping">Scoping of
Names</a></span></dt>
<dt><span>3.3&#160;<a href="#xml-base-attribute">Base URIs and
xml:base</a></span></dt>
<dt><span>3.4&#160;<a href="#xml-id-attribute">Unique
identifiers</a></span></dt>
<dt><span>3.5&#160;<a href="#syntax-docs-ports">Associating
Documents with Ports</a></span></dt>
<dt><span>3.6&#160;<a href=
"#documentation">Documentation</a></span></dt>
<dt><span>3.7&#160;<a href="#annotations">Processor
annotations</a></span></dt>
<dt><span>3.8&#160;<a href="#extension-attributes">Extension
attributes</a></span></dt>
<dt><span>3.9&#160;<a href="#use-when">Conditional Element
Exclusion</a></span></dt>
<dt><span>3.10&#160;<a href="#syntax-summaries">Syntax
Summaries</a></span></dt>
<dt><span>3.11&#160;<a href="#common-errors">Common
errors</a></span></dt>
</dl>
</dd>
<dt><span>4&#160;<a href="#steps">Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.1&#160;<a href="#p.pipeline">p:pipeline</a></span></dt>
<dt><span>4.2&#160;<a href="#p.for-each">p:for-each</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.2.1&#160;<a href="#for-each-xpath-context">XPath
Context</a></span></dt>
</dl>
</dd>
<dt><span>4.3&#160;<a href="#p.viewport">p:viewport</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.3.1&#160;<a href="#viewport-xpath-context">XPath
Context</a></span></dt>
</dl>
</dd>
<dt><span>4.4&#160;<a href="#p.choose">p:choose</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.4.1&#160;<a href=
"#p.xpath-context">p:xpath-context</a></span></dt>
<dt><span>4.4.2&#160;<a href="#p.when">p:when</a></span></dt>
<dt><span>4.4.3&#160;<a href=
"#p.otherwise">p:otherwise</a></span></dt>
</dl>
</dd>
<dt><span>4.5&#160;<a href="#p.group">p:group</a></span></dt>
<dt><span>4.6&#160;<a href="#p.try">p:try</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.6.1&#160;<a href="#err-vocab">The Error
Vocabulary</a></span></dt>
</dl>
</dd>
<dt><span>4.7&#160;<a href="#p.atomic">Atomic Steps</a></span></dt>
<dt><span>4.8&#160;<a href="#p.extension">Extension
Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>4.8.1&#160;<a href="#option-shortcut">Syntactic Shortcut
for Option Values</a></span></dt>
</dl>
</dd>
</dl>
</dd>
<dt><span>5&#160;<a href="#other-elements">Other pipeline
elements</a></span></dt>
<dd>
<dl class="toc">
<dt><span>5.1&#160;<a href="#p.input">p:input</a></span></dt>
<dd>
<dl class="toc">
<dt><span>5.1.1&#160;<a href="#document-inputs">Document
Inputs</a></span></dt>
<dt><span>5.1.2&#160;<a href="#parameter-inputs">Parameter
Inputs</a></span></dt>
</dl>
</dd>
<dt><span>5.2&#160;<a href=
"#p.iteration-source">p:iteration-source</a></span></dt>
<dt><span>5.3&#160;<a href=
"#p.viewport-source">p:viewport-source</a></span></dt>
<dt><span>5.4&#160;<a href="#p.output">p:output</a></span></dt>
<dt><span>5.5&#160;<a href="#p.log">p:log</a></span></dt>
<dt><span>5.6&#160;<a href=
"#p.serialization">p:serialization</a></span></dt>
<dt><span>5.7&#160;<a href=
"#variables-options-parameters">Variables, Options, and
Parameters</a></span></dt>
<dd>
<dl class="toc">
<dt><span>5.7.1&#160;<a href=
"#p.variable">p:variable</a></span></dt>
<dt><span>5.7.2&#160;<a href="#p.option">p:option</a></span></dt>
<dt><span>5.7.3&#160;<a href=
"#p.with-option">p:with-option</a></span></dt>
<dt><span>5.7.4&#160;<a href=
"#p.with-param">p:with-param</a></span></dt>
<dt><span>5.7.5&#160;<a href="#opt-param-bindings">Namespaces on
variables, options, and parameters</a></span></dt>
</dl>
</dd>
<dt><span>5.8&#160;<a href=
"#p.declare-step">p:declare-step</a></span></dt>
<dd>
<dl class="toc">
<dt><span>5.8.1&#160;<a href="#declare-atomic-steps">Declaring
atomic steps</a></span></dt>
<dt><span>5.8.2&#160;<a href="#declare-pipelines">Declaring
pipelines</a></span></dt>
</dl>
</dd>
<dt><span>5.9&#160;<a href="#p.library">p:library</a></span></dt>
<dt><span>5.10&#160;<a href="#p.import">p:import</a></span></dt>
<dt><span>5.11&#160;<a href="#p.pipe">p:pipe</a></span></dt>
<dt><span>5.12&#160;<a href="#p.inline">p:inline</a></span></dt>
<dt><span>5.13&#160;<a href=
"#p.document">p:document</a></span></dt>
<dt><span>5.14&#160;<a href="#p.data">p:data</a></span></dt>
<dt><span>5.15&#160;<a href="#p.empty">p:empty</a></span></dt>
<dt><span>5.16&#160;<a href=
"#p.documentation">p:documentation</a></span></dt>
<dt><span>5.17&#160;<a href=
"#p.pipeinfo">p:pipeinfo</a></span></dt>
</dl>
</dd>
<dt><span>6&#160;<a href="#errors">Errors</a></span></dt>
<dd>
<dl class="toc">
<dt><span>6.1&#160;<a href="#static-errors">Static
Errors</a></span></dt>
<dt><span>6.2&#160;<a href="#dynamic-errors">Dynamic
Errors</a></span></dt>
<dt><span>6.3&#160;<a href="#step-errors">Step
Errors</a></span></dt>
</dl>
</dd>
<dt><span>7&#160;<a href="#std-components">Standard Step
Library</a></span></dt>
<dd>
<dl class="toc">
<dt><span>7.1&#160;<a href="#std-required">Required
Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>7.1.1&#160;<a href=
"#c.add-attribute">p:add-attribute</a></span></dt>
<dt><span>7.1.2&#160;<a href=
"#c.add-xml-base">p:add-xml-base</a></span></dt>
<dt><span>7.1.3&#160;<a href="#c.compare">p:compare</a></span></dt>
<dt><span>7.1.4&#160;<a href="#c.count">p:count</a></span></dt>
<dt><span>7.1.5&#160;<a href="#c.delete">p:delete</a></span></dt>
<dt><span>7.1.6&#160;<a href=
"#c.directory-list">p:directory-list</a></span></dt>
<dt><span>7.1.7&#160;<a href="#c.error">p:error</a></span></dt>
<dt><span>7.1.8&#160;<a href=
"#c.escape-markup">p:escape-markup</a></span></dt>
<dt><span>7.1.9&#160;<a href="#c.filter">p:filter</a></span></dt>
<dt><span>7.1.10&#160;<a href=
"#c.http-request">p:http-request</a></span></dt>
<dt><span>7.1.11&#160;<a href=
"#c.identity">p:identity</a></span></dt>
<dt><span>7.1.12&#160;<a href="#c.insert">p:insert</a></span></dt>
<dt><span>7.1.13&#160;<a href=
"#c.label-elements">p:label-elements</a></span></dt>
<dt><span>7.1.14&#160;<a href="#c.load">p:load</a></span></dt>
<dt><span>7.1.15&#160;<a href=
"#c.make-absolute-uris">p:make-absolute-uris</a></span></dt>
<dt><span>7.1.16&#160;<a href=
"#c.namespace-rename">p:namespace-rename</a></span></dt>
<dt><span>7.1.17&#160;<a href="#c.pack">p:pack</a></span></dt>
<dt><span>7.1.18&#160;<a href=
"#c.parameters">p:parameters</a></span></dt>
<dt><span>7.1.19&#160;<a href="#c.rename">p:rename</a></span></dt>
<dt><span>7.1.20&#160;<a href=
"#c.replace">p:replace</a></span></dt>
<dt><span>7.1.21&#160;<a href=
"#c.set-attributes">p:set-attributes</a></span></dt>
<dt><span>7.1.22&#160;<a href="#c.sink">p:sink</a></span></dt>
<dt><span>7.1.23&#160;<a href=
"#c.split-sequence">p:split-sequence</a></span></dt>
<dt><span>7.1.24&#160;<a href="#c.store">p:store</a></span></dt>
<dt><span>7.1.25&#160;<a href=
"#c.string-replace">p:string-replace</a></span></dt>
<dt><span>7.1.26&#160;<a href=
"#c.unescape-markup">p:unescape-markup</a></span></dt>
<dt><span>7.1.27&#160;<a href="#c.unwrap">p:unwrap</a></span></dt>
<dt><span>7.1.28&#160;<a href="#c.wrap">p:wrap</a></span></dt>
<dt><span>7.1.29&#160;<a href=
"#c.wrap-sequence">p:wrap-sequence</a></span></dt>
<dt><span>7.1.30&#160;<a href=
"#c.xinclude">p:xinclude</a></span></dt>
<dt><span>7.1.31&#160;<a href="#c.xslt">p:xslt</a></span></dt>
</dl>
</dd>
<dt><span>7.2&#160;<a href="#std-optional">Optional
Steps</a></span></dt>
<dd>
<dl class="toc">
<dt><span>7.2.1&#160;<a href="#c.exec">p:exec</a></span></dt>
<dt><span>7.2.2&#160;<a href="#c.hash">p:hash</a></span></dt>
<dt><span>7.2.3&#160;<a href="#c.uuid">p:uuid</a></span></dt>
<dt><span>7.2.4&#160;<a href=
"#c.validate-with-relax-ng">p:validate-with-relax-ng</a></span></dt>
<dt><span>7.2.5&#160;<a href=
"#c.validate-with-schematron">p:validate-with-schematron</a></span></dt>
<dt><span>7.2.6&#160;<a href=
"#c.validate-with-xml-schema">p:validate-with-xml-schema</a></span></dt>
<dt><span>7.2.7&#160;<a href=
"#c.www-form-urldecode">p:www-form-urldecode</a></span></dt>
<dt><span>7.2.8&#160;<a href=
"#c.www-form-urlencode">p:www-form-urlencode</a></span></dt>
<dt><span>7.2.9&#160;<a href="#c.xquery">p:xquery</a></span></dt>
<dt><span>7.2.10&#160;<a href=
"#c.xsl-formatter">p:xsl-formatter</a></span></dt>
</dl>
</dd>
<dt><span>7.3&#160;<a href="#serialization-options">Serialization
Options</a></span></dt>
</dl>
</dd>
</dl>
</div>
<h3><a name="appendices" id="appendices"></a>Appendices</h3>
<div class="toc">
<dl class="toc">
<dt><span>A&#160;<a href="#conformance">Conformance</a></span></dt>
<dd>
<dl class="toc">
<dt><span>A.1&#160;<a href=
"#implementation-defined">Implementation-defined
features</a></span></dt>
<dt><span>A.2&#160;<a href=
"#implementation-dependent">Implementation-dependent
features</a></span></dt>
<dt><span>A.3&#160;<a href="#infoset-conformance">Infoset
Conformance</a></span></dt>
</dl>
</dd>
<dt><span>B&#160;<a href="#references">References</a></span></dt>
<dd>
<dl class="toc">
<dt><span>B.1&#160;<a href="#normative-references">Normative
References</a></span></dt>
<dt><span>B.2&#160;<a href="#informative-references">Informative
References</a></span></dt>
</dl>
</dd>
<dt><span>C&#160;<a href="#glossary">Glossary</a></span></dt>
<dt><span>D&#160;<a href="#language-summary">Pipeline Language
Summary</a></span></dt>
<dt><span>E&#160;<a href="#errors-list">List of Error
Codes</a></span></dt>
<dd>
<dl class="toc">
<dt><span>E.1&#160;<a href="#app.static-errors">Static
Errors</a></span></dt>
<dt><span>E.2&#160;<a href="#app.dynamic-errors">Dynamic
Errors</a></span></dt>
<dt><span>E.3&#160;<a href="#app.step-errors">Step
Errors</a></span></dt>
</dl>
</dd>
<dt><span>F&#160;<a href="#namespace-fixup-guidance">Guidance on
Namespace Fixup (Non-Normative)</a></span></dt>
<dt><span>G&#160;<a href="#handling-imports">Handling Circular and
Re-entrant Library Imports (Non-Normative)</a></span></dt>
<dt><span>H&#160;<a href="#parallelism">Sequential steps,
parallelism, and side-effects</a></span></dt>
<dt><span>I&#160;<a href="#xproc-media-type">The <tt class=
"code">application/xproc+xml</tt> media type</a></span></dt>
<dd>
<dl class="toc">
<dt><span>I.1&#160;<a href="#media-type-registration">Registration
of MIME media type application/xproc+xml</a></span></dt>
<dt><span>I.2&#160;<a href="#fragid">Fragment
Identifiers</a></span></dt>
</dl>
</dd>
</dl>
</div>
</div>
<div class="section">
<h3><a name="introduction" id=
"introduction"></a>1&#160;Introduction</h3>
<p>An XML Pipeline specifies a sequence of operations to be
performed on a collection of XML input documents. Pipelines take
zero or more XML documents as their input and produce zero or more
XML documents as their output.</p>
<p>A <em class="glossterm"><a href="#dt-pipeline">pipeline</a></em>
consists of steps. Like pipelines, steps take zero or more XML
documents as their inputs and produce zero or more XML documents as
their outputs. The inputs of a step come from the web, from the
pipeline document, from the inputs to the pipeline itself, or from
the outputs of other steps in the pipeline. The outputs from a step
are consumed by other steps, are outputs of the pipeline as a
whole, or are discarded.</p>
<p>There are three kinds of steps: atomic steps, compound steps,
and multi-container steps. Atomic steps carry out single operations
and have no substructure as far as the pipeline is concerned.
Compound steps and multi-container steps control the execution of
other steps, which they include in the form of one or more
subpipelines.</p>
<p>This specification defines a standard library, <a href=
"#std-components" title="Standard Step Library">Section&#160;7,
“Standard Step Library”</a>, of steps. Pipeline implementations
<span class="rfc2119">may</span> support additional types of steps
as well.</p>
<p><a href="#fig-xival" title=
"A simple, linear XInclude/Validate pipeline">Figure&#160;1, “A
simple, linear XInclude/Validate pipeline”</a> is a graphical
representation of a simple pipeline that performs XInclude
processing and validation on a document.</p>
<div class="figure-wrapper" id="fig-xival">
<div class="figure">
<div class="mediaobject"><img src=
"graphics/sch-xinclude-validate-pipeline.png" alt=
"A simple, linear XInclude/Validate pipeline" /></div>
</div>
<div class="title">Figure&#160;1.&#160;A simple, linear
XInclude/Validate pipeline</div>
</div>
<p>This is a pipeline that consists of two atomic steps, XInclude
and Validate with XML Schema. The pipeline itself has two inputs,
“source” (a source document) and “schemas” (a sequence of W3C XML
Schemas). The XInclude step reads the pipeline input “source” and
produces a result document. The Validate with XML Schema step reads
the pipeline input “schemas” and the result of the XInclude step
and produces its own result document. The result of the validation,
“result”, is the result of the pipeline. (For consistency across
the step vocabulary, the standard input is usually named “source”
and and the standard output is usually named “result”.)</p>
<p>The pipeline document determines how the steps are connected
together inside the pipeline, that is, how the output of one step
becomes the input of another.</p>
<p>The pipeline document for this pipeline is shown in <a href=
"#ex1" title=
"A simple, linear XInclude/Validate pipeline">Example&#160;1, “A
simple, linear XInclude/Validate pipeline”</a>.</p>
<div class="example-wrapper" id="ex1">
<div class="title">Example&#160;1.&#160;A simple, linear
XInclude/Validate pipeline</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                name="xinclude-and-validate"
                version="1.0"&gt;
  &lt;p:input port="source" primary="true"/&gt;
  &lt;p:input port="schemas" sequence="true"/&gt;
  &lt;p:output port="result"&gt;
    &lt;p:pipe step="validated" port="result"/&gt;
  &lt;/p:output&gt;

  &lt;p:xinclude name="included"&gt;
    &lt;p:input port="source"&gt;
      &lt;p:pipe step="xinclude-and-validate" port="source"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xinclude&gt;

  &lt;p:validate-with-xml-schema name="validated"&gt;
    &lt;p:input port="source"&gt;
      &lt;p:pipe step="included" port="result"/&gt;
    &lt;/p:input&gt;
    &lt;p:input port="schema"&gt;
      &lt;p:pipe step="xinclude-and-validate" port="schemas"/&gt;
    &lt;/p:input&gt;
  &lt;/p:validate-with-xml-schema&gt;
&lt;/p:declare-step&gt;
</pre></div>
</div>
</div>
<p>The example in <a href="#ex1" title=
"A simple, linear XInclude/Validate pipeline">Example&#160;1, “A
simple, linear XInclude/Validate pipeline”</a> is very verbose. It
makes all of the connections seen in the figure explicit. In
practice, pipelines do not have to be this verbose. XProc supports
defaults for many common cases:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If you use <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> instead of <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
the “<tt class="port">source</tt>” input port and “<tt class=
"port">result</tt>” output port are implicitly declared for
you.</p>
</li>
<li>
<p>Where inputs and outputs are connected between sequential
sibling steps, they do not have to be made explicit.</p>
</li>
</ul>
</div>
<p>The same pipeline, using XProc defaults, is shown in <a href=
"#ex1-abbr" title=
"A simple, linear XInclude/Validate pipeline (simplified)">Example&#160;2,
“A simple, linear XInclude/Validate pipeline (simplified)”</a>.</p>
<div class="example-wrapper" id="ex1-abbr">
<div class="title">Example&#160;2.&#160;A simple, linear
XInclude/Validate pipeline (simplified)</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
            name="xinclude-and-validate"
            version="1.0"&gt;
  &lt;p:input port="schemas" sequence="true"/&gt;

  &lt;p:xinclude/&gt;

  &lt;p:validate-with-xml-schema&gt;
    &lt;p:input port="schema"&gt;
      &lt;p:pipe step="xinclude-and-validate" port="schemas"/&gt;
    &lt;/p:input&gt;
  &lt;/p:validate-with-xml-schema&gt;
&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
<p><a href="#fig-style-proc" title=
"A validate and transform pipeline">Figure&#160;2, “A validate and
transform pipeline”</a> is a more complex example: it performs
schema validation with an appropriate schema and then styles the
validated document.</p>
<div class="figure-wrapper" id="fig-style-proc">
<div class="figure">
<div class="mediaobject"><img src="graphics/sch-transform.png" alt=
"A validate and transform pipeline" /></div>
</div>
<div class="title">Figure&#160;2.&#160;A validate and transform
pipeline</div>
</div>
<p>The heart of this example is the conditional. The “choose” step
evaluates an XPath expression over a test document. Based on the
result of that expression, one or another branch is run. In this
example, each branch consists of a single validate step.</p>
<div class="example-wrapper" id="ex2">
<div class="title">Example&#160;3.&#160;A validate and transform
pipeline</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;

  &lt;p:choose&gt;
    &lt;p:when test="/*[@version &amp;lt; 2.0]"&gt;
      &lt;p:validate-with-xml-schema&gt;
        &lt;p:input port="schema"&gt;
          &lt;p:document href="v1schema.xsd"/&gt;
        &lt;/p:input&gt;
      &lt;/p:validate-with-xml-schema&gt;
    &lt;/p:when&gt;

    &lt;p:otherwise&gt;
      &lt;p:validate-with-xml-schema&gt;
        &lt;p:input port="schema"&gt;
          &lt;p:document href="v2schema.xsd"/&gt;
        &lt;/p:input&gt;
      &lt;/p:validate-with-xml-schema&gt;
    &lt;/p:otherwise&gt;
  &lt;/p:choose&gt;

  &lt;p:xslt&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:document href="stylesheet.xsl"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
<p>This example, like the preceding, relies on XProc defaults for
simplicity. It is always valid to write the fully explicit form if
you prefer.</p>
<p>The media type for pipeline documents is <tt class=
"literal">application/xml</tt>. Often, pipeline documents are
identified by the extension <tt class="filename">.xpl</tt>.</p>
<p>In this specification the words <span class=
"rfc2119">must</span>, <span class="rfc2119">must not</span>,
<span class="rfc2119">should</span>, <span class="rfc2119">should
not</span>, <span class="rfc2119">may</span> and <span class=
"rfc2119">recommended</span> are to be interpreted as described in
[<a href="#rfc2119"><span class="abbrev">RFC 2119</span></a>].</p>
</div>
<div class="section">
<h3><a name="pipeline-concepts" id=
"pipeline-concepts"></a>2&#160;Pipeline Concepts</h3>
<p><span class="termdef" id="dt-pipeline">[Definition: A <em class=
"glossterm">pipeline</em> is a set of connected steps, with outputs
of one step flowing into inputs of another.]</span> A pipeline is
itself a <em class="glossterm"><a href="#dt-step">step</a></em> and
must satisfy the constraints on steps. Connections between steps
occur where the input of one step is connected to the output of
another.</p>
<p>The result of evaluating a pipeline (or <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>) is the
result of evaluating the steps that it contains, in an order
consistent with the connections between them. A pipeline must
behave as if it evaluated each step each time it is encountered.
Unless otherwise indicated, implementations <span class=
"rfc2119">must not</span> assume that steps are functional (that
is, that their outputs depend only on their <a href=
"#input-output">inputs</a>, <em class="glossterm"><a href=
"#dt-option">options</a></em>, and <em class="glossterm"><a href=
"#dt-parameter">parameters</a></em>) or side-effect free.</p>
<p>The pattern of connections between steps will not always
completely determine their order of evaluation. <a name="impl-1"
id="impl-1"></a>The evaluation order of steps not connected to one
another is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<div class="section">
<h4><a name="step-concept" id=
"step-concept"></a>2.1&#160;Steps</h4>
<p><span class="termdef" id="dt-step">[Definition: A <em class=
"glossterm">step</em> is the basic computational unit of a
pipeline.]</span> A typical step has zero or more inputs, from
which it receives XML documents to process, zero or more outputs,
to which it sends XML document results, and can have options and/or
parameters.</p>
<p>There are three kinds of steps: <em class="glossterm"><a href=
"#dt-atomic-step">atomic</a></em>, <em class="glossterm"><a href=
"#dt-compound-step">compound</a></em>, and <em class=
"glossterm"><a href=
"#dt-multi-container-step">multi-container</a></em>.</p>
<p><span class="termdef" id="dt-atomic-step">[Definition: An
<em class="glossterm">atomic step</em> is a step that performs a
unit of XML processing, such as XInclude or transformation, and has
no internal <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>. ]</span> Atomic steps carry
out fundamental XML operations and can perform arbitrary amounts of
computation, but they are indivisible. An XSLT step, for example,
performs XSLT processing; a Validate with XML Schema step validates
one input with respect to some set of XML Schemas, etc.</p>
<p>There are many <em>types</em> of atomic steps. The standard
library of atomic steps is described in <a href="#std-components"
title="Standard Step Library">Section&#160;7, “Standard Step
Library”</a>, but implementations <span class="rfc2119">may</span>
provide others as well. <a name="impl-2" id="impl-2"></a>It is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> what
additional step types, if any, are provided. Each use, or instance,
of an atomic step invokes the processing defined by that type of
step. A pipeline may contain instances of many types of steps and
many instances of the same type of step.</p>
<p>Compound steps, on the other hand, control and organize the flow
of documents through a pipeline, reconstructing familiar
programming language functionality such as conditionals, iterators
and exception handling. They contain other steps, whose evaluation
they control.</p>
<p><span class="termdef" id="dt-compound-step">[Definition: A
<em class="glossterm">compound step</em> is a step that contains a
<em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.]</span> That is, a compound
step differs from an atomic step in that its semantics are at least
partially determined by the steps that it contains.</p>
<p>Finally, there are two “multi-container steps”: <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> and <a href=
"#p.try"><tt class="tag-element">p:try</tt></a>. <span class=
"termdef" id="dt-multi-container-step">[Definition: A <em class=
"glossterm">multi-container step</em> is a step that contains
several alternate <em class="glossterm"><a href=
"#dt-subpipeline">subpipelines</a></em>. ]</span> Each subpipeline
is identified by a non-step wrapper element: <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> and <a href=
"#p.otherwise"><tt class="tag-element">p:otherwise</tt></a> in the
case of <a href="#p.choose"><tt class=
"tag-element">p:choose</tt></a>, <a href="#p.group"><tt class=
"tag-element">p:group</tt></a> and <a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> in the case of <a href=
"#p.try"><tt class="tag-element">p:try</tt></a>.</p>
<p>The output of a multi-container step is the output of exactly
one of its subpipelines. In this sense, a multi-container step
functions like a <em class="glossterm"><a href=
"#dt-compound-step">compound step</a></em>. However, evaluating a
multi-container step may involve evaluating, or partially
evaluating, more than one of its subpipelines. It's possible for
steps in a partially evaluated pipeline to have side effects that
are visible outside the processor, even if the final output of the
multi-container step is the result of some other subpipeline. For
example, a web server might record that some interaction was
performed, or a file on the local file system might have been
modified.</p>
<p><span class="termdef" id="dt-container">[Definition: A compound
step or multi-container step is a <em class=
"glossterm">container</em> for the steps directly within it or
within non-step wrappers directly within it.]</span> <span class=
"termdef" id="dt-contained-steps">[Definition: The steps that occur
directly within, or within non-step wrappers directly within, a
step are called that step's <em class="glossterm">contained
steps</em>. In other words, “container” and “contained steps” are
inverse relationships.]</span> <span class="termdef" id=
"dt-ancestors">[Definition: The <em class=
"glossterm">ancestors</em> of a step, if it has any, are its
<em class="glossterm"><a href="#dt-container">container</a></em>
and the ancestors of its container.]</span></p>
<p><span class="termdef" id="dt-subpipeline">[Definition: Sibling
steps (and the connections between them) form a <em class=
"glossterm">subpipeline</em>.]</span> <span class="termdef" id=
"dt-last-step">[Definition: The <em class="glossterm">last
step</em> in a subpipeline is its last step in document
order.]</span></p>
<p id="p.subpipeline" class=
"element-syntax element-syntax-language-construct hanging-indent">
<tt class="code">subpipeline</tt>&#160;=&#160;<a href=
"#p.variable"><tt class=
"tag-element">p:variable</tt></a>*,&#160;(<a href=
"#p.for-each"><tt class="tag-element">p:for-each</tt></a>|<a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a>|<a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a>|<a href=
"#p.group"><tt class="tag-element">p:group</tt></a>|<a href=
"#p.try"><tt class="tag-element">p:try</tt></a>|<tt class=
"code"><a href="#p.atomic">p:<em class="replaceable"><tt class=
"replaceable">standard-step</tt></em></a></tt>|<tt class=
"code"><a href="#p.atomic"><em class="replaceable"><tt class=
"replaceable">pfx:user-pipeline</tt></em></a></tt>)+</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>User-defined pipelines (identified with <tt class=
"code"><em class="replaceable"><tt class=
"replaceable">pfx:user-pipeline</tt></em></tt> in the preceding
syntax summary) are atomic. A pipeline <em>declaration</em> may
contain a subpipeline, but the invocation of that pipeline is
atomic and does not contain a subpipeline.</p>
</div>
<p>Steps have “ports” into which inputs and outputs are connected.
Each step has a number of input ports and a number of output ports;
a step can have zero input ports and/or zero output ports. (All
steps have an implicit output port for reporting errors that
<span class="rfc2119">must not</span> be declared.) The names of
all ports on each step must be unique on that step (you can't have
two input ports named “source”, nor can you have an input port
named “schema” and an output port named “schema”).</p>
<p>A Step may have zero or more <a href="#options">options</a>, all
with unique names.</p>
<p>Steps may have parameter input ports, on which <a href=
"#parameters">parameters</a> can be passed. A step can have zero,
one, or many parameter input ports, and each parameter input port
can have zero or more parameters passed on it. If more than one
parameter with the same name is passed to any given parameter input
port, only the last value specified will be available to the step;
the names of the parameters passed to the step are unique on each
port. Parameters with the same name can be passed to different
ports, the uniqueness constraint on names only applies to the
parameters passed on each individual port.</p>
<p>All of the different instances of steps (atomic or compound) in
a pipeline can be distinguished from one another by name. If the
pipeline author does not provide a name for a step, a default name
is <a href="#step-names">manufactured automatically</a>.</p>
<div class="section">
<h5><a name="step-names" id="step-names"></a>2.1.1&#160;Step
names</h5>
<p>The <tt class="tag-attribute">name</tt> attribute on any step
can be used to give it a name. The name must be unique within its
scope, see <a href="#scoping" title=
"Scoping of Names">Section&#160;3.2, “Scoping of Names”</a>.</p>
<p>If the pipeline author does not provide an explicit name, the
processor manufactures a default name. All default names are of the
form “<tt class="literal">!1</tt><em class="replaceable"><tt class=
"replaceable">.m</tt></em><em class="replaceable"><tt class=
"replaceable">.n</tt></em>…” where “<em class=
"replaceable"><tt class="replaceable">m</tt></em>” is the position
(in the sense of counting sibling elements) of the step's highest
ancestor element within the pipeline document or library which
contains it, “<em class="replaceable"><tt class=
"replaceable">n</tt></em>” is the position of the next-highest
ancestor, and so on, including both steps and non-step wrappers.
For example, consider the pipeline in <a href="#ex2" title=
"A validate and transform pipeline">Example&#160;3, “A validate and
transform pipeline”</a>. The <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> step has no name, so it gets the
default name “<tt class="literal">!1</tt>”; the <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> gets the name
<tt class="literal">!1.1</tt>”; the first <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> gets the name
<tt class="literal">!1.1.1</tt>”; the <a href=
"#p.otherwise"><tt class="tag-element">p:otherwise</tt></a> gets
the name “<tt class="literal">!1.1.2</tt>”, etc. If the <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> had had a
name, it would not have received a default name, but it would still
have been counted and its first <a href="#p.when"><tt class=
"tag-element">p:when</tt></a> would still have been “<tt class=
"literal">!1.1.1</tt>”.</p>
<p>Providing every step in the pipeline with an interoperable name
has several benefits:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>It allows implementors to refer to all steps in an interoperable
fashion, for example, in error messages.</p>
</li>
<li>
<p>Pragmatically, we say that <em class="glossterm"><a href=
"#dt-readable-ports">readable ports</a></em> are identified by a
step name/port name pair. By manufacturing names for otherwise
anonymous steps, we include implicit connections without changing
our model.</p>
</li>
</ol>
</div>
<p>In a valid pipeline that runs successfully to completion, the
manufactured names aren't visible (except perhaps in debugging or
logging output).</p>
<div class="admonition" id="def-name-ncname">
<div class="admon-title">Note</div>
<p>The format for defaulted names does not conform to the
requirements of an <a href=
"http://www.w3.org/TR/xml-names/#NT-NCName">NCName</a>. This is an
explicit design decision; it prevents pipelines from using the
defaulted names on <a href="#p.pipe"><tt class=
"tag-element">p:pipe</tt></a> elements. If an explicit connection
is required, the pipeline author must provide an explicit name for
the step.</p>
</div>
</div>
</div>
<div class="section">
<h4><a name="input-output" id="input-output"></a>2.2&#160;Inputs
and Outputs</h4>
<p>Although some steps can read and write non-XML resources, what
flows <em>between</em> steps through input ports and output ports
are exclusively XML documents or sequences of XML documents.</p>
<p>For the purposes of this specification, an XML document is an
[<a href="#xml-infoset-rec"><span class=
"abbrev">Infoset</span></a>]. Implementations are free to transmit
Infosets as sequences of characters, sequences of events, object
models, or any other representation that preserves the necessary
Infoset properties (see <a href="#infoset-conformance" title=
"Infoset Conformance">Section&#160;A.3, “Infoset
Conformance”</a>).</p>
<p>Most steps in this specification manipulate XML documents, or
portions of XML documents. In these cases, we speak of changing
elements, attributes, or nodes without prejudice to the actual
representation used by an implementation.</p>
<p>An implementation <span class="rfc2119">may</span> make it
possible for a step to produce non-XML output (through channels
other than a named output port)—for example, writing a PDF document
to a URI—but that output cannot flow through the pipeline.
Similarly, one can imagine a step that takes no pipeline inputs,
reads a non-XML file from a URI, and produces an XML output. But
the non-XML data cannot arrive on an input port to a step.</p>
<p><a name="err.inline.D0001" id="err.inline.D0001"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0001"><code class=
"errqname">err:XD0001</code></a>) if a non-XML resource is produced
on a step output or arrives on a step input.</p>
<p>The common case is that each step has one or more inputs and one
or more outputs. <a href="#fig-atomic-step" title=
"An atomic step">Figure&#160;3, “An atomic step”</a> illustrates
symbolically an <em class="glossterm"><a href=
"#dt-atomic-step">atomic step</a></em> with two inputs and one
output.</p>
<div class="figure-wrapper" id="fig-atomic-step">
<div class="figure">
<div class="mediaobject"><img src="graphics/atomic-step.png" alt=
"An atomic step with two inputs and one output" /></div>
</div>
<div class="title">Figure&#160;3.&#160;An atomic step</div>
</div>
<p>All atomic steps are defined by a <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>.
The declaration of an atomic step type defines the input ports,
output ports, and options of all steps of that type. For example,
every <a href="#c.validate-with-xml-schema"><tt class=
"tag-element">p:validate-with-xml-schema</tt></a> step has two
inputs, named “<tt class="literal">source</tt>” and “<tt class=
"literal">schema</tt>”, one output named “<tt class=
"literal">result</tt>”, and the same set of options.</p>
<p>Like atomic steps, top level, user-defined pipelines also have
declarations. The situation is slightly more complicated for the
other compound steps because they don't have separate declarations;
each instance of the compound step serves as its own declaration.
On these compound steps, the number and names of the outputs can be
different on each instance of the step.</p>
<p><a href="#fig-compound-step" title=
"A compound step">Figure&#160;4, “A compound step”</a> illustrates
symbolically a compound step with one subpipeline and one output.
As you can see from the diagram, the output from the compound step
comes from one of the outputs of the subpipeline within the
step.</p>
<div class="figure-wrapper" id="fig-compound-step">
<div class="figure">
<div class="mediaobject"><img src="graphics/compound-step.png" alt=
"A compound step with two inputs and one output" /></div>
</div>
<div class="title">Figure&#160;4.&#160;A compound step</div>
</div>
<p><span class="termdef" id="dt-declared-inputs">[Definition: The
input ports declared on a step are its <em class=
"glossterm">declared inputs</em>.]</span> <span class="termdef" id=
"dt-declared-outputs">[Definition: The output ports declared on a
step are its <em class="glossterm">declared outputs</em>.]</span>
When a step is used in a pipeline, it is connected to other steps
through its inputs and outputs.</p>
<p>When a step is used, all of the <em class="glossterm"><a href=
"#dt-declared-inputs">declared inputs</a></em> of the step
<span class="rfc2119">must</span> be connected. Each input can be
connected to:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The output port of some other step.</p>
</li>
<li>
<p>A fixed, inline document or sequence of documents.</p>
</li>
<li>
<p>A document read from a URI.</p>
</li>
<li>
<p>One of the inputs declared on one of its <em class=
"glossterm"><a href="#dt-ancestors">ancestors</a></em>.</p>
</li>
<li>
<p>A special port provided by an ancestor compound step, for
example, “<tt class="port">current</tt>” in a <a href=
"#p.for-each"><tt class="tag-element">p:for-each</tt></a> or
<a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>.</p>
</li>
</ul>
</div>
<p>When an input accepts a sequence of documents, the documents can
come from any combination of these locations.</p>
<p><a name="err.inline.S0003" id="err.inline.S0003"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0003"><code class=
"errqname">err:XS0003</code></a>) if any declared input is not
connected.</p>
<p>The <em class="glossterm"><a href=
"#dt-declared-outputs">declared outputs</a></em> of a step may be
connected to:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The input port of some other step (including <a href=
"#p.iteration-source"><tt class=
"tag-element">p:iteration-source</tt></a> or <a href=
"#p.viewport-source"><tt class=
"tag-element">p:viewport-source</tt></a>).</p>
</li>
<li>
<p>The <a href="#p.xpath-context"><tt class=
"tag-element">p:xpath-context</tt></a> of a <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> or <a href=
"#p.when"><tt class="tag-element">p:when</tt></a>.</p>
</li>
<li>
<p>An option assigned with <a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or a parameter assigned with
<a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a>.</p>
</li>
<li>
<p>One of the outputs declared on its container.</p>
</li>
</ul>
</div>
<p>The <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em> of a step
<span class="rfc2119">must</span> be connected. <a name=
"err.inline.S0005" id="err.inline.S0005"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0005"><code class=
"errqname">err:XS0005</code></a>) if the primary output port of any
step is not connected. Other outputs can remain unconnected. Any
documents produced on an unconnected output port are discarded.</p>
<p>Primary input and primary output ports may be implicitly
connected if no explicit connection is given, see <a href=
"#primary-input-output" title=
"Primary Inputs and Outputs">Section&#160;2.3, “Primary Inputs and
Outputs”</a>.</p>
<p>Output ports on compound steps have a dual nature: from the
perspective of the compound step's siblings, its outputs are just
ordinary outputs and must be connected as described above. From the
perspective of the subpipeline inside the compound step, they are
inputs into which something may be connected.</p>
<p>Within a compound step, the <em class="glossterm"><a href=
"#dt-declared-outputs">declared outputs</a></em> of the step can be
connected to:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The output port of some <em class="glossterm"><a href=
"#dt-contained-steps">contained step</a></em>.</p>
</li>
<li>
<p>A fixed, inline document or sequence of documents.</p>
</li>
<li>
<p>A document read from a URI.</p>
</li>
</ul>
</div>
<p>If a (non-primary) output port of a compound step is left
unconnected, it produces an empty sequence of documents from the
perspective of its siblings.</p>
<p>Each input and output on a step is declared to accept or produce
either a single document or a sequence of documents. It <em>is
not</em> an error to connect a port that is declared to produce a
sequence of documents to a port that is declared to accept only a
single document. It is, however, an error if the former step
actually produces more than one document at run time.</p>
<p>It is also not an error to connect a port that is declared to
produce a single document to a port that is declared to accept a
sequence. A single document is the same as a sequence of one
document.</p>
<p>An output port may have more than one connection: it may be
connected to more than one input port, more than one of its
container's output ports, or both. At runtime this will result in
distinct copies of the output.</p>
<p><span class="termdef" id="dt-signature">[Definition: The
<em class="glossterm">signature</em> of a step is the set of
inputs, outputs, and options that it is declared to accept.]</span>
The declaration for a step provides a fixed signature which all its
instances share.</p>
<p><span class="termdef" id="dt-matches">[Definition: A step
<em class="glossterm">matches</em> its signature if and only if it
specifies an input for each declared input, it specifies no inputs
that are not declared, it specifies an option for each option that
is declared to be required, and it specifies no options that are
not declared.]</span> In other words, every input and required
option <span class="rfc2119">must</span> be specified and only
inputs and options that are declared <span class=
"rfc2119">may</span> be specified. Options that aren't required do
not have to be specified.</p>
<p>Steps <span class="rfc2119">may</span> also produce error,
warning, and informative messages. These messages are captured and
provided on the <tt class="port">error</tt> port inside of a
<a href="#p.catch"><tt class="tag-element">p:catch</tt></a>.
<a name="impl-3" id="impl-3"></a>Outside of a <a href=
"#p.try">try/catch</a>, the disposition of error messages is
<em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p><a name="impl-4" id="impl-4"></a>How inputs are connected to XML
documents outside the pipeline is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. In
order to be consistent with the XPath data model, all general and
external parsed entities in such documents <span class=
"rfc2119">must</span> be fully expanded; they <span class=
"rfc2119">must not</span> contain any representation of [<a href=
"#xml-infoset-rec"><span class="abbrev">Infoset</span></a>]
<tt class="literal">[unexpanded entity reference information
items]</tt>.</p>
<p><a name="impl-5" id="impl-5"></a>How pipeline outputs are
connected to XML documents outside the pipeline is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<div class="section">
<h5><a name="external-docs" id=
"external-docs"></a>2.2.1&#160;External Documents</h5>
<p>It's common for some of the documents used in processing a
pipeline to be read from URIs. Sometimes this occurs directly, for
example with a <a href="#p.document"><tt class=
"tag-element">p:document</tt></a> element. Sometimes it occurs
indirectly, for example if an implementation allows the URI of a
pipeline input to be specified on the command line or if an
<a href="#c.xslt"><tt class="tag-element">p:xslt</tt></a> step
encounters an <tt class="tag-element">xsl:import</tt> in the
stylesheet that it is processing. It's also common for some of the
documents produced in processing a pipeline to be written to
locations which have, or at least could have, a URI.</p>
<p>The process of dereferencing a URI to retrieve a document is
often more interesting than it seems at first. On the web, it may
involve caches, proxies, and various forms of indirection. <a name=
"impl-6" id="impl-6"></a>Resolving a URI locally may involve
resolvers of various sorts and possibly appeal to <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>
mechanisms such as catalog files.</p>
<p>In XProc, the situation is made even more interesting by the
fact that many intermediate results produced by steps in the
pipeline have base URIs. <a name="impl-7" id="impl-7"></a>Whether
(and when and how) or not the intermediate results that pass
between steps are ever written to a filesystem is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p><a name="impl-8" id="impl-8"></a>In Version 1.0 of XProc, how
(or if) implementers provide local resolution mechanisms and how
(or if) they provide access to intermediate results by URI is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>Version 1.0 of XProc does not require implementations to
guarantee that multiple attempts to dereference the same URI always
produce consistent results.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>On the one hand, this is a somewhat unsatisfying state of
affairs because it leaves room for interoperability problems. On
the other, it is not expected to cause such problems very often in
practice.</p>
<p>If these problems arise in practice, implementers are encouraged
to use the existing extension mechanisms to give users the control
needed to circumvent them. Should such mechanisms become
widespread, a standard mechanism could be added in some future
version of the language.</p>
</div>
</div>
<div class="section">
<h5><a name="binary" id="binary"></a>2.2.2&#160;Non-XML
Documents</h5>
<p>XProc is designed to allow pipeline authors to specify how an
XML document, or sequence of XML documents, flows through a series
of steps. For the most part, non-XML documents are considered
out-of-scope.</p>
<p>However, to be useful, XProc pipelines must interact with the
real world where non-XML documents (HTML documents, raster images,
non-XML encodings of data, etc.) are a fact of life.</p>
<p>Accordingly, some pipelines may need to access non-XML documents
and some non-XML documents may “leak” into pipelines. XProc
provides a limited set of tools for processing these documents. In
particular, XProc offers the ability to turn some “almost-XML”
documents into XML and to allow some non-XML documents to flow
quietly through the pipeline.</p>
<p>It <em>is not</em> a goal of XProc that it should be a
general-purpose pipeline language for manipulating arbitrary,
non-XML resources.</p>
<p>There are two standard ways that a non-XML document may enter a
pipeline: directly through <a href="#p.data"><tt class=
"tag-element">p:data</tt></a> or as the result of performing an
<a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step. Loading non-XML data
with a computed URI requires the <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
step. Implementors are encouraged to support the <tt class=
"literal">file:</tt> URI scheme so that users can load local data
from computed URIs.</p>
<p>In either case, non-XML documents are converted into text or are
base64-encoded, depending on their content type and character
encoding. The result is an XML document that consists of a document
element containing either escaped text or base64-encoded text. This
document can be processed like any other XML document.</p>
<p>The <a href="#c.unescape-markup"><tt class=
"tag-element">p:unescape-markup</tt></a> step can be used to
(attempt to) convert a non-XML document into XML. Well-formed XML
that just happens to be represented with escaped markup can always
be recovered. For other media types, the ability to construct XML
and the precise mechanisms used to make the markup well-formed are
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>XProc provides no standard means to save encoded data in its
unencoded binary form. Implementors may provide extension methods
to allow the <a href="#c.store"><tt class=
"tag-element">p:store</tt></a> step to save the binary data. For
example, an implementation might provide a <tt class=
"code">ext:binary</tt> serialization method that decoded base64
encoded data before saving it:</p>
<div class="programlisting">
<pre>
&lt;p:store method="ext:binary" href="my.png"&gt;
  &lt;p:input port="source"&gt;
    &lt;p:inline&gt;
      &lt;c:data content-type="image/png"&gt;BASE64ENCODEDDATA&lt;/c:data&gt;
    &lt;/p:inline&gt;
  &lt;/p:input&gt;
&lt;/p:store&gt;
</pre></div>
</div>
</div>
<div class="section">
<h4><a name="primary-input-output" id=
"primary-input-output"></a>2.3&#160;Primary Inputs and Outputs</h4>
<p>As a convenience for pipeline authors, each step may have one
input port designated as the primary input port and one output port
designated as the primary output port.</p>
<p><span class="termdef" id="dt-primary-input-port">[Definition: If
a step has a document input port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
document input port and that port is <em>not</em> explicitly marked
<tt class="code">primary='false'</tt>”, then that input port is
the <em class="glossterm">primary input port</em> of the
step.]</span> If a step has a single input port and that port is
explicitly marked “<tt class="code">primary='false'</tt>”, or if a
step has more than one input port and none is explicitly marked as
the primary, then the primary input port of that step is undefined.
A step can have at most one primary input port.</p>
<p><span class="termdef" id="dt-primary-output-port">[Definition:
If a step has a document output port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
document output port and that port is <em>not</em> explicitly
marked “<tt class="code">primary='false'</tt>”, then that output
port is the <em class="glossterm">primary output port</em> of the
step.]</span> If a step has a single output port and that port is
explicitly marked “<tt class="code">primary='false'</tt>”, or if a
step has more than one output port and none is explicitly marked as
the primary, then the primary output port of that step is
undefined. A step can have at most one primary output port.</p>
<p>The special significance of primary input and output ports is
that they are connected automatically by the processor if no
explicit connection is given. Generally speaking, if two steps
appear sequentially in a subpipeline, then the primary output of
the first step will automatically be connected to the primary input
of the second.</p>
<p>Additionally, if a compound step has no declared outputs and the
<em class="glossterm"><a href="#dt-last-step">last step</a></em> in
its subpipeline has an unconnected primary output, then an implicit
primary output port will be added to the compound step (and
consequently the last step's primary output will be connected to
it). This implicit output port has no name. It inherits the
<tt class="tag-attribute">sequence</tt> property of the port
connected to it. This rule does not apply to <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>;
step declarations must provide explicit names for all of their
outputs.</p>
</div>
<div class="section">
<h4><a name="connections" id=
"connections"></a>2.4&#160;Connections</h4>
<p>Steps are connected together by their input ports and output
ports. <a name="err.inline.S0001" id="err.inline.S0001"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0001"><code class=
"errqname">err:XS0001</code></a>) if there are any loops in the
connections between steps: no step can be connected to itself nor
can there be any sequence of connections through other steps that
leads back to itself.</p>
<div class="section">
<h5><a name="namespace-fixup" id=
"namespace-fixup"></a>2.4.1&#160;Namespace Fixup on Outputs</h5>
<p>XProc processors are expected, and sometimes required, to
perform <em class="glossterm"><a href=
"#dt-namespace-fixup">namespace fixup</a></em>. Unless the
semantics of a step explicitly says otherwise:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The in-scope namespaces associated with a node (even those that
are inherited from namespace bindings that appear among its
ancestors in the document in which it appears initially) are
assumed to travel with that node.</p>
</li>
<li>
<p>Changes to one part of a tree (wrapping or unwrapping a node or
renaming an element, for example) do not change the in-scope
namespaces associated with the descendants of the node so
changed.</p>
</li>
</ul>
</div>
<p>As a result, some steps can produce XML documents which have no
direct serialization (because they include nodes with conflicting
or missing namespace declarations, for example). <span class=
"termdef" id="dt-namespace-fixup">[Definition: To produce a
serializable <em class="glossterm"><a href="#dt-XML">XML</a></em>
document, the XProc processor must sometimes add additional
namespace nodes, perhaps even renaming prefixes, to satisfy the
constraints of <em class="glossterm"><a href=
"#dt-Namespaces-in-XML">Namespaces in XML</a></em>. This process is
referred to as <em class="glossterm">namespace
fixup</em>.]</span></p>
<p>Implementors are encouraged to perform <em class=
"glossterm"><a href="#dt-namespace-fixup">namespace fixup</a></em>
before passing documents between steps, but they are not required
to do so. Conversely, an implementation which <em>does</em>
serialize between steps and therefore must perform such fixups, or
reject documents that cannot be serialized, is also conformant.</p>
<p>Except where the semantics of a step explicitly require changes,
processors are required to preserve the information in the
documents and fragments they manipulate. In particular, the
information corresponding to the [<a href=
"#xml-infoset-rec"><span class="abbrev">Infoset</span></a>]
properties <tt class="literal">[attributes]</tt>, <tt class=
"literal">[base URI]</tt>, <tt class="literal">[children]</tt>,
<tt class="literal">[local name]</tt>, <tt class=
"literal">[namespace name]</tt>, <tt class="literal">[normalized
value]</tt>, <tt class="literal">[owner]</tt>, and <tt class=
"literal">[parent]</tt> <span class="rfc2119">must</span> be
preserved.</p>
<p>The information corresponding to <tt class=
"literal">[prefix]</tt>, <tt class="literal">[in-scope
namespaces]</tt>, <tt class="literal">[namespace attributes]</tt>,
and <tt class="literal">[attribute type]</tt> <span class=
"rfc2119">should</span> be preserved, with changes to the first
three only as required for <em class="glossterm"><a href=
"#dt-namespace-fixup">namespace fixup</a></em>. In particular,
processors are encouraged to take account of prefix information in
creating new namespace bindings, to minimize negative impact on
prefixed names in content.</p>
<p><a name="impl-9" id="impl-9"></a>Except for cases which are
specifically called out in <a href="#std-components" title=
"Standard Step Library">Section&#160;7, “Standard Step
Library”</a>, the extent to which namespace fixup, and other checks
for outputs which cannot be serialized, are performed on
intermediate outputs is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>Whenever an implementation serializes pipeline contents, for
example for pipeline outputs, logging, or as part of steps such as
<a href="#c.store"><tt class="tag-element">p:store</tt></a> or
<a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a>, it is a <a href=
"#err.D0001">dynamic error</a> if that serialization could not be
done so as to produce a document which is both well-formed and
namespace-well-formed, as specified in <em class=
"glossterm"><a href="#dt-XML">XML</a></em> and <em class=
"glossterm"><a href="#dt-Namespaces-in-XML">Namespaces in
XML</a></em>, regardless of what serialization method, if any, is
called for.</p>
</div>
</div>
<div class="section">
<h4><a name="environment" id=
"environment"></a>2.5&#160;Environment</h4>
<p><span class="termdef" id="dt-environment">[Definition: The
<em class="glossterm">environment</em> is a context-dependent
collection of information available within subpipelines.]</span>
Most of the information in the environment is static and can be
computed for each subpipeline before evaluation of the pipeline as
a whole begins. The in-scope bindings have to be calculated as the
pipeline is being evaluated.</p>
<p>The environment consists of:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>A set of readable ports. <span class="termdef" id=
"dt-readable-ports">[Definition: The <em class="glossterm">readable
ports</em> are a set of step name/port name pairs.]</span> Inputs
and outputs can only be connected to readable ports.</p>
</li>
<li>
<p>A default readable port. <span class="termdef" id=
"dt-default-readable-port">[Definition: The <em class=
"glossterm">default readable port</em>, which may be undefined, is
a specific step name/port name pair from the set of readable
ports.]</span></p>
</li>
<li>
<p>A set of in-scope bindings. <span class="termdef" id=
"dt-in-scope-bindings">[Definition: The <em class=
"glossterm">in-scope bindings</em> are a set of name-value pairs,
based on <em class="glossterm"><a href="#dt-option">option</a></em>
and <em class="glossterm"><a href="#dt-variable">variable</a></em>
bindings.]</span></p>
</li>
</ol>
</div>
<p><span class="termdef" id="dt-empty-environment">[Definition: The
<em class="glossterm">empty environment</em> contains no readable
ports, an undefined default readable port and no in-scope
bindings.]</span></p>
<p>Unless otherwise specified, the environment of a <em class=
"glossterm"><a href="#dt-contained-steps">contained step</a></em>
is its <em class="glossterm"><a href=
"#dt-inherited-environment">inherited environment</a></em>.
<span class="termdef" id="dt-inherited-environment">[Definition:
The <em class="glossterm">inherited environment</em> of a
<em class="glossterm"><a href="#dt-contained-steps">contained
step</a></em> is an environment that is the same as the environment
of its <em class="glossterm"><a href=
"#dt-container">container</a></em> with the <a href=
"#dt-standard-modifications">standard modifications</a>.
]</span></p>
<p>The <span id="dt-standard-modifications">standard
modifications</span> made to an inherited environment are:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>The declared inputs of the container are added to the <em class=
"glossterm"><a href="#dt-readable-ports">readable
ports</a></em>.</p>
<p>In other words, contained steps can see the inputs to their
container.</p>
</li>
<li>
<p>The union of all the declared outputs of all of the step's
sibling steps are added to the <em class="glossterm"><a href=
"#dt-readable-ports">readable ports</a></em>.</p>
<p>In other words, sibling steps can see each other's outputs in
addition to the outputs visible to their container.</p>
</li>
<li>
<p>If there is a preceding sibling step element:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If that preceding sibling has a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em>, then that
output port becomes the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>.</p>
</li>
<li>
<p>Otherwise, the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is
undefined.</p>
</li>
</ul>
</div>
</li>
<li>
<p>If there <em>is not</em> a preceding sibling step element:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If the container has a <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em>, the
<em class="glossterm"><a href="#dt-default-readable-port">default
readable port</a></em> is that <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em>.</p>
</li>
<li>
<p>Otherwise, the default readable port is unchanged.</p>
</li>
</ul>
</div>
</li>
<li>
<p>The names and values from each <a href="#p.variable"><tt class=
"tag-element">p:variable</tt></a> present at the beginning of the
container are added, in document order, to the <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em>. A new binding replaces an old binding with the
same name. See <a href="#p.variable" title=
"p:variable">Section&#160;5.7.1, “p:variable”</a> for the
specification of variable evaluation.</p>
</li>
</ol>
</div>
<p>A step with no parent inherits the <em class=
"glossterm"><a href="#dt-empty-environment">empty
environment</a></em>.</p>
</div>
<div class="section">
<h4><a name="xpath-context" id="xpath-context"></a>2.6&#160;XPaths
in XProc</h4>
<p>XProc uses XPath as an expression language. XPath expressions
are evaluated by the XProc processor in several places: on compound
steps, to compute the default values of options and the values of
variables; on atomic steps, to compute the actual values of options
and the values of parameters.</p>
<p>XPath expressions are also passed to some steps. These
expressions are evaluated by the implementations of the individual
steps.</p>
<p>This distinction can be seen in the following example:</p>
<div class="programlisting">
<pre>
&lt;p:variable name="home" select="'http://example.com/docs'"/&gt;

&lt;p:load name="read-from-home"&gt;
  &lt;p:with-option name="href" select="concat($home,'/document.xml')"/&gt;
&lt;/p:load&gt;

&lt;p:split-sequence name="select-chapters" test="@role='chapter'"&gt;
  &lt;p:input port="source" select="//section"/&gt;
&lt;/p:split-sequence&gt;
</pre></div>
<p>The select expression on the variable “<tt class=
"varname">home</tt>” is evaluated by the XProc processor. The value
of the variable is “<tt class=
"uri">http://example.com/docs</tt>”.</p>
<p>The <tt class="option">href</tt> option of the <a href=
"#c.load"><tt class="tag-element">p:load</tt></a> step is evaluated
by the XProc processor. The actual <tt class="literal">href</tt>
option received by the step is simply the string literal
<tt class="uri">http://example.com/docs/document.xml</tt>”. (The
select expression on the <tt class="literal">source</tt> input of
the <a href="#c.split-sequence"><tt class=
"tag-element">p:split-sequence</tt></a> step is also evaluated by
the XProc processor.)</p>
<p>The XPath expression “<tt class="literal">@role='chapter'</tt>
is passed literally to the <tt class="literal">test</tt> option on
the <a href="#c.split-sequence"><tt class=
"tag-element">p:split-sequence</tt></a> step. That's because the
nature of the <a href="#c.split-sequence"><tt class=
"tag-element">p:split-sequence</tt></a> is that <em>it
evaluates</em> the expression. Only some options on some steps
expect XPath expressions.</p>
<p>The XProc processor evaluates all of the XPath expressions in
<tt class="tag-attribute">select</tt> attributes on variables,
options, parameters, and inputs, in <tt class=
"tag-attribute">match</tt> attributes on <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a>, and in
<tt class="tag-attribute">test</tt> attributes on <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> steps.</p>
<p>An XProc implementation can use <em>either</em> [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>] or [<a href=
"#xpath2"><span class="abbrev">XPath 2.0</span></a>] to evaluate
these expressions.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Allowing either XPath 1.0 or XPath 2.0 is a compromise driven
entirely by the timing of XProc development. During the development
of this specification, the community indicated that it was too
early to mandate that all implementations use XPath 2.0 and too
late to mandate that all implementations use XPath 1.0.</p>
</div>
<p>Many, many expressions that are likely to be used in XProc
pipelines are the same in both versions (simple element tests,
ancestor and descendant tests, string-based attribute tests,
etc.).</p>
<p>As an aid to interoperability, pipeline authors may indicate the
version of XPath that they require. The attribute <tt class=
"tag-attribute">xpath-version</tt> may be used on <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>, <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
or <a href="#p.library"><tt class="tag-element">p:library</tt></a>
to identify the XPath version that <span class=
"rfc2119">must</span> be used to evaluate XPath expressions on the
pipeline(s). The attribute is lexically scoped, but see below.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>In Version 1.0 of XProc, no similar level of control is provided
for specifying (or testing) the version of XSLT used when
evaluating <tt class="type">XSLTMatchPattern</tt>s. The expectation
is that XPath 1.0 processors will be using XSLT 1.0 match patterns
and XPath 2.0 processors will be using XSLT 2.0 match patterns, but
that is not necessarily the case.</p>
<p>As XPath, XSLT, and XProc continue to evolve, additional
facilities for specifying and testing the version of XSLT used to
evaluate match patterns may be added to XProc.</p>
</div>
<p>If an <tt class="tag-attribute">xpath-version</tt> is specified
on a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> or <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
then that is the version of XPath that the step requires. If it
does not specify a version, but a version is specified on one of
its ancestors, the nearest ancestor version specified is the
version that it requires. An <tt class=
"tag-attribute">xpath-version</tt> attribute on a <a href=
"#p.library"><tt class="tag-element">p:library</tt></a> specifies a
default version for all steps defined in that library. <a name=
"impl-10" id="impl-10"></a>If no version is specified on the step
or among its ancestors, then its XPath version is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The decision about which XPath version applies can be made
dynamically. For example, if a pipeline explicitly labeled with
<tt class="tag-attribute">xpath-version</tt> “1.0” imports a
library that does not specify a version, the implementation may
elect to make the implementation-defined XPath version of the steps
in the library also “1.0”. If the same implementation imports that
library into a pipeline explicitly labeled with <tt class=
"tag-attribute">xpath-version</tt> “2.0”, it can make the
implementation-defined version of those steps “2.0”.</p>
</div>
<p>The following rules determine how the indicated version and the
implementation's actual version interact:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>If the indicated version and the implementation version are the
same, then that version is used.</p>
</li>
<li>
<p>If the indicated version is 1.0 and the implementation uses
XPath 2.0 (or later), the expression <span class=
"rfc2119">must</span> be evaluated in XPath 1.0 compatibility mode.
<a name="err.inline.D0024" id="err.inline.D0024"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0024"><code class=
"errqname">err:XD0024</code></a>) if a 2.0 processor encounters an
XPath 1.0 expression and it does not support XPath 1.0
compatibility mode.</p>
</li>
<li>
<p>Otherwise: <a name="err.inline.D0027" id=
"err.inline.D0027"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0027"><code class="errqname">err:XD0027</code></a>) if the
processor encounters an <tt class=
"tag-attribute">xpath-version</tt> that it does not support.</p>
</li>
</ol>
</div>
<p>XProc processors divide naturally into two classes: XPath 1.0
processors and XPath 2.0 processors.</p>
<p>Irrespective of which version of XPath is used, all expressions
evaluated by XProc or passed to steps for evaluation must be valid
XPath expressions. <a name="err.inline.D0023" id=
"err.inline.D0023"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0023"><code class="errqname">err:XD0023</code></a>) if an
XPath expression is encountered which cannot be evaluated (because
it is syntactically incorrect, contains references to unbound
variables or unknown functions, or for any other reason).</p>
<div class="section">
<h5><a name="xpath10-processors" id=
"xpath10-processors"></a>2.6.1&#160;XPath 1.0 processors</h5>
<p>XProc processors that support only XPath 1.0 do not support any
types (or features) beyond those described in [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>]. They use the
XPath 1.0 data model. Processors <span class="rfc2119">must</span>
implement all of the XPath 1.0 functions, but are not expected to
implement the functions described in [<a href=
"#xslt10"><span class="abbrev">XSLT 1.0</span></a>].</p>
<div class="section">
<h6><a name="xproc-xpath-context-10" id=
"xproc-xpath-context-10"></a>2.6.1.1&#160;Processor XPath
Context</h6>
<p>When the XProc processor evaluates an XPath expression using
XPath 1.0, unless otherwise indicated by a particular step, it does
so with the following initial context:</p>
<div class="variablelist">
<dl>
<dt>context node</dt>
<dd>
<p>The document node of a document. The document is either
specified with a <em class="glossterm"><a href=
"#dt-connection">connection</a></em> or is taken from the
<em class="glossterm"><a href="#dt-default-readable-port">default
readable port</a></em>. <a name="err.inline.D0008" id=
"err.inline.D0008"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0008"><code class="errqname">err:XD0008</code></a>) if a
document sequence appears where a document to be used as the
context node is expected.</p>
<p>If there is no explicit connection and there is no default
readable port then the context node is an empty document node.</p>
</dd>
<dt>context position and context size</dt>
<dd>
<p>The context position and context size are both “1”.</p>
</dd>
<dt>variable bindings</dt>
<dd>
<p>The union of the in-scope <em class="glossterm"><a href=
"#dt-specified-options">specified options</a></em> and variables
are available as variable bindings to the XPath processor.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>An option that has neither a specified value nor a default value
will not appear as an in-scope variable. Consequently, an attempt
to refer to that variable will raise an error.</p>
</div>
</dd>
<dt>function library</dt>
<dd>
<p>The [<a href="#xpath"><span class="abbrev">XPath 1.0</span></a>]
core function library and the <a href="#xpath-extension-functions"
title="XPath Extension Functions">Section&#160;2.7, “XPath
Extension Functions”</a>. Function names that do not contain a
colon always refer to the XPath 1.0 functions, any in-scope binding
for the default namespace <em>does not</em> apply.</p>
</dd>
<dt>in-scope namespaces</dt>
<dd>
<p>The namespace bindings in-scope on the element where the
expression occurred.</p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h6><a name="step-xpath-context-10" id=
"step-xpath-context-10"></a>2.6.1.2&#160;Step XPath Context</h6>
<p>When <em>a step</em> evaluates an XPath expression using XPath
1.0, unless otherwise indicated by a particular step, it does so
with the following initial context:</p>
<div class="variablelist">
<dl>
<dt>context node</dt>
<dd>
<p>The document node that appears on the primary input port of the
step, unless otherwise specified by the step.</p>
</dd>
<dt>context position and context size</dt>
<dd>
<p>The position and size are both “1”, unless otherwise specified
by the step.</p>
</dd>
<dt>variable bindings</dt>
<dd>
<p>None, unless otherwise specified by the step.</p>
</dd>
<dt>function library</dt>
<dd>
<p>The [<a href="#xpath"><span class="abbrev">XPath 1.0</span></a>]
core function library, unless otherwise specified by the step.
Function names that do not contain a colon always refer to the
XPath 1.0 functions, any in-scope binding for the default namespace
<em>does not</em> apply.</p>
</dd>
<dt>in-scope namespaces</dt>
<dd>
<p>The set of namespace bindings provided by the XProc processor.
The processor computes this set of bindings by taking a union of
the bindings on the step element itself as well as the bindings on
any of the options and parameters used in computing values for the
step (see <a href="#opt-param-bindings" title=
"Namespaces on variables, options, and  parameters">Section&#160;5.7.5,
“Namespaces on variables, options, and parameters”</a>).</p>
<p><a name="impl-11" id="impl-11"></a>The results of computing the
union of namespaces in the presence of conflicting declarations for
a particular prefix are <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
</dl>
</div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Some steps may also provide for implementation-defined or
implementation-dependent amendments to the contexts. Those
amendments are in addition to any specified by XProc.</p>
</div>
</div>
</div>
<div class="section">
<h5><a name="xpath20-processors" id=
"xpath20-processors"></a>2.6.2&#160;XPath 2.0 processors</h5>
<p>XProc processors that support XPath 2.0 are XPath 2.0
processors. Such processors can refer to the primitive atomic
schema types, but cannot import additional types.</p>
<p>XPath 2.0 processors <span class="rfc2119">must</span> implement
all of the XPath 2.0 functions, but are not expected to implement
the functions described in [<a href="#xslt20"><span class=
"abbrev">XSLT 2.0</span></a>].</p>
<div class="section">
<h6><a name="xproc-xpath-context-20" id=
"xproc-xpath-context-20"></a>2.6.2.1&#160;Processor XPath
Context</h6>
<p>When the XProc processor evaluates an XPath expression using
XPath 2.0, unless otherwise indicated by a particular step, it does
so with the following static context:</p>
<div class="variablelist">
<dl>
<dt>XPath 1.0 compatibility mode</dt>
<dd>
<p>Is true if the indicated XPath version is 1.0, false
otherwise.</p>
</dd>
<dt>Statically known namespaces</dt>
<dd>
<p>The namespace declarations in-scope for the containing
element.</p>
</dd>
<dt>Default element/type namespace</dt>
<dd>
<p>The null namespace.</p>
</dd>
<dt>Default function namespace</dt>
<dd>
<p>The [<a href="#xpath2"><span class="abbrev">XPath
2.0</span></a>] function namespace. Function names that do not
contain a colon always refer to the default function namespace, any
in-scope binding for the default namespace <em>does not</em> apply.
This specification does not provide a mechanism to override the
default function namespace.</p>
</dd>
<dt>In-scope schema definitions</dt>
<dd>
<p>A basic XPath 2.0 XProc processor includes the following named
type definitions in its in-scope schema definitions:</p>
<div class="itemizedlist">
<ul>
<li>
<p>All the primitive atomic types defined in [<a href=
"#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>], with the exception of <tt class=
"literal">xs:NOTATION</tt>. That is: <tt class=
"literal">xs:string</tt>, <tt class="literal">xs:boolean</tt>,
<tt class="literal">xs:decimal</tt>, <tt class=
"literal">xs:double</tt>, <tt class="literal">xs:float</tt>,
<tt class="literal">xs:date</tt>, <tt class="literal">xs:time</tt>,
<tt class="literal">xs:dateTime</tt>, <tt class=
"literal">xs:duration</tt>, <tt class="literal">xs:QName</tt>,
<tt class="literal">xs:anyURI</tt>, <tt class=
"literal">xs:gDay</tt>, <tt class="literal">xs:gMonthDay</tt>,
<tt class="literal">xs:gMonth</tt>, <tt class=
"literal">xs:gYearMonth</tt>, <tt class="literal">xs:gYear</tt>,
<tt class="literal">xs:base64Binary</tt>, and <tt class=
"literal">xs:hexBinary</tt>.</p>
</li>
<li>
<p>The derived atomic type <tt class="literal">xs:integer</tt>
defined in [<a href="#xmlschema-2"><span class="abbrev">W3C XML
Schema: Part 2</span></a>].</p>
</li>
<li>
<p>The types <tt class="literal">xs:anyType</tt>, <tt class=
"literal">xs:anySimpleType</tt>, <tt class=
"literal">xs:yearMonthDuration</tt>, <tt class=
"literal">xs:dayTimeDuration</tt>, <tt class=
"literal">xs:anyAtomicType</tt>, <tt class=
"literal">xs:untyped</tt>, and <tt class=
"literal">xs:untypedAtomic</tt> defined in [<a href=
"#xpath-datamodel"><span class="abbrev">XQuery 1.0 and XPath 2.0
Data Model (XDM)</span></a>].</p>
</li>
</ul>
</div>
</dd>
<dt>In-scope variables</dt>
<dd>
<p>The union of the in-scope <em class="glossterm"><a href=
"#dt-specified-options">specified options</a></em> and variables
are available as variable bindings to the XPath processor.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>An option that has neither a specified value nor a default value
will not appear as an in-scope variable. Consequently, an attempt
to refer to that variable will raise an error.</p>
</div>
</dd>
<dt>Context item static type</dt>
<dd>
<p>Document.</p>
</dd>
<dt>Function signatures</dt>
<dd>
<p>The signatures of the [<a href="#xpath-functions"><span class=
"abbrev">XPath 2.0 Functions and Operators</span></a>] and the
<a href="#xpath-extension-functions" title=
"XPath Extension Functions">Section&#160;2.7, “XPath Extension
Functions”</a>.</p>
</dd>
<dt>Statically known collations</dt>
<dd>
<p>Implementation-defined but <span class="rfc2119">must</span>
include the Unicode code point collation. <a name="impl-12" id=
"impl-12"></a>The version of Unicode supported is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>, but
it is recommended that the most recent version of Unicode be
used.</p>
</dd>
<dt>Default collation</dt>
<dd>
<p>Unicode code point collation.</p>
</dd>
<dt>Base URI</dt>
<dd>
<p>The base URI of the element on which the expression occurs.</p>
</dd>
<dt>Statically known documents</dt>
<dd>
<p>None.</p>
</dd>
<dt>Statically known collections</dt>
<dd>
<p>None.</p>
</dd>
</dl>
</div>
<p>And the following dynamic context:</p>
<div class="variablelist">
<dl>
<dt>context item</dt>
<dd>
<p>The document node of a document. The document is either
specified with a <em class="glossterm"><a href=
"#dt-connection">connection</a></em> or is taken from the
<em class="glossterm"><a href="#dt-default-readable-port">default
readable port</a></em>. <a name="err.inline.D0008.1" id=
"err.inline.D0008.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0008"><code class="errqname">err:XD0008</code></a>) if a
document sequence appears where a document to be used as the
context node is expected.</p>
<p>If there is no explicit connection and there is no default
readable port then the context node is undefined.</p>
</dd>
<dt>context position and context size</dt>
<dd>
<p>The context position and context size are both “1”.</p>
</dd>
<dt>Variable values</dt>
<dd>
<p>The union of the in-scope options and variables are available as
variable bindings to the XPath processor.</p>
</dd>
<dt>Function implementations</dt>
<dd>
<p>The [<a href="#xpath-functions"><span class="abbrev">XPath 2.0
Functions and Operators</span></a>] and the <a href=
"#xpath-extension-functions" title=
"XPath Extension Functions">Section&#160;2.7, “XPath Extension
Functions”</a>.</p>
</dd>
<dt>Current dateTime</dt>
<dd>
<p><a name="impl-13" id="impl-13"></a>The point in time returned as
the current dateTime is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Implicit timezone</dt>
<dd>
<p><a name="impl-14" id="impl-14"></a>The implicit timezone is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Available documents</dt>
<dd>
<p><a name="impl-15" id="impl-15"></a>The set of available
documents (those that may be retrieved with a URI) is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Available collections</dt>
<dd>
<p><a name="impl-16" id="impl-16"></a>The set of available
collections is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Default collection</dt>
<dd>
<p>None.</p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h6><a name="step-xpath-context-20" id=
"step-xpath-context-20"></a>2.6.2.2&#160;Step XPath Context</h6>
<p>When a step evaluates an XPath expression using XPath 2.0,
unless otherwise indicated by a particular step, it does so with
the following static context:</p>
<div class="variablelist">
<dl>
<dt>XPath 1.0 compatibility mode</dt>
<dd>
<p>Is true if the indicated XPath version is 1.0, false
otherwise.</p>
</dd>
<dt>Statically known namespaces</dt>
<dd>
<p>The namespace declarations in-scope for the containing element
or made available through <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a>.</p>
</dd>
<dt>Default element/type namespace</dt>
<dd>
<p>The null namespace.</p>
</dd>
<dt>Default function namespace</dt>
<dd>
<p>The [<a href="#xpath2"><span class="abbrev">XPath
2.0</span></a>] function namespace. Function names that do not
contain a colon always refer to the default function namespace, any
in-scope binding for the default namespace <em>does not</em> apply.
This specification does not provide a mechanism to override the
default function namespace.</p>
</dd>
<dt>In-scope schema definitions</dt>
<dd>
<p>The same as the <a href="#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</p>
</dd>
<dt>In-scope variables</dt>
<dd>
<p>None, unless otherwise specified by the step.</p>
</dd>
<dt>Context item static type</dt>
<dd>
<p>Document.</p>
</dd>
<dt>Function signatures</dt>
<dd>
<p>The signatures of the [<a href="#xpath-functions"><span class=
"abbrev">XPath 2.0 Functions and Operators</span></a>].</p>
</dd>
<dt>Statically known collations</dt>
<dd>
<p>Implementation-defined but <span class="rfc2119">must</span>
include the Unicode code point collation.</p>
</dd>
<dt>Default collation</dt>
<dd>
<p>Unicode code point collation.</p>
</dd>
<dt>Base URI</dt>
<dd>
<p>The base URI of the element on which the expression occurs.</p>
</dd>
<dt>Statically known documents</dt>
<dd>
<p>None.</p>
</dd>
<dt>Statically known collections</dt>
<dd>
<p>None.</p>
</dd>
</dl>
</div>
<p>And the following initial dynamic context:</p>
<div class="variablelist">
<dl>
<dt>context item</dt>
<dd>
<p>The document node of the document that appears on the primary
input of the step, unless otherwise specified by the step.</p>
</dd>
<dt>context position and context size</dt>
<dd>
<p>The context position and context size are both “1”, unless
otherwise specified by the step.</p>
</dd>
<dt>Variable values</dt>
<dd>
<p>None, unless otherwise specified by the step.</p>
</dd>
<dt>Function implementations</dt>
<dd>
<p>The [<a href="#xpath-functions"><span class="abbrev">XPath 2.0
Functions and Operators</span></a>].</p>
</dd>
<dt>Current dateTime</dt>
<dd>
<p>An implementation-defined point in time.</p>
</dd>
<dt>Implicit timezone</dt>
<dd>
<p><a name="impl-17" id="impl-17"></a>The implicit timezone is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Available documents</dt>
<dd>
<p><a name="impl-18" id="impl-18"></a>The set of available
documents (those that may be retrieved with a URI) is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Available collections</dt>
<dd>
<p>None.</p>
</dd>
<dt>Default collection</dt>
<dd>
<p>None.</p>
</dd>
</dl>
</div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Some steps may also provide for implementation-defined or
implementation-dependent amendments to the contexts. Those
amendments are in addition to any specified by XProc.</p>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="xpath-extension-functions" id=
"xpath-extension-functions"></a>2.7&#160;XPath Extension
Functions</h4>
<p>The XProc processor <span class="rfc2119">must</span> support
the additional functions described in this section in XPath
expressions evaluated by the processor.</p>
<p>In the following descriptions, the names of types (<tt class=
"type">string</tt>, <tt class="type">boolean</tt>, etc.) should be
taken to mean the corresponding [<a href=
"#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>] data types for an implementation that uses XPath 2.0
and as the most appropriate XPath 1.0 types for an XPath 1.0
implementation.</p>
<div class="section">
<h5><a name="f.system-property" id=
"f.system-property"></a>2.7.1&#160;System Properties</h5>
<p>XPath expressions within a pipeline document can interrogate the
processor for information about the current state of the pipeline.
Various aspects of the processor are exposed through the <a href=
"#f.system-property"><tt class=
"function">p:system-property</tt></a> function in the pipeline
namespace:</p>
<div class="funcsynopsis"><span class=
"funcname">p:system-property</span><span class=
"funcparen">(</span><span class="paramname">$property</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span></div>
<p>The <tt class="varname">$property</tt> string must have the form
of a <a href="http://www.w3.org/TR/xml-names/#NT-QName">QName</a>;
the QName is expanded into a name using the namespace declarations
in scope for the expression. <a name="err.inline.D0015" id=
"err.inline.D0015"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0015"><code class="errqname">err:XD0015</code></a>) if the
specified QName cannot be resolved with the in-scope namespace
declarations. The <a href="#f.system-property"><tt class=
"function">p:system-property</tt></a> function returns the string
representing the value of the system property identified by the
QName. If there is no such property, the empty string <span class=
"rfc2119">must</span> be returned.</p>
<p>Implementations <span class="rfc2119">must</span> provide the
following system properties, which are all in the XProc
namespace:</p>
<div class="variablelist">
<dl>
<dt><tt class="varname">p:episode</tt></dt>
<dd>
<p>Returns a string which <span class="rfc2119">should</span> be
unique for each invocation of the pipeline processor. In other
words, if a processor is run several times in succession, or if
several processors are running simultaneously, each invocation of
each processor should get a distinct value from <tt class=
"varname">p:episode</tt>.</p>
<p>The unique identifier must be a valid <a href=
"http://www.w3.org/TR/XML#NT-Name">XML name</a>.</p>
</dd>
<dt><tt class="varname">p:language</tt></dt>
<dd>
<p>Returns a string which identifies the current language, for
example, for message localization purposes. <a name="impl-19" id=
"impl-19"></a>The exact format of the language string is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> but
<span class="rfc2119">should</span> be consistent with the
<tt class="tag-attribute">xml:lang</tt> attribute.</p>
</dd>
<dt><tt class="varname">p:product-name</tt></dt>
<dd>
<p>Returns a string containing the name of the implementation, as
defined by the implementer. This should normally remain constant
from one release of the product to the next. It should also be
constant across platforms in cases where the same source code is
used to produce compatible products for multiple execution
platforms.</p>
</dd>
<dt><tt class="varname">p:product-version</tt></dt>
<dd>
<p>Returns a string identifying the version of the implementation,
as defined by the implementer. This should normally vary from one
release of the product to the next, and at the discretion of the
implementer it may also vary across different execution
platforms.</p>
</dd>
<dt><tt class="varname">p:vendor</tt></dt>
<dd>
<p>Returns a string which identifies the vendor of the
processor.</p>
</dd>
<dt><tt class="varname">p:vendor-uri</tt></dt>
<dd>
<p>Returns a URI which identifies the vendor of the processor.
Often, this is the URI of the vendor's web site.</p>
</dd>
<dt><tt class="varname">p:version</tt></dt>
<dd>
<p>Returns the version(s) of XProc implemented by the processor as
a space-separated list. For example, a processor that supports
XProc 1.0 would return “1.0”; a processor that supports XProc 1.0
and 2.0 would return “1.0 2.0”; a processor that supports only
XProc 2.0 would return “2.0”.</p>
</dd>
<dt><tt class="varname">p:xpath-version</tt></dt>
<dd>
<p>Returns the version(s) of XPath implemented by the processor for
evaluating XPath expressions on XProc elements. The result is a
space-separated list of versions supported. For example, a
processor that only supports XPath 1.0 would return “1.0”; a
processor that supports XPath 2.0 and XPath 1.0 backwards
compatibility mode could return “1.0 2.0”; a processor that
supports only XPath 2.0 would return “2.0”.</p>
</dd>
<dt><tt class="varname">p:psvi-supported</tt></dt>
<dd>
<p>Returns true if the implementation supports passing PSVI
annotations between steps, false otherwise.</p>
</dd>
</dl>
</div>
<p>Implementations may support additional system properties but
such properties <span class="rfc2119">must</span> be in a namespace
and <span class="rfc2119">must not</span> be in the XProc
namespace.</p>
</div>
<div class="section">
<h5><a name="f.step-available" id=
"f.step-available"></a>2.7.2&#160;Step Available</h5>
<p>The <a href="#f.step-available"><tt class=
"function">p:step-available</tt></a> function reports whether or
not a particular type of step is understood by the processor.</p>
<div class="funcsynopsis"><span class=
"funcname">p:step-available</span><span class=
"funcparen">(</span><span class="paramname">$step-name</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<p>The <tt class="varname">$step-type</tt> string <span class=
"rfc2119">must</span> have the form of a QName; the QName is
expanded into a name using the namespace declarations in-scope for
the expression. The <a href="#f.step-available"><tt class=
"function">p:step-available</tt></a> function returns true if and
only if the processor knows how to evaluate steps of the specified
type.</p>
</div>
<div class="section">
<h5><a name="f.value-available" id=
"f.value-available"></a>2.7.3&#160;Value Available</h5>
<p>The <a href="#f.value-available"><tt class=
"function">p:value-available</tt></a> function reports whether or
not a particular in-scope option has a value.</p>
<div class="funcsynopsis"><span class=
"funcname">p:value-available</span><span class=
"funcparen">(</span><span class="paramname">$option-name</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<div class="funcsynopsis"><span class=
"funcname">p:value-available</span><span class=
"funcparen">(</span><span class="paramname">$option-name</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funccomma">,</span>
<span class="paramname">$fail-if-unknown</span> <span class=
"typeas">as</span> <span class="type">xs:boolean</span><span class=
"funcparen">)</span> <span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<p>The <tt class="varname">$option-name</tt> string <span class=
"rfc2119">must</span> have the form of a QName; the QName is
expanded into a name using the namespace declarations in-scope for
the expression. The <a href="#f.value-available"><tt class=
"function">p:value-available</tt></a> function returns true if and
only if the name specified is the name of an <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
binding</a></em> and the binding has a value. <a name=
"err.inline.D0033" id="err.inline.D0033"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0033"><code class=
"errqname">err:XD0033</code></a>) if the name specified is not the
name of an in-scope option or variable.</p>
<p>In the two-argument form, it is not an error to specify a name
that is not the name of an in-scope option or variable if
<tt class="varname">$fail-if-unknown</tt> is false; the function
simply returns false. The semantics of the two-argument form when
<tt class="varname">$fail-if-unknown</tt> is true are precisely the
same as the single argument form.</p>
<p>Consider the following example:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step type="ex:dir-list"&gt;
  &lt;p:output port="result"/&gt;
  &lt;p:option name="path"/&gt;

  &lt;p:choose&gt;
    &lt;p:when test="p:value-available('path')"&gt;
      &lt;p:directory-list&gt;
        &lt;p:with-option name="path" select="$path"/&gt;
      &lt;/p:directory-list&gt;
    &lt;/p:when&gt;
    &lt;p:otherwise&gt;
      &lt;p:directory-list path="."/&gt;
    &lt;/p:otherwise&gt;
  &lt;/p:choose&gt;
&lt;/p:declare-step&gt;
</pre></div>
<p>If the <tt class="option">path</tt> option is specified in the
call to <tt class="code">ex:dir-list</tt>, then the first <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> clause will be
evaluated and the specified value will be used. If the option is
not specified, then the <a href="#p.otherwise"><tt class=
"tag-element">p:otherwise</tt></a> clause will be evaluated and
"<tt class="literal">.</tt>" will be used instead.</p>
</div>
<div class="section">
<h5><a name="f.iteration-position" id=
"f.iteration-position"></a>2.7.4&#160;Iteration Position</h5>
<p>Both <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> and <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> process a
sequence of documents. The iteration position is the position of
the current document in that sequence: the first document has
position 1, the second 2, etc. The <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a> function returns the
iteration position of the nearest ancestor <a href=
"#p.for-each"><tt class="tag-element">p:for-each</tt></a> or
<a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>.</p>
<div class="funcsynopsis"><span class=
"funcname">p:iteration-position</span><span class=
"funcparen">(</span><span class="funcparen">)</span> <span class=
"typeas">as</span> <span class="type">xs:integer</span></div>
<p>If there is no <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> or <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> among the
ancestors of the element on which the expression involving <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a> occurs, it returns 1.</p>
</div>
<div class="section">
<h5><a name="f.iteration-size" id=
"f.iteration-size"></a>2.7.5&#160;Iteration Size</h5>
<p>Both <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> and <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> process a
sequence of documents. The iteration size is the total number of
documents in that sequence. The <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>
function returns the iteration size of the nearest ancestor
<a href="#p.for-each"><tt class="tag-element">p:for-each</tt></a>
or <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>.</p>
<div class="funcsynopsis"><span class=
"funcname">p:iteration-size</span><span class=
"funcparen">(</span><span class="funcparen">)</span> <span class=
"typeas">as</span> <span class="type">xs:integer</span></div>
<p>If there is no <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> or <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> among the
ancestors of the element on which the expression involving <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>
occurs, it returns 1.</p>
</div>
<div class="section">
<h5><a name="f.base-uri" id="f.base-uri"></a>2.7.6&#160;Base
URI</h5>
<p>Returns the base URI of the specified node, if it has one. This
function provides an interoperable way for XPath 1.0 based
processors to access the base URI of a node. It is conceptually the
same as the XPath 2.0 <tt class="literal">fn:base-uri()</tt>
function.</p>
<div class="funcsynopsis"><span class=
"funcname">p:base-uri</span><span class=
"funcparen">(</span><span class="funcparen">)</span> <span class=
"typeas">as</span> <span class="type">xs:string</span></div>
<div class="funcsynopsis"><span class=
"funcname">p:base-uri</span><span class=
"funcparen">(</span><span class="paramname">$node</span>
<span class="typeas">as</span> <span class=
"type">node()</span><span class="funcparen">)</span> <span class=
"typeas">as</span> <span class="type">xs:string</span></div>
<p>If no argument is specified, the context node is taken to be the
argument.</p>
<p>This function returns the <tt class="literal">[base-uri]</tt>
property of its argument, or the empty string if no base URI is
defined for that argument or argument type.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>This function is defined in our namespace because it would be
inappropriate to require XPath 1.0 based processors to support the
<tt class="literal">fn:base-uri</tt> function; its semantics are
deeply rooted in the XPath 2.0 data model which differs from the
XPath 1.0 data model.</p>
</div>
</div>
<div class="section">
<h5><a name="f.resolve-uri" id=
"f.resolve-uri"></a>2.7.7&#160;Resolve URI</h5>
<p>Resolves a relative URI with respect to a particular base URI.
This function provides an interoperable way for XPath 1.0 based
processors to compose URI references. It is conceptually the same
as the XPath 2.0 <tt class="literal">fn:resolve-uri()</tt>
function.</p>
<div class="funcsynopsis"><span class=
"funcname">p:resolve-uri</span><span class=
"funcparen">(</span><span class="paramname">$relative</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span></div>
<div class="funcsynopsis"><span class=
"funcname">p:resolve-uri</span><span class=
"funcparen">(</span><span class="paramname">$relative</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span><span class="funccomma">,</span>
<span class="paramname">$base</span> <span class="typeas">as</span>
<span class="type">xs:string</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:string</span></div>
<p>If no base is specified, the base URI of the context node is
used.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>This function is defined in our namespace because it would be
inappropriate to require XPath 1.0 based processors to support the
<tt class="literal">fn:resolve-uri</tt> function; its semantics are
rooted in the XPath 2.0 data model which differs from the XPath 1.0
data model.</p>
</div>
</div>
<div class="section">
<h5><a name="f.version-available" id=
"f.version-available"></a>2.7.8&#160;Version Available</h5>
<p>Returns true if and only if the processor supports the version
specified.</p>
<div class="funcsynopsis"><span class=
"funcname">p:version-available</span><span class=
"funcparen">(</span><span class="paramname">$version</span>
<span class="typeas">as</span> <span class=
"type">xs:decimal</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<p>A version 1.0 processor will return <tt class=
"literal">true()</tt> when <tt class=
"code">p:version-available(1.0)</tt> is evaluated.</p>
</div>
<div class="section">
<h5><a name="f.xpath-version-available" id=
"f.xpath-version-available"></a>2.7.9&#160;XPath Version
Available</h5>
<p>Returns true if and only if the processor supports the XPath
version specified.</p>
<div class="funcsynopsis"><span class=
"funcname">p:xpath-version-available</span><span class=
"funcparen">(</span><span class="paramname">$version</span>
<span class="typeas">as</span> <span class=
"type">xs:decimal</span><span class="funcparen">)</span>
<span class="typeas">as</span> <span class=
"type">xs:boolean</span></div>
<p>A processor that supports XPath 2.0 will return <tt class=
"literal">true()</tt> when <tt class=
"code">p:xpath-version-available(2.0)</tt> is evaluated.</p>
</div>
<div class="section">
<h5><a name="other-xpath-extension-functions" id=
"other-xpath-extension-functions"></a>2.7.10&#160;Other XPath
Extension Functions</h5>
<p><a name="impl-20" id="impl-20"></a>It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> if the
processor supports any other XPath extension functions. Additional
extension functions, if any, <span class="rfc2119">must not</span>
use any of the XProc namespaces.</p>
</div>
</div>
<div class="section">
<h4><a name="psvi-support" id="psvi-support"></a>2.8&#160;PSVIs in
XProc</h4>
<p>XML documents flow between steps in an XProc pipeline. <a href=
"#infoset-conformance" title=
"Infoset Conformance">Section&#160;A.3, “Infoset Conformance”</a>
identifies the properties of those documents that <span class=
"rfc2119">must</span> be available. Implementations <span class=
"rfc2119">may</span> also have the ability to pass PSVI annotations
between steps.</p>
<p><a name="impl-21" id="impl-21"></a>Whether or not the pipeline
processor supports passing PSVI annotations between steps is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.
<a name="impl-22" id="impl-22"></a>The exact PSVI properties that
are preserved when documents are passed between steps is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>A pipeline can use the <tt class="varname">p:psvi-supported</tt>
system property to determine whether or not PSVI properties can be
passed between steps.</p>
<p>A pipeline can assert that PSVI support is required with the
<tt class="tag-attribute">psvi-required</tt> attribute:</p>
<div class="itemizedlist">
<ul>
<li>
<p>On a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> or <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
<tt class="tag-attribute">psvi-required</tt> indicates whether or
not the declared step requires PSVI support. <a name=
"err.inline.D0022" id="err.inline.D0022"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0022"><code class=
"errqname">err:XD0022</code></a>) if a processor that does not
support PSVI annotations attempts to invoke a step which asserts
that they are required.</p>
</li>
<li>
<p>On a <a href="#p.library"><tt class=
"tag-element">p:library</tt></a>, the <tt class=
"tag-attribute">psvi-required</tt> attribute provides a default
value for all of its <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> and <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>
<em>children</em> that do not specify a value themselves.</p>
</li>
</ul>
</div>
<p>Many of the steps that an XProc pipeline can use are
transformative in nature. The <a href="#c.delete"><tt class=
"tag-element">p:delete</tt></a> step, for example, can remove
elements and attributes; the <a href="#c.label-elements"><tt class=
"tag-element">p:label-elements</tt></a> step can add attributes;
etc. If PSVI annotations were always preserved, the use of such
steps could result in documents that were inconsistent with their
schema annotations.</p>
<p>In order to avoid these inconsistencies, most steps <span class=
"rfc2119">must not</span> produce PSVI annotated results even when
PSVI passing is supported.</p>
<p>If PSVI passing is supported, the following constraints
apply:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>Implementations <span class="rfc2119">must</span> faithfully
transmit any PSVI properties produced on step outputs to the steps
to which they are connected.</p>
</li>
<li>
<p>When only a subset of the input is processed by a step (because
a <tt class="tag-attribute">select</tt> expression appears on an
input port or a <tt class="tag-attribute">match</tt> expression is
used to process only part of the input), any PSVI annotations that
appear on the selected input <span class="rfc2119">must</span> be
preserved in the resulting documents passed to the step.</p>
<p>Note that ID/IDREF constraints, and any other whole-document
constraints, may not be satisfied within the selected portion,
irrespective of what its PSVI properties claim.</p>
</li>
<li>
<p>If an output of a compound step is connected to an output which
includes PSVI properties, those properties <span class=
"rfc2119">must</span> be preserved on the output of the compound
step, <em>except</em> for the output of <a href=
"#p.viewport"><tt class="tag-element">p:viewport</tt></a> which
<span class="rfc2119">must not</span> contain any PSVI
properties.</p>
</li>
<li>
<p>If an implementation supports XPath 2.0, the data model
constructed with which to evaluate XPath expressions and match
patterns <span class="rfc2119">should</span> take advantage of as
much PSVI information as possible.</p>
</li>
<li>
<p>Except as specified above, or in the descriptions of individual
steps, implementations <span class="rfc2119">must not</span>
include PSVI properties in the outputs of steps defined by this
specification. <a name="impl-23" id="impl-23"></a>It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> what
PSVI properties, if any, are produced by extension steps.</p>
<p>The exceptions in the standard XProc steps are the <a href=
"#c.validate-with-xml-schema"><tt class=
"tag-element">p:validate-with-xml-schema</tt></a>, <a href=
"#c.validate-with-relax-ng"><tt class=
"tag-element">p:validate-with-relax-ng</tt></a>, and <a href=
"#c.validate-with-schematron"><tt class=
"tag-element">p:validate-with-schematron</tt></a> steps, <a href=
"#c.xslt"><tt class="tag-element">p:xslt</tt></a> (when XSLT 2.0 is
used), <a href="#c.xquery"><tt class=
"tag-element">p:xquery</tt></a>, <a href="#c.identity"><tt class=
"tag-element">p:identity</tt></a>, and <a href=
"#c.split-sequence"><tt class=
"tag-element">p:split-sequence</tt></a>.</p>
</li>
</ol>
</div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>A processor that supports passing PSVI properties between steps
is always free to do so. Even if <tt class=
"code">psvi-required="false"</tt> is explicitly specified, it is
not an error for a step to produce a result that includes
additional PSVI properties, provide it does not violate the
constraints above.</p>
</div>
</div>
<div class="section">
<h4><a name="variables" id="variables"></a>2.9&#160;Variables</h4>
<p>Variables are name/value pairs. Pipeline authors can create
variables to hold computed values.</p>
<p><span class="termdef" id="dt-variable">[Definition: A <em class=
"glossterm">variable</em> is a name/value pair where the name is an
<a href="http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded
name</a> and the value <span class="rfc2119">must</span> be a
string or <tt class="type">xs:untypedAtomic</tt>.]</span></p>
<p>Variables and options share the same scope and may shadow each
other.</p>
</div>
<div class="section">
<h4><a name="options" id="options"></a>2.10&#160;Options</h4>
<p>Some steps accept options. Options are name/value pairs, like
variables. Unlike variables, the value of an option can be changed
by the caller.</p>
<p><span class="termdef" id="dt-option">[Definition: An <em class=
"glossterm">option</em> is a name/value pair where the name is an
<a href="http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded
name</a> and the value <span class="rfc2119">must</span> be a
string or <tt class="type">xs:untypedAtomic</tt>.]</span></p>
<p><span class="termdef" id="dt-declared-options">[Definition: The
options declared on a step are its <em class="glossterm">declared
options</em>.]</span> Option names are always expressed as literal
values, pipelines cannot construct option names dynamically.</p>
<p><span class="termdef" id="dt-specified-options">[Definition: The
options on a step which have specified values, either because a
<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> element specifies a value or
because the declaration included a default value, are its
<em class="glossterm">specified options</em>.]</span></p>
<p><a name="impl-24" id="impl-24"></a>How outside values are
specified for pipeline options on the pipeline initially invoked by
the processor is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. In
other words, the command line options, APIs, or other mechanisms
available to specify such options values are outside the scope of
this specification.</p>
</div>
<div class="section">
<h4><a name="parameters" id=
"parameters"></a>2.11&#160;Parameters</h4>
<p>Some steps accept parameters. Parameters are name/value pairs,
like variables and options. Unlike variables and options, which
have names known in advance to the pipeline, parameters are not
declared and their names may be unknown to the pipeline author.
Pipelines can dynamically construct sets of parameters. Steps can
read dynamically constructed sets on <em class="glossterm"><a href=
"#dt-parameter-input-port">parameter input ports</a></em>.</p>
<p><span class="termdef" id="dt-parameter">[Definition: A
<em class="glossterm">parameter</em> is a name/value pair where the
name is an <a href=
"http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded name</a>
and the value <span class="rfc2119">must</span> be a string or
<tt class="type">xs:untypedAtomic</tt>.]</span></p>
<p><span class="termdef" id="dt-parameter-input-port">[Definition:
A <em class="glossterm">parameter input port</em> is a
distinguished kind of input port which accepts (only) dynamically
constructed parameter name/value pairs.]</span> See <a href=
"#parameter-inputs" title="Parameter Inputs">Section&#160;5.1.2,
“Parameter Inputs”</a>.</p>
<p>Analogous to <em class="glossterm"><a href=
"#dt-primary-input-port">primary input ports</a></em>, steps that
have parameter inputs may designate at most one parameter input
port as a primary parameter input port.</p>
<p><span class="termdef" id=
"dt-primary-parameter-input-port">[Definition: If a step has a
parameter input port which is explicitly marked “<tt class=
"code">primary='true'</tt>”, or if it has exactly one parameter
input port and that port is <em>not</em> explicitly marked
<tt class="code">primary='false'</tt>”, then that parameter input
port is the <em class="glossterm">primary parameter input port</em>
of the step.]</span> If a step has a single parameter input port
and that port is explicitly marked “<tt class=
"code">primary='false'</tt>”, or if a step has more than one
parameter input port and none is explicitly marked as the primary,
then the primary parameter input port of that step is
undefined.</p>
<p><a name="impl-25" id="impl-25"></a>How outside values are
specified for pipeline parameters on the pipeline initially invoked
by the processor is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. In
other words, the command line options, APIs, or other mechanisms
available to specify such parameter values are outside the scope of
this specification.</p>
</div>
<div class="section">
<h4><a name="security-considerations" id=
"security-considerations"></a>2.12&#160;Security
Considerations</h4>
<p>An XProc pipeline may attempt to access arbitrary network
resources: steps such as <a href="#c.load"><tt class=
"tag-element">p:load</tt></a> and <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
can attempt to read from an arbitrary URI; steps such as <a href=
"#c.store"><tt class="tag-element">p:store</tt></a> can attempt to
write to an arbitrary location; <a href="#c.exec"><tt class=
"tag-element">p:exec</tt></a> can attempt to execute an arbitrary
program. Note, also, that some steps, such as <a href=
"#c.xslt"><tt class="tag-element">p:xslt</tt></a> and <a href=
"#c.xquery"><tt class="tag-element">p:xquery</tt></a>, include
extension mechanisms which may attempt to execute arbitrary
code.</p>
<p>In some environments, it may be inappropriate to provide the
XProc pipeline with access to these resources. In a server
environment, for example, it may be impractical to allow pipelines
to store data. In environments where the pipeline cannot be
trusted, allowing the pipeline to access arbitrary resources or
execute arbitrary code may be a security risk.</p>
<p><a name="err.inline.D0021" id="err.inline.D0021"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0021"><code class=
"errqname">err:XD0021</code></a>) for a pipeline to attempt to
access a resource for which it has insufficient privileges or
perform a step which is forbidden. <a name="impl-26" id=
"impl-26"></a>Which steps are forbidden, what privileges are needed
to access resources, and under what circumstances these security
constraints apply is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p>Steps in a pipeline may call themselves recursively which could
result in pipelines which will never terminate.</p>
<p>A conformant XProc processor may limit the resources available
to any or all steps in a pipeline. A conformant implementation may
raise dynamic errors, or take any other corrective action, for any
security problems that it detects.</p>
</div>
<div class="section">
<h4><a name="versioning-considerations" id=
"versioning-considerations"></a>2.13&#160;Versioning
Considerations</h4>
<p>A pipeline author <span class="rfc2119">may</span> identify the
version of XProc for which a particular pipeline was authored by
setting the <tt class="tag-attribute">version</tt> attribute. The
<tt class="tag-attribute">version</tt> attribute can be specified
on <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a>, <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>, or
<a href="#p.library"><tt class="tag-element">p:library</tt></a>. If
specified, the value of the <tt class="tag-attribute">version</tt>
attribute <span class="rfc2119">must</span> be a <tt class=
"type">xs:decimal</tt>. <a name="err.inline.S0063" id=
"err.inline.S0063"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0063"><code class="errqname">err:XS0063</code></a>) if the
value of the <tt class="tag-attribute">version</tt> attribute is
not a <tt class="type">xs:decimal</tt>.</p>
<p>The version of XProc defined by this specification is
<tt class="literal">1.0</tt>”.</p>
<p>A pipeline author <span class="rfc2119">must</span> identify the
version of XProc on the document element of a pipeline document.
<a name="err.inline.S0062" id="err.inline.S0062"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0062"><code class=
"errqname">err:XS0062</code></a>) if a required <tt class=
"tag-attribute">version</tt> attribute is not present.</p>
<p>The version identified applies to the element on which the
<tt class="tag-attribute">version</tt> attribute appears and all of
its descendants, unless or until another version is explicitly
identified.</p>
<p>When a processor encounters an explicit version (other than a
version which it implements), it proceeds in backwards- or
forwards-compatible mode.</p>
<div class="section">
<h5><a name="vers-backcomp" id=
"vers-backcomp"></a>2.13.1&#160;Backwards-compatible Mode</h5>
<p>If the processor encounters a request for a previous version of
XProc (e.g, if a "2.0" processor encounters an explicit request for
the "1.0" language), it <span class="rfc2119">must</span> process
the pipeline as if it was a processor for the requested version: it
<span class="rfc2119">must</span> enforce the semantics of the
requested version, it <span class="rfc2119">must</span> report
steps not known in that version as errors, etc. <a name=
"err.inline.S0060" id="err.inline.S0060"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0060"><code class=
"errqname">err:XS0060</code></a>) if the processor encounters an
explicit request for a previous version of the language and it is
unable to process the pipeline using those semantics.</p>
</div>
<div class="section">
<h5><a name="vers-forwcomp" id=
"vers-forwcomp"></a>2.13.2&#160;Forwards-compatible Mode</h5>
<p>If the processor encounters an explicit version which it does
not recognize, it processes the pipeline in forwards-compatible
mode. Forwards-compatible mode relaxes several static errors,
turning them into dynamic errors so that a pipeline author can
write a pipeline which conditionally uses new language
features.</p>
<p>In forwards-compatible mode:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>On any element in the XProc namespace, unrecognized attributes
(other than extension attributes) are ignored.</p>
</li>
<li>
<p>On any step in the XProc namespace, unknown options are
ignored.</p>
</li>
<li>
<p>If a step in the XProc namespace includes an unknown input port
with an explicit connection, the connection is treated normally for
the purpose of computing the dependencies in the pipeline but it is
otherwise ignored. Unknown input ports <span class="rfc2119">must
not</span> be treated as <em class="glossterm"><a href=
"#dt-primary-input-port">primary input ports</a></em>; it will
always be an error if they are used but not explicitly
connected.</p>
</li>
<li>
<p>If a step in the pipeline includes an explicit connection to an
unknown output port on a step in the XProc namespace, the
connection is treated normally for the purpose of computing the
dependencies in the pipeline. An empty sequence of documents
<span class="rfc2119">must</span> appear on that connection.</p>
</li>
</ol>
</div>
<p>As a consequence of the rules above, future specifications
<span class="rfc2119">must not</span> change the semantics of
existing step types without changing their names. Although they may
add new input and output ports, such changes should be done with
care; they <span class="rfc2119">should</span> in some sense be
limited to ancillary inputs and outputs and they <span class=
"rfc2119">must not</span> be <em class="glossterm"><a href=
"#dt-primary-input-port">primary input ports</a></em>.</p>
<div class="section">
<h6><a name="vers-forwcomp-ex" id=
"vers-forwcomp-ex"></a>2.13.2.1&#160;Examples</h6>
<p>In forwards-compatible mode, it is not a static error to
encounter the following step:</p>
<div class="programlisting">
<pre>
&lt;p:string-replace match="div/@class" replace="newclass"&gt;
  &lt;p:input port="ancillary"&gt;
    &lt;p:document href="doc.xml"/&gt;
  &lt;/p:input&gt;
&lt;/p:string-replace&gt;
</pre></div>
<p>The processor will simply ignore the “<tt class=
"port">ancillary</tt>” port.</p>
<p>Suppose that XProc version 2.0 changes the definition of the
<a href="#c.xslt"><tt class="tag-element">p:xslt</tt></a> step so
that it has an additional output port, <tt class=
"code">messages</tt>. Then consider the following pipeline:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
            version="2.0"&gt;

  &lt;p:xslt name="style"&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:document href="style.xsl"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;

  &lt;p:sink/&gt;

  &lt;p:count&gt;
    &lt;p:input port="source"&gt;
      &lt;p:pipe step="style" port="messages"/&gt;
    &lt;/p:input&gt;
  &lt;/p:count&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>When run by a "2.0" or later processor, it will count the
documents that appear on the <tt class="code">messages</tt> port.
When run by a “1.0” processor in forwards-compatible mode, the
binding to the “<tt class="port">messages</tt>” port is not a
static error. Dynamically, the "1.0" processor will always produce
a count of zero, because an empty sequence of documents will always
appear on the <tt class="code">messages</tt> port.</p>
</div>
</div>
</div>
</div>
<div class="section">
<h3><a name="syntax" id="syntax"></a>3&#160;Syntax Overview</h3>
<p>This section describes the normative XML syntax of XProc. This
syntax is sufficient to represent all the aspects of a pipeline, as
set out in the preceding sections. <span class="termdef" id=
"dt-XML">[Definition: XProc is intended to work equally well with
[<a href="#xml10"><span class="abbrev">XML 1.0</span></a>] and
[<a href="#xml11"><span class="abbrev">XML 1.1</span></a>]. Unless
otherwise noted, the term “<em class="glossterm">XML</em>” refers
equally to both versions.]</span> <span class="termdef" id=
"dt-Namespaces-in-XML">[Definition: Unless otherwise noted, the
term <em class="glossterm">Namespaces in XML</em> refers equally to
[<a href="#xmlns10"><span class="abbrev">Namespaces 1.0</span></a>]
and [<a href="#xmlns11"><span class="abbrev">Namespaces
1.1</span></a>].]</span> <a name="impl-27" id="impl-27"></a>Support
for pipeline documents written in XML 1.1 and pipeline inputs and
outputs that use XML 1.1 is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>Elements in a pipeline document represent the pipeline, the
steps it contains, the connections between those steps, the steps
and connections contained within them, and so on. Each step is
represented by an element; a combination of elements and attributes
specify how the inputs and outputs of each step are connected and
how options and parameters are passed.</p>
<p>Conceptually, we can speak of steps as objects that have inputs
and outputs, that are connected together and which may contain
additional steps. Syntactically, we need a mechanism for specifying
these relationships.</p>
<p><em class="glossterm"><a href=
"#dt-container">Containment</a></em> is represented naturally using
nesting of XML elements. If a particular element identifies a
<em class="glossterm"><a href="#dt-compound-step">compound
step</a></em> then the step elements that are its immediate
children form its <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.</p>
<p>The connections between steps are expressed using names and
references to those names.</p>
<p>Six kinds of things are named in XProc:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>Step types,</li>
<li>Steps,</li>
<li>Input ports (both parameter and document),</li>
<li>Output ports,</li>
<li>Options and variables, and</li>
<li>Parameters</li>
</ol>
</div>
<div class="section">
<h4><a name="namespaces" id="namespaces"></a>3.1&#160;XProc
Namespaces</h4>
<p>There are three namespaces associated with XProc:</p>
<div class="variablelist">
<dl>
<dt><tt class="uri">http://www.w3.org/ns/xproc</tt></dt>
<dd>
<p>The namespace of the XProc XML vocabulary described by this
specification; by convention, the namespace prefix “<tt class=
"literal">p:</tt>” is used for this namespace.</p>
</dd>
<dt><tt class="uri">http://www.w3.org/ns/xproc-step</tt></dt>
<dd>
<p>The namespace used for documents that are inputs to and outputs
from several standard and optional steps described in this
specification. Some steps, such as <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
and <a href="#c.store"><tt class="tag-element">p:store</tt></a>,
have defined input or output vocabularies. We use this namespace
for all of those documents. The conventional prefix “<tt class=
"literal">c:</tt>” is used for this namespace.</p>
</dd>
<dt><tt class="uri">http://www.w3.org/ns/xproc-error</tt></dt>
<dd>
<p>The namespace used for errors. The conventional prefix
<tt class="literal">err:</tt>” is used for this namespace.</p>
</dd>
</dl>
</div>
<p>This specification also makes use of the prefix “<tt class=
"literal">xs:</tt>” to refer to the [<a href=
"#xmlschema-1"><span class="abbrev">W3C XML Schema: Part
1</span></a>] namespace <tt class=
"uri">http://www.w3.org/2001/XMLSchema</tt>.</p>
</div>
<div class="section">
<h4><a name="scoping" id="scoping"></a>3.2&#160;Scoping of
Names</h4>
<p>Names are used to identify step types, steps, ports, options and
variables, and parameters. Step types, options, variables, and
parameters are named with QNames. Steps and ports are named with
NCNames. The scope of a name is a measure of where it is available
in a pipeline. <span class="termdef" id="dt-visible">[Definition:
If two names are in the same scope, we say that they are <em class=
"glossterm">visible</em> to each other. ]</span></p>
<p>The scope of the names of the step types is the pipeline in
which they are declared, including any declarations imported from
libraries via <a href="#p.import"><tt class=
"tag-element">p:import</tt></a>. Nested pipelines inherit the step
types in scope for their parent.</p>
<p>In other words, the step types that are in scope in a <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> or
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> are:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The standard, built-in types (<a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>, <a href="#p.choose"><tt class=
"tag-element">p:choose</tt></a>, etc.).</p>
</li>
<li>
<p>Any implementation-provided types.</p>
</li>
<li>
<p>Any step types declared in the pipeline (the <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> and
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> children of the pipeline
element).</p>
</li>
<li>
<p>The types of any <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>s or <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>s
that are imported.</p>
</li>
<li>
<p>Any types that are in the scope of any <a href=
"#p.library"><tt class="tag-element">p:library</tt></a> that is
imported.</p>
</li>
<li>
<p>Any step types that are in scope for the pipeline's parent
<a href="#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>
or <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a>, if it has one.</p>
</li>
<li>
<p>The type of the pipeline itself, if it has one.</p>
</li>
</ul>
</div>
<p>The step types that are in scope in a <a href=
"#p.library"><tt class="tag-element">p:library</tt></a> are:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The standard, built-in types (<a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>, <a href="#p.choose"><tt class=
"tag-element">p:choose</tt></a>, etc.).</p>
</li>
<li>
<p>Any implementation-provided types.</p>
</li>
<li>
<p>Any step types declared in the library (the <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> and
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> children of the <a href=
"#p.library"><tt class="tag-element">p:library</tt></a>
element).</p>
</li>
<li>
<p>The types of <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>s or <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>s
that are imported into the library.</p>
</li>
<li>
<p>Any types that are in the scope of any <a href=
"#p.library"><tt class="tag-element">p:library</tt></a> that is
imported.</p>
</li>
</ul>
</div>
<p><a name="err.inline.S0036" id="err.inline.S0036"></a>All the
step types in a pipeline or library <span class=
"rfc2119">must</span> have unique names: it is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0036"><code class=
"errqname">err:XS0036</code></a>) if any step type name is built-in
and/or declared or defined more than once in the same scope.</p>
<p>The scope of the names of the steps themselves is determined by
the <em class="glossterm"><a href=
"#dt-environment">environment</a></em> of each step. In general,
the name of a step, the names of its sibling steps, the names of
any steps that it contains directly, the names of its ancestors,
and the names of the siblings of its ancestors are all in a common
scope. <a name="err.inline.S0002" id="err.inline.S0002"></a>All
steps in the same scope <span class="rfc2119">must</span> have
unique names: it is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0002"><code class="errqname">err:XS0002</code></a>) if two
steps with the same name appear in the same scope.</p>
<p>The scope of an input or output port name is the step on which
it is defined. The names of all the ports on any step <span class=
"rfc2119">must</span> be unique.</p>
<p>Taken together, these uniqueness constraints guarantee that the
combination of a step name and a port name uniquely identifies
exactly one port on exactly one in-scope step.</p>
<p>The scope of option and variable names is determined by where
they are declared. When an option is declared with <a href=
"#p.option"><tt class="tag-element">p:option</tt></a> (or a
variable with <a href="#p.variable"><tt class=
"tag-element">p:variable</tt></a>), unless otherwise specified, its
scope consists of the sibling elements that follow its declaration
and the descendants of those siblings. <a name="err.inline.S0004"
id="err.inline.S0004"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0004"><code class="errqname">err:XS0004</code></a>) if an
option or variable declaration duplicates the name of any other
option or variable in the same <em class="glossterm"><a href=
"#dt-environment">environment</a></em>. That is, no option or
variable may lexically shadow another option or variable with the
same name.</p>
<p>Parameter names are not scoped; they are distinct on each
step.</p>
</div>
<div class="section">
<h4><a name="xml-base-attribute" id=
"xml-base-attribute"></a>3.3&#160;Base URIs and xml:base</h4>
<p>When a relative URI appears in an option value, the base URI
against which it <span class="rfc2119">must</span> be made absolute
is the base URI of the <a href="#p.option"><tt class=
"tag-element">p:option</tt></a> element. If an option value is
specified using a <a href="#option-shortcut">syntactic
shortcut</a>, the base URI of the step on which the shortcut
attribute appears <span class="rfc2119">must</span> be used. In
general, whenever a relative URI appears, its base URI is the base
URI of the nearest ancestor element.</p>
<p>The pipeline author can control the base URIs of elements within
the pipeline document with the <tt class=
"tag-attribute">xml:base</tt> attribute. The <tt class=
"tag-attribute">xml:base</tt> attribute <span class=
"rfc2119">may</span> appear on any element in a pipeline and has
the semantics outlined in [<a href="#xml-base"><span class=
"abbrev">XML Base</span></a>].</p>
</div>
<div class="section">
<h4><a name="xml-id-attribute" id=
"xml-id-attribute"></a>3.4&#160;Unique identifiers</h4>
<p>A pipeline author can provide a globally unique identifier for
any element in a pipeline with the <tt class=
"tag-attribute">xml:id</tt> attribute.</p>
<p>The <tt class="tag-attribute">xml:id</tt> attribute <span class=
"rfc2119">may</span> appear on any element in a pipeline and has
the semantics outlined in [<a href="#xml-id"><span class=
"abbrev">xml:id</span></a>].</p>
</div>
<div class="section">
<h4><a name="syntax-docs-ports" id=
"syntax-docs-ports"></a>3.5&#160;Associating Documents with
Ports</h4>
<p><span class="termdef" id="dt-connection">[Definition: A
<em class="glossterm">connection</em> associates an input or output
port with some data source.]</span> A document or a sequence of
documents can be connected to a port in four ways: <em class=
"glossterm"><a href="#dt-by-source">by source</a></em>, <em class=
"glossterm"><a href="#dt-by-URI">by URI</a></em>, by providing an
<em class="glossterm"><a href="#dt-inline-document">inline
document</a></em>, or by making it <em class="glossterm"><a href=
"#dt-empty-sequence">explicitly empty</a></em>. Each of these
mechanisms is allowed on the <a href="#p.input"><tt class=
"tag-element">p:input</tt></a>, <a href="#p.output"><tt class=
"tag-element">p:output</tt></a>, <a href=
"#p.xpath-context"><tt class=
"tag-element">p:xpath-context</tt></a>, <a href=
"#p.iteration-source"><tt class=
"tag-element">p:iteration-source</tt></a>, and <a href=
"#p.viewport-source"><tt class=
"tag-element">p:viewport-source</tt></a> elements.</p>
<div class="variablelist">
<dl>
<dt>Specified by URI</dt>
<dd>
<p><span class="termdef" id="dt-by-URI">[Definition: A document is
specified <em class="glossterm">by URI</em> if it is referenced
with a URI.]</span> The <tt class="tag-attribute">href</tt>
attribute on the <a href="#p.document"><tt class=
"tag-element">p:document</tt></a> or <a href="#p.data"><tt class=
"tag-element">p:data</tt></a> element is used to refer to documents
by URI.</p>
<p>In this example, the input to the <a href=
"#c.identity"><tt class="tag-element">p:identity</tt></a> step
named “<tt class="literal">otherstep</tt>” comes from “<tt class=
"uri">http://example.com/input.xml</tt>”.</p>
<div class="programlisting">
<pre>
&lt;p:output port="result"/&gt;

&lt;p:identity name="otherstep"&gt;
  &lt;p:input port="source"&gt;
    &lt;p:document href="http://example.com/input.xml"/&gt;
  &lt;/p:input&gt;
&lt;/p:identity&gt;
</pre></div>
</dd>
<dt>Specified by source</dt>
<dd>
<p><span class="termdef" id="dt-by-source">[Definition: A document
is specified <em class="glossterm">by source</em> if it references
a specific port on another step.]</span> The <tt class=
"tag-attribute">step</tt> and <tt class="tag-attribute">port</tt>
attributes on the <a href="#p.pipe"><tt class=
"tag-element">p:pipe</tt></a> element are used for this
purpose.</p>
<p>In this example, the “<tt class="literal">source</tt>” input to
the <a href="#c.xinclude"><tt class=
"tag-element">p:xinclude</tt></a> step named “<tt class=
"literal">expand</tt>” comes from the “<tt class=
"literal">result</tt>” port of the step named “<tt class=
"literal">otherstep</tt>”.</p>
<div class="programlisting">
<pre>
&lt;p:xinclude name="expand"&gt;
  &lt;p:input port="source"&gt;
    &lt;p:pipe step="otherstep" port="result"/&gt;
  &lt;/p:input&gt;
&lt;/p:xinclude&gt;
</pre></div>
<p>See the description of <a href="#p.pipe"><tt class=
"tag-element">p:pipe</tt></a> for a complete description of the
ports that can be connected.</p>
</dd>
<dt>Specified inline</dt>
<dd>
<p><span class="termdef" id="dt-inline-document">[Definition: An
<em class="glossterm">inline document</em> is specified directly in
the body of the element to which it connects.]</span> The content
of the <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a> element is used for this
purpose.</p>
<p>In this example, the “<tt class="literal">stylesheet</tt>” input
to the XSLT step named “<tt class="literal">xform</tt>” comes from
the content of the <a href="#p.input"><tt class=
"tag-element">p:input</tt></a> element itself.</p>
<div class="programlisting">
<pre>
&lt;p:xslt name="xform"&gt;
  &lt;p:input port="stylesheet"&gt;
    &lt;p:inline&gt;
      &lt;xsl:stylesheet version="1.0"&gt;
        ...
      &lt;/xsl:stylesheet&gt;
    &lt;/p:inline&gt;
  &lt;/p:input&gt;
&lt;/p:xslt&gt;
</pre></div>
<p>Inline documents are considered “quoted”. The pipeline processor
passes them literally to the port, even if they contain elements
from the XProc namespace or other namespaces that would have other
semantics outside of the <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a>.</p>
</dd>
<dt>Specified explicitly empty</dt>
<dd>
<p><span class="termdef" id="dt-empty-sequence">[Definition: An
<em class="glossterm">empty sequence</em> of documents is specified
with the <a href="#p.empty"><tt class=
"tag-element">p:empty</tt></a> element.]</span></p>
<p>In this example, the “<tt class="literal">source</tt>” input to
the XSLT 2.0 step named “<tt class="literal">generate</tt>” is
explicitly empty:</p>
<div class="programlisting">
<pre>
&lt;p:xslt name="generate" version="2.0"&gt;
  &lt;p:input port="source"&gt;
    &lt;p:empty/&gt;
  &lt;/p:input&gt;
  &lt;p:input port="stylesheet"&gt;
    &lt;p:inline&gt;
      &lt;xsl:stylesheet version="2.0"&gt;
        ...
      &lt;/xsl:stylesheet&gt;
    &lt;/p:inline&gt;
  &lt;/p:input&gt;
  &lt;p:with-option name="template-name" select="'someName'"/&gt;
&lt;/p:xslt&gt;
</pre></div>
<p>If you omit the connection on a primary input port, a connection
to the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> will be
assumed. Making the connection explicitly empty guarantees that the
connection will be to an empty sequence of documents.</p>
<p id="empty-xpath-context">It is inconsistent with the [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>] specification
to specify an empty connection as the context for evaluating an
XPath expression. When an empty connection is specified for an
XPath 1.0 expression, an empty document node <span class=
"rfc2119">must</span> be used instead as the context node.</p>
</dd>
</dl>
</div>
<p>Note that a <a href="#p.input"><tt class=
"tag-element">p:input</tt></a> or <a href="#p.output"><tt class=
"tag-element">p:output</tt></a> element may contain more than one
<a href="#p.pipe"><tt class="tag-element">p:pipe</tt></a>, <a href=
"#p.document"><tt class="tag-element">p:document</tt></a>, <a href=
"#p.data"><tt class="tag-element">p:data</tt></a>, or <a href=
"#p.inline"><tt class="tag-element">p:inline</tt></a> element. If
more than one <em class="glossterm"><a href=
"#dt-connection">connection</a></em> is provided, then the
specified sequence of documents is made available on that port in
the same order as the connections.</p>
</div>
<div class="section">
<h4><a name="documentation" id=
"documentation"></a>3.6&#160;Documentation</h4>
<p>Pipeline authors may add documentation to their pipeline
documents with the <a href="#p.documentation"><tt class=
"tag-element">p:documentation</tt></a> element. Except when it
appears as a descendant of <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a>, the <a href=
"#p.documentation"><tt class="tag-element">p:documentation</tt></a>
element is completely ignored by pipeline processors, it exists
simply for documentation purposes. If a <a href=
"#p.documentation"><tt class="tag-element">p:documentation</tt></a>
is provided as a descendant of <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a>, it has no special semantics, it is
treated literally as part of the document to be provided on that
port. The <a href="#p.documentation"><tt class=
"tag-element">p:documentation</tt></a> element has no special
semantics when it appears in documents that flow through the
pipeline.</p>
<p>Pipeline processors that inspect the contents of <a href=
"#p.documentation"><tt class="tag-element">p:documentation</tt></a>
elements and behave differently on the basis of what they find are
<em>not conformant</em>. Processor extensions <span class=
"rfc2119">must</span> be specified with <a href=
"#p.pipeinfo"><tt class="tag-element">p:pipeinfo</tt></a>.</p>
</div>
<div class="section">
<h4><a name="annotations" id="annotations"></a>3.7&#160;Processor
annotations</h4>
<p>Pipeline authors may add annotations to their pipeline documents
with the <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> element. <a name="impl-28" id=
"impl-28"></a>The semantics of <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> elements are <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.
Processors <span class="rfc2119">should</span> specify a way for
their annotations to be identified, perhaps with <a href=
"#extension-attributes">extension attributes</a>.</p>
<p>Where <a href="#p.documentation"><tt class=
"tag-element">p:documentation</tt></a> is intended for human
consumption, <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> elements are intended for
processor consumption. A processor might, for example, use
annotations to identify some particular aspect of an
implementation, to request additional, perhaps non-standard
features, to describe parallelism constraints, etc.</p>
<p>When a <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> appears as a descendant of
<a href="#p.inline"><tt class="tag-element">p:inline</tt></a>, it
has no special semantics; in that context it <span class=
"rfc2119">must</span> be treated literally as part of the document
to be provided on that port. The <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> element has no special semantics
when it appears in documents that flow through the pipeline.</p>
</div>
<div class="section">
<h4><a name="extension-attributes" id=
"extension-attributes"></a>3.8&#160;Extension attributes</h4>
<p><span class="termdef" id="dt-extension-attribute">[Definition:
An element from the XProc namespace <span class=
"rfc2119">may</span> have any attribute not from the XProc
namespace, provided that the expanded-QName of the attribute has a
non-null namespace URI. Such an attribute is called an <em class=
"glossterm">extension attribute</em>.]</span></p>
<p>The presence of an extension attribute must not cause the
connections between steps to differ from the connections that would
arise in the absence of the attribute. They must not cause the
processor to fail to signal an error that would be signaled in the
absence of the attribute.</p>
<p>A processor which encounters an extension attribute that it does
not implement <span class="rfc2119">must</span> behave as if the
attribute was not present.</p>
</div>
<div class="section">
<h4><a name="use-when" id="use-when"></a>3.9&#160;Conditional
Element Exclusion</h4>
<p>Any element in the XProc namespace may have a <tt class=
"tag-attribute">use-when</tt> attribute which <span class=
"rfc2119">must</span> contain an XPath expression that can be
evaluated statically. If the attribute is present and the effective
boolean value of the expression is false, then the element and all
of its descendants are effectively excluded from the pipeline
document. If a node is effectively excluded, the processor
<span class="rfc2119">must</span> behave as if the element was not
present in the document.</p>
<p>Elements that are not in the XProc namespace <span class=
"rfc2119">may</span> also have a <tt class=
"tag-attribute">use-when</tt> attribute, but the attribute must be
in the XProc namespace. The semantics of a <tt class=
"tag-attribute">p:use-when</tt> attribute on an element not in the
XProc namespace are the same as the semantics of a <tt class=
"tag-attribute">use-when</tt> attribute on an element in the XProc
namespace.</p>
<p>Conditional element exclusion occurs before any static analysis
of the pipeline.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The effective exclusion of <tt class=
"tag-attribute">use-when</tt> processing occurs after XML parsing
and has no effect on well-formedness or validation errors which
will be reported in the usual way. Note also that <tt class=
"tag-attribute">use-when</tt> is not performed when it occurs on
the descendant of a <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a> element.</p>
</div>
<p>For the purposes of evaluating a <tt class=
"tag-attribute">use-when</tt> expression, the context node,
position, and size are all undefined. No <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em> are available. There are no readable ports. There
are no available documents or available collections.</p>
<p>There are some additional restrictions on the XPath extension
functions that are available in a <tt class=
"tag-attribute">use-when</tt> expression:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The <tt class="literal">p:episode</tt> system property
<span class="rfc2119">should not</span> be used. <a name="impl-29"
id="impl-29"></a>The value of the <tt class=
"literal">p:episode</tt> system property in a <tt class=
"tag-attribute">use-when</tt> expression is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</li>
<li>
<p>The <a href="#f.step-available"><tt class=
"function">p:step-available</tt></a> function cannot be used to
test for the availability of extension steps (because the libraries
that declare them may not have been imported). <a name="impl-30"
id="impl-30"></a>The results of testing for steps not in the XProc
namespace in a <tt class="tag-attribute">use-when</tt> expression
are <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</li>
<li>
<p>The steps available and possibly other aspects of the expression
may depend on the version specified for a pipeline, see <a href=
"#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>. For example, in a “1.0” pipeline, the
processor <span class="rfc2119">should not</span> report that “2.0”
steps are available.</p>
</li>
</ul>
</div>
<p><a name="err.inline.S0061" id="err.inline.S0061"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0061"><code class=
"errqname">err:XS0061</code></a>) if a <tt class=
"tag-attribute">use-when</tt> expression refers to the context or
attempts to refer to any documents or collections.</p>
</div>
<div class="section">
<h4><a name="syntax-summaries" id=
"syntax-summaries"></a>3.10&#160;Syntax Summaries</h4>
<p>The description of each element in the pipeline namespace is
accompanied by a syntactic summary that provides a quick overview
of the element's syntax:</p>
<p class="element-syntax element-syntax-language-example">
<code>&lt;p:some-element<br />
&#160;&#160;some-attribute? = <var>some-type</var>&gt;<br />
&#160;&#160;&#160;&#160;(<var>some</var> |<br />
&#160;&#160;&#160;&#160;&#160;<var>elements</var> |<br />
&#160;&#160;&#160;&#160;&#160;<var>allowed</var>)*,<br />
&#160;&#160;&#160;&#160;<var>other-elements?</var><br />
&lt;/p:some-element&gt;</code></p>
<p>The content model fragments in these tableaux are presented in a
simple, compact notation. In brief:</p>
<div class="itemizedlist">
<ul>
<li>
<p>A name represent exactly one occurrence of an element with that
name.</p>
</li>
<li>
<p>Parentheses are used for grouping.</p>
</li>
<li>
<p>Elements or groups separated by a comma (“,”) represent an
ordered sequence: a followed by b followed by c: (a,b,c).</p>
</li>
<li>
<p>Elements or groups separated by a vertical bar (“|”) represent a
choice: a or b or c: (a | b | c).</p>
</li>
<li>
<p>Elements or groups separated by an ampersand (“&amp;”) represent
an unordered sequence: a and b and c, in any order: (a &amp; b
&amp; c).</p>
</li>
<li>
<p>An element or group followed by a question mark (“?”) is
optional; it may or may not occur but if it occurs it can occur
only once.</p>
</li>
<li>
<p>An element or group followed by an asterisk (“*”) is optional
and may be repeated; it may or may not occur and if it occurs it
can occur any number of times.</p>
</li>
<li>
<p>An element or group followed by a plus (“+”) is required and may
be repeated; it must occur at least once, and it can occur any
number of times.</p>
</li>
</ul>
</div>
<p>For clarity of exposition, some attributes and elements are
elided from the summaries:</p>
<div class="itemizedlist">
<ul>
<li>
<p>An <tt class="tag-attribute">xml:id</tt> attribute is allowed on
any element. It has the semantics of [<a href=
"#xml-id"><span class="abbrev">xml:id</span></a>].</p>
</li>
<li>
<p>An <tt class="tag-attribute">xml:base</tt> attribute is allowed
on any element. It has the semantics of [<a href=
"#xml-base"><span class="abbrev">XML Base</span></a>].</p>
</li>
<li>
<p>A <tt class="tag-attribute">use-when</tt> attribute is allowed
on any element, see <a href="#use-when" title=
"Conditional Element Exclusion">Section&#160;3.9, “Conditional
Element Exclusion”</a>.</p>
</li>
<li>
<p>The <a href="#p.documentation"><tt class=
"tag-element">p:documentation</tt></a> and <a href=
"#p.pipeinfo"><tt class="tag-element">p:pipeinfo</tt></a> elements
are not shown, but they are allowed anywhere.</p>
</li>
<li>
<p>The <a href="#p.log"><tt class="tag-element">p:log</tt></a>
element is allowed on any step that has a <a href=
"#p.output"><tt class="tag-element">p:output</tt></a>.</p>
</li>
<li>
<p>Attributes that are <a href="#option-shortcut">syntactic
shortcuts for option values</a> are not shown.</p>
</li>
</ul>
</div>
<p>The types given for attributes should be understood as
follows:</p>
<div class="itemizedlist">
<ul>
<li>
<p><tt class="type">ID</tt>, <tt class="type">NCName</tt>,
<tt class="type">NMTOKEN</tt>, <tt class="type">NMTOKENS</tt>,
<tt class="type">anyURI</tt>, <tt class="type">boolean</tt>,
<tt class="type">integer</tt>, <tt class="type">string</tt>: As per
[<a href="#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>] including whitespace normalization as
appropriate.</p>
</li>
<li>
<p><tt class="type">QName</tt>: With whitespace normalization as
per [<a href="#xmlschema-2"><span class="abbrev">W3C XML Schema:
Part 2</span></a>] and according to the following definition: In
the context of XProc, a <tt class="type">QName</tt> is almost
always a QName in the <em class="glossterm"><a href=
"#dt-Namespaces-in-XML">Namespaces in XML</a></em> sense. Note,
however, that <a href="#p.option"><tt class=
"tag-element">p:option</tt></a> and <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a>
values can get their namespace declarations in a non-standard way
(with <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a>) and QNames that have no prefix
are always in no-namespace, irrespective of the default
namespace.</p>
</li>
<li>
<p><tt class="type">PrefixList</tt>: As a list with <tt class=
"literal">[item type]</tt> <tt class="type">NMTOKEN</tt>, per
[<a href="#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>], including whitespace normalization.</p>
</li>
<li>
<p><tt class="type">XPathExpression</tt>, <tt class=
"type">XSLTMatchPattern</tt>: As a string per [<a href=
"#xmlschema-2"><span class="abbrev">W3C XML Schema: Part
2</span></a>], including whitespace normalization, and the further
requirement to be a conformant Expression per [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>] or [<a href=
"#xpath2"><span class="abbrev">XPath 2.0</span></a>], as
appropriate, or Match pattern per [<a href="#xslt10"><span class=
"abbrev">XSLT 1.0</span></a>] or [<a href="#xslt20"><span class=
"abbrev">XSLT 2.0</span></a>], as appropriate.</p>
</li>
</ul>
</div>
</div>
<div class="section">
<h4><a name="common-errors" id="common-errors"></a>3.11&#160;Common
errors</h4>
<p>A number of errors apply generally:</p>
<div class="itemizedlist">
<ul>
<li>
<p><a name="err.inline.S0059" id="err.inline.S0059"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0059"><code class=
"errqname">err:XS0059</code></a>) if the pipeline element is not
<a href="#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>,
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a>, or <a href=
"#p.library"><tt class="tag-element">p:library</tt></a>.</p>
</li>
<li>
<p><a name="err.inline.S0008" id="err.inline.S0008"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0008"><code class=
"errqname">err:XS0008</code></a>) if any element in the XProc
namespace has attributes not defined by this specification unless
they are <em class="glossterm"><a href=
"#dt-extension-attribute">extension attributes</a></em>.</p>
</li>
<li>
<p><a name="err.inline.S0038" id="err.inline.S0038"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0038"><code class=
"errqname">err:XS0038</code></a>) if any required attribute is not
provided.</p>
</li>
<li>
<p><a name="err.inline.D0028" id="err.inline.D0028"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0028"><code class=
"errqname">err:XD0028</code></a>) if any attribute value does not
satisfy the type required for that attribute.</p>
</li>
<li>
<p><a name="err.inline.S0044" id="err.inline.S0044"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0044"><code class=
"errqname">err:XS0044</code></a>) if any element in the XProc
namespace or any step has element children other than those
specified for it by this specification. In particular, the presence
of atomic steps for which there is no visible declaration may raise
this error.</p>
</li>
<li>
<p><a name="err.inline.S0037" id="err.inline.S0037"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0037"><code class=
"errqname">err:XS0037</code></a>) if any step directly contains
text nodes that do not consist entirely of whitespace.</p>
</li>
<li>
<p><a name="err.inline.D0019" id="err.inline.D0019"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0019"><code class=
"errqname">err:XD0019</code></a>) if any option value does not
satisfy the type required for that option.</p>
</li>
<li>
<p><a name="err.inline.S0015" id="err.inline.S0015"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0015"><code class=
"errqname">err:XS0015</code></a>) if a compound step has no
<em class="glossterm"><a href="#dt-contained-steps">contained
steps</a></em>.</p>
</li>
<li>
<p><a name="err.inline.D0012" id="err.inline.D0012"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0012"><code class=
"errqname">err:XD0012</code></a>) if any attempt is made to
dereference a URI where the scheme of the URI reference is not
supported. Implementations are encouraged to support as many
schemes as is practical and, in particular, they <span class=
"rfc2119">should</span> support both the <tt class=
"literal">file:</tt> and <tt class="literal">http(s):</tt> schemes.
<a name="impl-31" id="impl-31"></a>The set of URI schemes actually
supported is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</li>
<li>
<p><a name="err.inline.D0030" id="err.inline.D0030"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0030"><code class=
"errqname">err:XD0030</code></a>) if a step is unable or incapable
of performing its function. This is a general error code for “step
failed” (e.g., if the input isn't of the expected type or if
attempting to process the input causes the implementation to
abort). Users and implementors who create extension steps are
encouraged to use this code for general failures.</p>
</li>
<li>
<p>In most steps which use a select expression or match pattern,
any kind of node can be identified by the expression or pattern.
However, some expressions and patterns on some steps are only
applicable to some kinds of nodes (e.g., it doesn't make sense to
speak of adding attributes to a comment!).</p>
<p><a name="err.inline.C0023" id="err.inline.C0023"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if a select expression or match
pattern returns a node type that is not allowed by the step.</p>
</li>
</ul>
</div>
<p>If an XProc processor can determine statically that a dynamic
error will <em>always</em> occur, it <span class=
"rfc2119">may</span> report that error statically provided that the
error <em>does not</em> occur among the descendants of a <a href=
"#p.try"><tt class="tag-element">p:try</tt></a>. Dynamic errors
inside a <a href="#p.try"><tt class="tag-element">p:try</tt></a>
<span class="rfc2119">must not</span> be reported statically. They
must be raised dynamically so that <a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> processing can be performed on
them.</p>
</div>
</div>
<div class="section">
<h3><a name="steps" id="steps"></a>4&#160;Steps</h3>
<p>This section describes the core steps of XProc.</p>
<p>Several of the steps defined in this specification refer to
other, evolving XML technologies (XSLT, XQuery, XSL-FO, etc.).
Where this specification identifies a specific version of a
technology, implementors <span class="rfc2119">must</span>
implement the specified version or any subsequent edition or
version that is backwards compatible. At user option, they may
support other, incompatible versions or extensions.</p>
<div class="section">
<h4><a name="p.pipeline" id=
"p.pipeline"></a>4.1&#160;p:pipeline</h4>
<p>A <tt class="tag-element">p:pipeline</tt> declares a pipeline
that can be evaluated by an XProc processor. It encapsulates the
behavior of a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>. Its children declare
inputs, outputs, and options that the pipeline exposes and identify
the steps in its subpipeline. (A <tt class=
"tag-element">p:pipeline</tt> is a simplified form of <a href=
"#p.declare-step">step declaration</a>.)</p>
<p>All <tt class="tag-element">p:pipeline</tt> pipelines have an
implicit <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em> named
<tt class="port">source</tt>”, an implicit <em class=
"glossterm"><a href="#dt-primary-parameter-input-port">primary
parameter input port</a></em> named “<tt class=
"port">parameters</tt>”, and an implicit <em class=
"glossterm"><a href="#dt-primary-output-port">primary output
port</a></em> named “<tt class="port">result</tt>”. Any input or
output ports that the <tt class="tag-element">p:pipeline</tt>
declares explicitly are <em>in addition</em> to those ports and may
not be declared primary.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipeline<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.option">p:option</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.serialization">p:serialization</a>)*,<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.pipeline">p:pipeline</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.import">p:import</a>)*,<br />
&#160;&#160;&#160;&#160;<var>subpipeline</var><br />
&lt;/p:pipeline&gt;</code></p>
<p>Viewed from the outside, a <tt class=
"tag-element">p:pipeline</tt> is a black box which performs some
calculation on its inputs and produces its outputs. From the
pipeline author's perspective, the computation performed by the
pipeline is described in terms of <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em> which read the
pipeline's inputs and produce the pipeline's outputs.</p>
<p>The <tt class="tag-attribute">version</tt> attribute identifies
the version of XProc for which this pipeline was authored. If the
<tt class="tag-element">p:pipeline</tt> has no ancestors in the
XProc namespace, then it <span class="rfc2119">must</span> have a
<tt class="tag-attribute">version</tt> attribute. See <a href=
"#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>.</p>
<p>If a pipeline does not have a <tt class=
"tag-attribute">type</tt> then that pipeline cannot be invoked as a
step.</p>
<p>The <tt class="tag-element">p:pipeline</tt> element is just a
simplified form of step declaration. A document that reads:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline <em class="replaceable"><tt class=
"replaceable">some-attributes</tt></em>&gt;
  <em class="replaceable"><tt class=
"replaceable">some-content</tt></em>
&lt;/p:pipeline&gt;
</pre></div>
<p>can be interpreted as if it read:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step <em class="replaceable"><tt class=
"replaceable">some-attributes</tt></em>&gt;
  &lt;p:input port='source' primary='true'/&gt;
  &lt;p:input port='parameters' kind='parameter' primary='true'/&gt;
  &lt;p:output port='result' primary='true'/&gt;
  <em class="replaceable"><tt class=
"replaceable">some-content</tt></em>
&lt;/p:declare-step&gt;
</pre></div>
<p>See <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> for more details.</p>
<div class="section">
<h5><a name="example-pipeline" id=
"example-pipeline"></a>4.1.1&#160;Example</h5>
<p>A pipeline might accept a document as input; perform XInclude,
validation, and transformation; and produce the transformed
document as its output.</p>
<div class="example-wrapper" id="ex.p.pipeline">
<div class="title">Example&#160;4.&#160;A Sample Pipeline
Document</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;

&lt;p:xinclude/&gt;

&lt;p:validate-with-xml-schema&gt;
  &lt;p:input port="schema"&gt;
    &lt;p:document href="http://example.com/path/to/schema.xsd"/&gt;
  &lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;

&lt;p:xslt&gt;
  &lt;p:input port="stylesheet"&gt;
    &lt;p:document href="http://example.com/path/to/stylesheet.xsl"/&gt;
  &lt;/p:input&gt;
&lt;/p:xslt&gt;

&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.for-each" id=
"p.for-each"></a>4.2&#160;p:for-each</h4>
<p>A for-each is specified by the <tt class=
"tag-element">p:for-each</tt> element. It is a <em class=
"glossterm"><a href="#dt-compound-step">compound step</a></em> that
processes a sequence of documents, applying its <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em> to each
document in turn.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:for-each<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.iteration-source">p:iteration-source</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*),<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:for-each&gt;</code></p>
<p>When a pipeline needs to process a sequence of documents using a
subpipeline that only processes a single document, the <tt class=
"tag-element">p:for-each</tt> construct can be used as a wrapper
around that subpipeline. The <tt class=
"tag-element">p:for-each</tt> will apply that subpipeline to each
document in the sequence in turn.</p>
<p>The result of the <tt class="tag-element">p:for-each</tt> is a
sequence of documents produced by processing each individual
document in the input sequence. If the <tt class=
"tag-element">p:for-each</tt> has one or more output ports, what
appears on each of those ports is the sequence of documents that is
the concatenation of the sequence produced by each iteration of the
loop on the port to which it is connected. If the iteration source
for a <tt class="tag-element">p:for-each</tt> is an empty sequence,
then the subpipeline is never run and an empty sequence is produced
on all of the outputs.</p>
<p>The <a href="#p.iteration-source"><tt class=
"tag-element">p:iteration-source</tt></a> is an anonymous input:
its <em class="glossterm"><a href=
"#dt-connection">connection</a></em> provides a sequence of
documents to the <tt class="tag-element">p:for-each</tt> step. If
no iteration sequence is explicitly provided, then the iteration
source is read from the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>.</p>
<p>The processor provides each document, one at a time, to the
<em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> represented by the children
of the <tt class="tag-element">p:for-each</tt> on a port named
<tt class="port">current</tt>.</p>
<p>For each declared output, the processor collects all the
documents that are produced for that output from all the
iterations, in order, into a sequence. The result of the <tt class=
"tag-element">p:for-each</tt> on that output is that sequence of
documents.</p>
<p>The environment inherited by the <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em> of a <tt class=
"tag-element">p:for-each</tt> is the <em class="glossterm"><a href=
"#dt-inherited-environment">inherited environment</a></em> with
these modifications:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The port named “<tt class="port">current</tt>” on the <tt class=
"tag-element">p:for-each</tt> is added to the <em class=
"glossterm"><a href="#dt-readable-ports">readable
ports</a></em>.</p>
</li>
<li>
<p>The port named “<tt class="port">current</tt>” on the <tt class=
"tag-element">p:for-each</tt> is made the <em class=
"glossterm"><a href="#dt-default-readable-port">default readable
port</a></em>.</p>
</li>
</ul>
</div>
<p>If the <tt class="tag-element">p:for-each</tt> has a <em class=
"glossterm"><a href="#dt-primary-output-port">primary output
port</a></em> (explicit or <a href="#primary-input-output">supplied
by default</a>) and that port has no <em class="glossterm"><a href=
"#dt-connection">connection</a></em>, then it is connected to the
<em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em> of the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>.
<a name="err.inline.S0006" id="err.inline.S0006"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0006"><code class=
"errqname">err:XS0006</code></a>) if the primary output port has no
explicit connection and the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the subpipeline does not have
a primary output port.</p>
<p>Note that outputs declared for a <tt class=
"tag-element">p:for-each</tt> serve a dual role. Inside the
<tt class="tag-element">p:for-each</tt>, they are used to read
results from the subpipeline. Outside the <tt class=
"tag-element">p:for-each</tt>, they provide the aggregated
results.</p>
<p>The <tt class="tag-attribute">sequence</tt> attribute on a
<a href="#p.output"><tt class="tag-element">p:output</tt></a>
inside a <tt class="tag-element">p:for-each</tt> only applies
inside the step. From the outside, all of the outputs produce
sequences.</p>
<div class="section">
<h5><a name="for-each-xpath-context" id=
"for-each-xpath-context"></a>4.2.1&#160;XPath Context</h5>
<p>Within a <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a>, the <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a> and <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>
are taken from the sequence of documents that will be processed by
the <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a>. The total number of documents is
the <a href="#f.iteration-size"><tt class=
"function">p:iteration-size</tt></a>; the ordinal value of the
current document (the document appearing on the <tt class=
"port">current</tt> port) is the <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a>.</p>
<div class="admonition" id="impl1">
<div class="admon-title">Note to implementers</div>
<p>In the case where no XPath expression that must be evaluated by
the processor makes any reference to <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>,
its value does not actually have to be calculated (and the entire
input sequence does not, therefore, need to be buffered so that its
size can be calculated before processing begins).</p>
</div>
</div>
<div class="section">
<h5><a name="example-for-each" id=
"example-for-each"></a>4.2.2&#160;Example</h5>
<p>A <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a> might accept a sequence of
chapters as its input, process each chapter in turn with XSLT, a
step that accepts only a single input document, and produce a
sequence of formatted chapters as its output.</p>
<div class="example-wrapper" id="ex.p.for-each">
<div class="title">Example&#160;5.&#160;A Sample For-Each</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:for-each name="chapters"&gt;
  &lt;p:iteration-source select="//chapter"/&gt;
  &lt;p:output port="html-results"&gt;
    &lt;p:pipe step="make-html" port="result"/&gt;
  &lt;/p:output&gt;
  &lt;p:output port="fo-results"&gt;
    &lt;p:pipe step="make-fo" port="result"/&gt;
  &lt;/p:output&gt;

  &lt;p:xslt name="make-html"&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:document href="http://example.com/xsl/html.xsl"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;

  &lt;p:xslt name="make-fo"&gt;
    &lt;p:input port="source"&gt;
      &lt;p:pipe step="chapters" port="current"/&gt;
    &lt;/p:input&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:document href="http://example.com/xsl/fo.xsl"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;
&lt;/p:for-each&gt;
</pre></div>
</div>
</div>
<p>The <tt class="code">//chapter</tt> elements of the document are
selected. Each chapter is transformed into HTML and XSL Formatting
Objects using an XSLT step. The resulting HTML and FO documents are
aggregated together and appear on the <tt class=
"literal">html-results</tt> and <tt class="literal">fo-results</tt>
ports, respectively, of the <tt class="literal">chapters</tt> step
itself.</p>
</div>
</div>
<div class="section">
<h4><a name="p.viewport" id=
"p.viewport"></a>4.3&#160;p:viewport</h4>
<p>A viewport is specified by the <tt class=
"tag-element">p:viewport</tt> element. It is a <em class=
"glossterm"><a href="#dt-compound-step">compound step</a></em> that
processes a single document, applying its <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em> to one
or more subtrees of the document.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:viewport<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;<strong>match</strong> =
<var>XSLTMatchPattern</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.viewport-source">p:viewport-source</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.output">p:output</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>?),<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:viewport&gt;</code></p>
<p>The result of the <tt class="tag-element">p:viewport</tt> is a
copy of the original document where the selected subtrees have been
replaced by the results of applying the subpipeline to them.</p>
<p>The <a href="#p.viewport-source"><tt class=
"tag-element">p:viewport-source</tt></a> is an anonymous input: its
<em class="glossterm"><a href="#dt-connection">connection</a></em>
provides a single document to the <tt class=
"tag-element">p:viewport</tt> step. If no document is explicitly
provided, then the viewport source is read from the <em class=
"glossterm"><a href="#dt-default-readable-port">default readable
port</a></em>. <a name="err.inline.D0003" id=
"err.inline.D0003"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0003"><code class="errqname">err:XD0003</code></a>) if the
viewport source does not provide exactly one document.</p>
<p>The <tt class="tag-attribute">match</tt> attribute specifies an
XSLT match pattern. Each matching node in the source document is
wrapped in a document node, as necessary, and provided, one at a
time, to the viewport's <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> on a port named <tt class=
"port">current</tt>. The base URI of the resulting document that is
passed to the subpipeline is the base URI of the matched element or
document. <a name="err.inline.D0010" id="err.inline.D0010"></a>It
is a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0010"><code class=
"errqname">err:XD0010</code></a>) if the <tt class=
"tag-attribute">match</tt> expression on <tt class=
"tag-element">p:viewport</tt> does not match an element or
document.</p>
<p>After a match is found, the entire subtree rooted at that match
is processed as a unit. No further attempts are made to match nodes
among the descendants of any matched node.</p>
<p>The environment inherited by the <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em> of a <tt class=
"tag-element">p:viewport</tt> is the <em class="glossterm"><a href=
"#dt-inherited-environment">inherited environment</a></em> with
these modifications:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The port named “<tt class="port">current</tt>” on the <tt class=
"tag-element">p:viewport</tt> is added to the <em class=
"glossterm"><a href="#dt-readable-ports">readable
ports</a></em>.</p>
</li>
<li>
<p>The port named “<tt class="port">current</tt>” on the <tt class=
"tag-element">p:viewport</tt> is made the <em class=
"glossterm"><a href="#dt-default-readable-port">default readable
port</a></em>.</p>
</li>
</ul>
</div>
<p>The <tt class="tag-element">p:viewport</tt> must contain a
single, <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em> declared
explicitly or <a href="#primary-input-output">supplied by
default</a>. If that port has no <em class="glossterm"><a href=
"#dt-connection">connection</a></em>, then it is connected to the
<em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em> of the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>.
<a name="err.inline.S0006.1" id="err.inline.S0006.1"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0006"><code class=
"errqname">err:XS0006</code></a>) if the primary output port is
unconnected and the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the subpipeline does not have
a primary output port.</p>
<p>What appears on the output from the <tt class=
"tag-element">p:viewport</tt> will be a copy of the input document
where each matching node is replaced by the result of applying the
subpipeline to the subtree rooted at that node. In other words, if
the match pattern matches a particular element then that element is
wrapped in a document node and provided on the <tt class=
"port">current</tt> port, the subpipeline in the <tt class=
"tag-element">p:viewport</tt> is evaluated, and the result that
appears on the <tt class="port">output</tt> port replaces the
matched element.</p>
<p>If no documents appear on the <tt class="port">output</tt> port,
the matched element will effectively be deleted. If exactly one
document appears, the contents of that document will replace the
matched element. If a sequence of documents appears, then the
contents of each document in that sequence (in the order it appears
in the sequence) will replace the matched element.</p>
<p>The output of the <tt class="tag-element">p:viewport</tt> itself
is a single document that appears on a port named “<tt class=
"literal">result</tt>”. Note that the semantics of <tt class=
"tag-element">p:viewport</tt> are special. The <tt class=
"port">output</tt> port in the <tt class=
"tag-element">p:viewport</tt> is used only to access the results of
the subpipeline. The output of the step itself appears on a port
with the fixed name “<tt class="literal">result</tt>” that is never
explicitly declared.</p>
<div class="section">
<h5><a name="viewport-xpath-context" id=
"viewport-xpath-context"></a>4.3.1&#160;XPath Context</h5>
<p>Within a <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>, the <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a> and <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>
are taken from the sequence of documents that will be processed by
the <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>. The total number of documents is
the <a href="#f.iteration-size"><tt class=
"function">p:iteration-size</tt></a>; the ordinal value of the
current document (the document appearing on the <tt class=
"port">current</tt> port) is the <a href=
"#f.iteration-position"><tt class=
"function">p:iteration-position</tt></a>.</p>
<div class="admonition" id="impl2">
<div class="admon-title">Note to implementers</div>
<p>In the case where no XPath expression that must be evaluated by
the processor makes any reference to <a href=
"#f.iteration-size"><tt class="function">p:iteration-size</tt></a>,
its value does not actually have to be calculated (and the entire
input sequence does not, therefore, need to be buffered so that its
size can be calculated before processing begins).</p>
</div>
</div>
<div class="section">
<h5><a name="example-viewport" id=
"example-viewport"></a>4.3.2&#160;Example</h5>
<p>A <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a> might accept an XHTML document as
its input, add an <tt class="tag-element">hr</tt> element at the
beginning of all <tt class="tag-element">div</tt> elements that
have the class value “chapter”, and return an XHTML document that
is the same as the original except for that change.</p>
<div class="example-wrapper" id="ex.p.viewport">
<div class="title">Example&#160;6.&#160;A Sample Viewport</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:viewport match="h:div[@class='chapter']"
            xmlns:h="http://www.w3.org/1999/xhtml"&gt;
  &lt;p:insert position="first-child"&gt;
    &lt;p:input port="insertion"&gt;
      &lt;p:inline&gt;
        &lt;hr xmlns="http://www.w3.org/1999/xhtml"/&gt;
      &lt;/p:inline&gt;
    &lt;/p:input&gt;
  &lt;/p:insert&gt;
&lt;/p:viewport&gt;
</pre></div>
</div>
</div>
<p>The nodes which match <tt class=
"code">h:div[@class='chapter']</tt> in the input document are
selected. An <tt class="code">hr</tt> is inserted as the first
child of each <tt class="code">h:div</tt> and the resulting version
replaces the original <tt class="code">h:div</tt>. The result of
the whole step is a copy of the input document with a horizontal
rule as the first child of each selected <tt class=
"code">h:div</tt>.</p>
</div>
</div>
<div class="section">
<h4><a name="p.choose" id="p.choose"></a>4.4&#160;p:choose</h4>
<p>A choose is specified by the <tt class=
"tag-element">p:choose</tt> element. It is a <em class=
"glossterm"><a href="#dt-multi-container-step">multi-container
step</a></em> that selects exactly one of a list of alternative
<em class="glossterm"><a href=
"#dt-subpipeline">subpipelines</a></em> based on the evaluation of
XPath expressions.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:choose<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.xpath-context">p:xpath-context</a>?,<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.variable">p:variable</a>*,<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.when">p:when</a>*,<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.otherwise">p:otherwise</a>?)<br />
&lt;/p:choose&gt;</code></p>
<p>A <tt class="tag-element">p:choose</tt> has no inputs. It
contains an arbitrary number of alternative <em class=
"glossterm"><a href="#dt-subpipeline">subpipelines</a></em>,
exactly one of which will be evaluated.</p>
<p>The list of alternative subpipelines consists of zero or more
subpipelines guarded by an XPath expression, followed optionally by
a single default subpipeline.</p>
<p>The <tt class="tag-element">p:choose</tt> considers each
subpipeline in turn and selects the first (and only the first)
subpipeline for which the guard expression evaluates to true in its
context. If there are no subpipelines for which the expression
evaluates to true, the default subpipeline, if it was specified, is
selected.</p>
<p>After a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> is selected, it is evaluated
as if only it had been present.</p>
<p>The outputs of the <tt class="tag-element">p:choose</tt> are
taken from the outputs of the selected <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>. The
<tt class="tag-element">p:choose</tt> has the same number of
outputs as the selected subpipeline with the same names. If the
selected subpipeline has a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em>, the port
with the same name on the <tt class="tag-element">p:choose</tt> is
also a primary output port.</p>
<p>In order to ensure that the output of the <tt class=
"tag-element">p:choose</tt> is consistent irrespective of the
<em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> chosen, each <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em> must
declare the same number of outputs with the same names. If any of
the subpipelines specifies a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em>, each
subpipeline must specify exactly the same output as primary.
<a name="err.inline.S0007" id="err.inline.S0007"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0007"><code class=
"errqname">err:XS0007</code></a>) if two <em class=
"glossterm"><a href="#dt-subpipeline">subpipelines</a></em> in a
<tt class="tag-element">p:choose</tt> declare different
outputs.</p>
<p>As a convenience to authors, it is not an error if some
subpipelines declare outputs that can produce sequences and some do
not. Each output of the <tt class="tag-element">p:choose</tt> is
declared to produce a sequence if that output is declared to
produce a sequence in any of its subpipelines.</p>
<p><a name="err.inline.D0004" id="err.inline.D0004"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0004"><code class=
"errqname">err:XD0004</code></a>) if no <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em> is
selected by the <tt class="tag-element">p:choose</tt> and no
default is provided.</p>
<p>The <tt class="tag-element">p:choose</tt> can specify the
context node against which the XPath expressions that occur on each
branch are evaluated. The context node is specified as a <em class=
"glossterm"><a href="#dt-connection">connection</a></em> in the
<a href="#p.xpath-context"><tt class=
"tag-element">p:xpath-context</tt></a>. If no explicit connection
is provided, the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is used.
In an XPath 1.0 implementation, if the context node is connected to
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a>, or is
unconnected and the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is
undefined, an <a href="#empty-xpath-context">empty document
node</a> is used instead as the context. In an XPath 2.0
implementation, the context item is undefined.</p>
<p>Each conditional <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> is represented by a <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> element. The
default branch is represented by a <a href=
"#p.otherwise"><tt class="tag-element">p:otherwise</tt></a>
element.</p>
<div class="section">
<h5><a name="p.xpath-context" id=
"p.xpath-context"></a>4.4.1&#160;p:xpath-context</h5>
<p>A <tt class="tag-element">p:xpath-context</tt> element specifies
the context node against which an XPath expression will be
evaluated. When it appears in a <a href="#p.when"><tt class=
"tag-element">p:when</tt></a>, it specifies the context for that
<a href="#p.when"><tt class="tag-element">p:when</tt></a>’s
<tt class="tag-attribute">test</tt> attribute. When it appears in
<a href="#p.choose"><tt class="tag-element">p:choose</tt></a>, it
specifies the default context for all of the <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> elements in that
<a href="#p.choose"><tt class="tag-element">p:choose</tt></a>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:xpath-context&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)<br />
&lt;/p:xpath-context&gt;</code></p>
<p>Only one <em class="glossterm"><a href=
"#dt-connection">connection</a></em> is allowed and it works the
same way that connections work on a <a href="#p.input"><tt class=
"tag-element">p:input</tt></a>. No <tt class=
"tag-attribute">select</tt> expression is allowed. <a name=
"err.inline.D0005" id="err.inline.D0005"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0005"><code class=
"errqname">err:XD0005</code></a>) if more than one document appears
on the connection for the <tt class=
"tag-element">xpath-context</tt>.</p>
<p>The <tt class="tag-element">p:xpath-context</tt> element only
provides the context node. The namespace bindings, in-scope
variables, and other aspects of the context come from the element
on which the XPath expression occurs.</p>
<p>In an XPath 1.0 implementation, if the context node is connected
to <a href="#p.empty"><tt class="tag-element">p:empty</tt></a>, or
is unconnected and the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is
undefined, an <a href="#empty-xpath-context">empty document
node</a> is used instead as the context. In an XPath 2.0
implementation, the context item is undefined.</p>
</div>
<div class="section">
<h5><a name="p.when" id="p.when"></a>4.4.2&#160;p:when</h5>
<p>A when specifies one subpipeline guarded by a test
expression.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:when<br />
&#160;&#160;<strong>test</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.xpath-context">p:xpath-context</a>?,<br />
&#160;&#160;&#160;&#160;&#160;(<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:when&gt;</code></p>
<p>Each <tt class="tag-element">p:when</tt> branch of the <a href=
"#p.choose"><tt class="tag-element">p:choose</tt></a> has a
<tt class="tag-attribute">test</tt> attribute which <span class=
"rfc2119">must</span> contain an XPath expression. That XPath
expression's effective boolean value is the guard for the
<em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> contained within that
<tt class="tag-element">p:when</tt>.</p>
<p>The <tt class="tag-element">p:when</tt> can specify a context
node against which its <tt class="tag-attribute">test</tt>
expression is to be evaluated. That context node is specified as a
<em class="glossterm"><a href="#dt-connection">connection</a></em>
for the <a href="#p.xpath-context"><tt class=
"tag-element">p:xpath-context</tt></a>. If no context is specified
on the <tt class="tag-element">p:when</tt>, the context of the
<a href="#p.choose"><tt class="tag-element">p:choose</tt></a> is
used.</p>
</div>
<div class="section">
<h5><a name="p.otherwise" id=
"p.otherwise"></a>4.4.3&#160;p:otherwise</h5>
<p>An otherwise specifies the default branch; the subpipeline
selected if no test expression on any preceding <a href=
"#p.when"><tt class="tag-element">p:when</tt></a> evaluates to
true.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:otherwise&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:otherwise&gt;</code></p>
</div>
<div class="section">
<h5><a name="example-choose" id=
"example-choose"></a>4.4.4&#160;Example</h5>
<p>A <a href="#p.choose"><tt class="tag-element">p:choose</tt></a>
might test the version attribute of the document element and
validate with an appropriate schema.</p>
<div class="example-wrapper" id="ex.p.choose">
<div class="title">Example&#160;7.&#160;A Sample Choose</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:choose name="version"&gt;
  &lt;p:when test="/*[@version = 2]"&gt;
    &lt;p:validate-with-xml-schema&gt;
      &lt;p:input port="schema"&gt;
        &lt;p:document href="v2schema.xsd"/&gt;
      &lt;/p:input&gt;
    &lt;/p:validate-with-xml-schema&gt;
  &lt;/p:when&gt;

  &lt;p:when test="/*[@version = 1]"&gt;
    &lt;p:validate-with-xml-schema&gt;
      &lt;p:input port="schema"&gt;
        &lt;p:document href="v1schema.xsd"/&gt;
      &lt;/p:input&gt;
    &lt;/p:validate-with-xml-schema&gt;
  &lt;/p:when&gt;

  &lt;p:when test="/*[@version]"&gt;
    &lt;p:identity/&gt;
  &lt;/p:when&gt;

  &lt;p:otherwise&gt;
    &lt;p:error code="NOVERSION"&gt;
      &lt;p:input port="source"&gt;
        &lt;p:inline&gt;
          &lt;message&gt;Required version attribute missing.&lt;/message&gt;
        &lt;/p:inline&gt;
      &lt;/p:input&gt;
    &lt;/p:error&gt;
  &lt;/p:otherwise&gt;
&lt;/p:choose&gt;
</pre></div>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.group" id="p.group"></a>4.5&#160;p:group</h4>
<p>A group is specified by the <tt class="tag-element">p:group</tt>
element. In a <a href="#p.try"><tt class=
"tag-element">p:try</tt></a>, it is a non-step wrapper, everywhere
else, it is a <em class="glossterm"><a href=
"#dt-compound-step">compound step</a></em>. A group encapsulates
the behavior of its <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:group<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:group&gt;</code></p>
<p>A <tt class="tag-element">p:group</tt> is a convenience wrapper
for a collection of steps.</p>
<div class="section">
<h5><a name="example-group" id=
"example-group"></a>4.5.1&#160;Example</h5>
<div class="example-wrapper" id="ex.p.group">
<div class="title">Example&#160;8.&#160;An Example Group</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:group&gt;
  &lt;p:variable name="db-key"
              select="'some-long-string-of-nearly-random-characters'"/&gt;

  &lt;p:choose&gt;
    &lt;p:when test="/config/output = 'fo'"&gt;
      &lt;p:xslt&gt;
        &lt;p:with-param name="key" select="$db-key"/&gt;
        &lt;p:input port="stylesheet"&gt;
          &lt;p:document href="fo.xsl"/&gt;
        &lt;/p:input&gt;
      &lt;/p:xslt&gt;
    &lt;/p:when&gt;
    &lt;p:when test="/config/output = 'svg'"&gt;
      &lt;p:xslt&gt;
        &lt;p:with-param name="key" select="$db-key"/&gt;
        &lt;p:input port="stylesheet"&gt;
          &lt;p:document href="svg.xsl"/&gt;
        &lt;/p:input&gt;
      &lt;/p:xslt&gt;
    &lt;/p:when&gt;
    &lt;p:otherwise&gt;
      &lt;p:xslt&gt;
        &lt;p:with-param name="key" select="$db-key"/&gt;
        &lt;p:input port="stylesheet"&gt;
          &lt;p:document href="html.xsl"/&gt;
        &lt;/p:input&gt;
      &lt;/p:xslt&gt;
    &lt;/p:otherwise&gt;
  &lt;/p:choose&gt;
&lt;/p:group&gt;
</pre></div>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.try" id="p.try"></a>4.6&#160;p:try</h4>
<p>A try/catch is specified by the <tt class=
"tag-element">p:try</tt> element. It is a <em class=
"glossterm"><a href="#dt-multi-container-step">multi-container
step</a></em> that isolates a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>, preventing any dynamic
errors that arise within it from being exposed to the rest of the
pipeline.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:try<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.variable">p:variable</a>*,<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.group">p:group</a>,<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.catch">p:catch</a>)<br />
&lt;/p:try&gt;</code></p>
<p>The <a href="#p.group"><tt class="tag-element">p:group</tt></a>
represents the initial subpipeline and the recovery (or “catch”)
pipeline is identified with a <a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> element.</p>
<p>The <tt class="tag-element">p:try</tt> step evaluates the
initial subpipeline and, if no errors occur, the outputs of that
pipeline are the outputs of the <tt class="tag-element">p:try</tt>
step. However, if any errors occur, the <tt class=
"tag-element">p:try</tt> abandons the first subpipeline, discarding
any output that it might have generated, and evaluates the recovery
subpipeline.</p>
<p>If the recovery subpipeline is evaluated, the outputs of the
recovery subpipeline are the outputs of the <tt class=
"tag-element">p:try</tt> step. If the recovery subpipeline is
evaluated and a step within that subpipeline fails, the <tt class=
"tag-element">p:try</tt> fails.</p>
<p>The outputs of the <tt class="tag-element">p:try</tt> are taken
from the outputs of the initial subpipeline or the recovery
subpipeline if an error occurred in the initial subpipeline. The
<tt class="tag-element">p:try</tt> has the same number of outputs
as the selected subpipeline with the same names. If the selected
subpipeline has a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em>, the port
with the same name on the <tt class="tag-element">p:try</tt> is
also a primary output port.</p>
<p>In order to ensure that the output of the <tt class=
"tag-element">p:try</tt> is consistent irrespective of whether the
initial subpipeline provides its output or the recovery subpipeline
does, both subpipelines must declare the same number of outputs
with the same names. If either of the subpipelines specifies a
<em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em>, both subpipelines must specify exactly the
same output as primary. <a name="err.inline.S0009" id=
"err.inline.S0009"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0009"><code class="errqname">err:XS0009</code></a>) if the
<a href="#p.group"><tt class="tag-element">p:group</tt></a> and
<a href="#p.catch"><tt class="tag-element">p:catch</tt></a>
subpipelines declare different outputs.</p>
<p>As a convenience to authors, it is not an error if an output
port can produce a sequence in the initial subpipeline but not in
the recovery subpipeline, or vice versa. Each output of the
<tt class="tag-element">p:try</tt> is declared to produce a
sequence if that output is declared to produce a sequence in either
of its subpipelines.</p>
<p>A pipeline author can cause an error to occur with the <a href=
"#c.error"><tt class="tag-element">p:error</tt></a> step.</p>
<p>The recovery subpipeline of a <tt class="tag-element">p:try</tt>
is identified with a <a href="#p.catch"><tt class="tag-element" id=
"p.catch">p:catch</tt></a>:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:catch<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:catch&gt;</code></p>
<p>The environment inherited by the <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em> of the <a href=
"#p.catch"><tt class="tag-element">p:catch</tt></a> is the
<em class="glossterm"><a href="#dt-inherited-environment">inherited
environment</a></em> with this modification:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The port named “<tt class="port">error</tt>” on the <a href=
"#p.catch"><tt class="tag-element">p:catch</tt></a> is added to the
<em class="glossterm"><a href="#dt-readable-ports">readable
ports</a></em>.</p>
</li>
</ul>
</div>
<p>What appears on the <tt class="port">error</tt> output port is
an <a href="#err-vocab">error document</a>. The error document may
contain messages generated by steps that were part of the initial
subpipeline. Not all messages that appear are indicative of errors;
for example, it is common for all <tt class=
"tag-element">xsl:message</tt> output from the XSLT component to
appear on the <tt class="port">error</tt> output port. It is
possible that the component which fails may not produce any
messages at all. It is also possible that the failure of one
component may cause others to fail so that there may be multiple
failure messages in the document.</p>
<div class="section">
<h5><a name="err-vocab" id="err-vocab"></a>4.6.1&#160;The Error
Vocabulary</h5>
<p>In general, it is very difficult to predict error behavior. Step
failure may be catastrophic (programmer error), or it may be be the
result of user error, resource failures, etc. Steps may detect more
than one error, and the failure of one step may cause other steps
to fail as well.</p>
<p>The <a href="#p.try"><tt class=
"tag-element">p:try</tt></a>/<a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> mechanism gives pipeline authors the
opportunity to process the errors that caused the <a href=
"#p.try"><tt class="tag-element">p:try</tt></a> to fail. In order
to facilitate some modicum of interoperability among processors,
errors that are reported on the <tt class="literal">error</tt>
output port of a <a href="#p.catch"><tt class=
"tag-element">p:catch</tt></a> <span class="rfc2119">should</span>
conform to the format described here.</p>
<div class="section">
<h6><a name="cv.errors" id=
"cv.errors"></a>4.6.1.1&#160;c:errors</h6>
<p>The error vocabulary consists of a root element, <tt class=
"tag-element">c:errors</tt> which contains zero or more <a href=
"#cv.error"><tt class="tag-element">c:error</tt></a> elements.</p>
<p class="element-syntax element-syntax-error-vocabulary">
<code>&lt;c:errors&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.error">c:error</a>*<br />
&lt;/c:errors&gt;</code></p>
</div>
<div class="section">
<h6><a name="cv.error" id="cv.error"></a>4.6.1.2&#160;c:error</h6>
<p>Each specific error is represented by an <tt class=
"tag-element">c:error</tt> element:</p>
<p class="element-syntax element-syntax-error-vocabulary">
<code>&lt;c:error<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;code? = <var>QName</var><br />
&#160;&#160;href? = <var>anyURI</var><br />
&#160;&#160;line? = <var>integer</var><br />
&#160;&#160;column? = <var>integer</var><br />
&#160;&#160;offset? = <var>integer</var>&gt;<br />
&#160;&#160;&#160;&#160;(<var>string</var> |<br />
&#160;&#160;&#160;&#160;&#160;<var>anyElement</var>)*<br />
&lt;/c:error&gt;</code></p>
<p>The <tt class="tag-attribute">name</tt> and <tt class=
"tag-attribute">type</tt> attributes identify the name and type,
respectively, of the step which failed.</p>
<p>The <tt class="tag-attribute">code</tt> is a QName which
identifies the error. For steps which have defined error codes,
this is an opportunity for the step to identify the error in a
machine-processable fashion. Many steps omit this because they do
not include the concept of errors identified by QNames.</p>
<p>If the error was caused by a specific document, or by the
location of some erroneous construction in a specific document, the
<tt class="tag-attribute">href</tt>, <tt class=
"tag-attribute">line</tt>, <tt class="tag-attribute">column</tt>,
and <tt class="tag-attribute">offset</tt> attributes identify this
location. Generally, the error location is identified either with
line and column numbers or with an offset from the beginning of the
document, but not usually both.</p>
<p>The content of the <tt class="tag-element">c:error</tt> element
is any well-formed XML. Specific steps, or specific
implementations, may provide more detail about the format of the
content of an error message.</p>
</div>
<div class="section">
<h6><a name="error-example" id=
"error-example"></a>4.6.1.3&#160;Error Example</h6>
<p>Consider the following XSLT stylesheet:</p>
<div class="programlisting">
<pre>
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"&gt;

&lt;xsl:template match="/"&gt;
  &lt;xsl:message terminate="yes"&gt;
    &lt;xsl:text&gt;This stylesheet is &lt;/xsl:text&gt;
    &lt;emph&gt;pointless&lt;/emph&gt;
    &lt;xsl:text&gt;.&lt;/xsl:text&gt;
  &lt;/xsl:message&gt;
&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</pre></div>
<p>If it was used in a step named “xform” in a <a href=
"#p.try"><tt class="tag-element">p:try</tt></a>, the following
error document might be produced:</p>
<div class="programlisting">
<pre>
&lt;c:errors xmlns:c="http://www.w3.org/ns/xproc-step"&gt;
  &lt;c:error name="xform" type="p:xslt"
             href="style.xsl" line="6"&gt;This stylesheet is &lt;emph&gt;pointless&lt;/emph&gt;.&lt;/c:error&gt;
&lt;/c:errors&gt;
</pre></div>
<p>It is not an error for steps to generate non-standard error
output as long as it is well-formed.</p>
</div>
</div>
<div class="section">
<h5><a name="example-try" id=
"example-try"></a>4.6.2&#160;Example</h5>
<p>A pipeline might attempt to process a document by dispatching it
to some web service. If the web service succeeds, then those
results are passed to the rest of the pipeline. However, if the web
service cannot be contacted or reports an error, the <a href=
"#p.catch"><tt class="tag-element">p:catch</tt></a> step can
provide some sort of default for the rest of the pipeline.</p>
<div class="example-wrapper" id="ex.p.trycatch">
<div class="title">Example&#160;9.&#160;An Example Try/Catch</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:try&gt;
  &lt;p:group&gt;
    &lt;p:http-request&gt;
      &lt;p:input port="source"&gt;
        &lt;p:inline&gt;
          &lt;c:request method="post" href="http://example.com/form-action"&gt;
            &lt;c:body content-type="application/x-www-form-urlencoded"&gt;name=W3C&amp;amp;spec=XProc&lt;/c:body&gt;
          &lt;/c:request&gt;
        &lt;/p:inline&gt;
      &lt;/p:input&gt;
    &lt;/p:http-request&gt;
  &lt;/p:group&gt;
  &lt;p:catch&gt;
    &lt;p:identity&gt;
      &lt;p:input port="source"&gt;
        &lt;p:inline&gt;
          &lt;c:error&gt;HTTP Request Failed&lt;/c:error&gt;
        &lt;/p:inline&gt;
      &lt;/p:input&gt;
    &lt;/p:identity&gt;
  &lt;/p:catch&gt;
&lt;/p:try&gt;
</pre></div>
</div>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.atomic" id="p.atomic"></a>4.7&#160;Atomic Steps</h4>
<p>In addition to the six step types described in the preceding
sections, XProc provides a standard library of atomic step types.
The full vocabulary of standards steps is described in <a href=
"#std-components" title="Standard Step Library">Section&#160;7,
“Standard Step Library”</a>.</p>
<p>All of the standard, atomic steps are invoked in the same
way:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;<var>p:atomic-step</var><br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-option">p:with-option</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-param">p:with-param</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a>)*<br />
&lt;/<var>p:atomic-step</var>&gt;</code></p>
<p>Where “<em class="replaceable"><tt class=
"replaceable">p:atomic-step</tt></em><span class=
"rfc2119">must</span> be in the XProc namespace and <span class=
"rfc2119">must</span> be declared in either the standard library
for the XProc version supported by the processor or explicitly
imported by the surrounding pipeline (see <a href=
"#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>).</p>
</div>
<div class="section">
<h4><a name="p.extension" id="p.extension"></a>4.8&#160;Extension
Steps</h4>
<p>Pipeline authors may also have access to additional steps not
defined or described by this specification. Atomic extension steps
are invoked just like standard steps:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;<var>pfx:atomic-step</var><br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-option">p:with-option</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-param">p:with-param</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a>)*<br />
&lt;/<var>pfx:atomic-step</var>&gt;</code></p>
<p>Extension steps <span class="rfc2119">must not</span> be in the
XProc namespace and there <span class="rfc2119">must</span> be a
<em class="glossterm"><a href="#dt-visible">visible</a></em> step
declaration at the point of use (see <a href="#scoping" title=
"Scoping of Names">Section&#160;3.2, “Scoping of Names”</a>).</p>
<p>If the relevant step declaration has no <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>, then
that step invokes the declared atomic step, which the processor
must know how to perform. These steps are implementation-defined
extensions.</p>
<p>If the relevant step declaration has a <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>, then
that step runs the declared subpipeline. These steps are user- or
implementation-defined extensions. Pipelines can refer to
themselves (recursion is allowed), to pipelines defined in imported
libraries, and to other pipelines in the same library if they are
in a library.</p>
<p><a name="err.inline.S0010" id="err.inline.S0010"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0010"><code class=
"errqname">err:XS0010</code></a>) if a pipeline contains a step
whose specified inputs, outputs, and options do not <em class=
"glossterm"><a href="#dt-matches">match</a></em> the <em class=
"glossterm"><a href="#dt-signature">signature</a></em> for steps of
that type.</p>
<p><a name="err.inline.D0017" id="err.inline.D0017"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0017"><code class=
"errqname">err:XD0017</code></a>) if the running pipeline attempts
to invoke a step which the processor does not know how to
perform.</p>
<p><a name="impl-32" id="impl-32"></a>The presence of other
<em class="glossterm"><a href="#dt-compound-step">compound
steps</a></em> is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>; XProc
provides no standard mechanism for defining them or describing what
they can contain. <a name="err.inline.S0048" id=
"err.inline.S0048"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0048"><code class="errqname">err:XS0048</code></a>) to use a
declared step as a <em class="glossterm"><a href=
"#dt-compound-step">compound step</a></em>.</p>
<div class="section">
<h5><a name="option-shortcut" id=
"option-shortcut"></a>4.8.1&#160;Syntactic Shortcut for Option
Values</h5>
<p>Namespace qualified attributes on a step are <em class=
"glossterm"><a href="#dt-extension-attribute">extension
attributes</a></em>. Attributes, other than <tt class=
"tag-attribute">name</tt>, that are not namespace qualified are
treated as a syntactic shortcut for specifying the value of an
option. In other words, the following two steps are equivalent:</p>
<p>The first step uses the standard <a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a>
syntax:</p>
<div class="programlisting">
<pre>
&lt;ex:stepType&gt;
  &lt;p:with-option name="option-name" select="'some value'"/&gt;
&lt;/ex:stepType&gt;
</pre></div>
<p>The second step uses the syntactic shortcut:</p>
<div class="programlisting">
<pre>
&lt;ex:stepType option-name="some value"/&gt;
</pre></div>
<p>Note that there are significant limitations to this shortcut
syntax:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>It only applies to option names that are not in a namespace.</p>
</li>
<li>
<p>It only applies to option names that are not otherwise used on
the step, such as “<tt class="literal">name</tt>”.</p>
</li>
<li>
<p>It can only be used to specify a constant value. Options that
are computed at runtime must be written using the longer form.</p>
</li>
</ol>
</div>
<p><a name="err.inline.S0027" id="err.inline.S0027"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0027"><code class=
"errqname">err:XS0027</code></a>) if an option is specified with
both the shortcut form and the long form. <a name=
"err.inline.S0031" id="err.inline.S0031"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0031"><code class=
"errqname">err:XS0031</code></a>) to use an option on an <em class=
"glossterm"><a href="#dt-atomic-step">atomic step</a></em> that is
not declared on steps of that type.</p>
<p>The syntactic shortcuts apply equally to standard atomic steps
and extension atomic steps.</p>
</div>
</div>
</div>
<div class="section">
<h3><a name="other-elements" id="other-elements"></a>5&#160;Other
pipeline elements</h3>
<div class="section">
<h4><a name="p.input" id="p.input"></a>5.1&#160;p:input</h4>
<p>A <tt class="tag-element">p:input</tt> identifies an input port
for a step. In some contexts, <tt class="tag-element">p:input</tt>
declares that a port with the specified name exists and identifies
the properties of that port. In other contexts, it provides a
connection for a port declared elsewhere. And in some contexts, it
does both. The semantics of <tt class="tag-element">p:input</tt>
are complicated further by the fact that there are two kinds of
inputs, ordinary “document” inputs and “parameter” inputs.</p>
<div class="section">
<h5><a name="document-inputs" id=
"document-inputs"></a>5.1.1&#160;Document Inputs</h5>
<p>The declaration of a document input identifies the name of the
port, whether or not the port accepts a sequence, whether or not
the port is a <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em>, and may
provide a default connection for the port.</p>
<p>An input <em>declaration</em> has the following form:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var><br />
&#160;&#160;kind? = "document"<br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p>The <tt class="tag-attribute">port</tt> attribute defines the
name of the port. <a name="err.inline.S0011" id=
"err.inline.S0011"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0011"><code class="errqname">err:XS0011</code></a>) to
identify two ports with the same name on the same step.</p>
<p>The <tt class="tag-attribute">sequence</tt> attribute determines
whether or not a sequence of documents is allowed on the port.
<a name="err.inline.D0006" id="err.inline.D0006"></a>If <tt class=
"tag-attribute">sequence</tt> is not specified, or has the value
false, then it is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0006"><code class="errqname">err:XD0006</code></a>) unless
exactly one document appears on the declared port.</p>
<p>The <tt class="tag-attribute">primary</tt> attribute is used to
identify the <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em>. An input port
is a <em class="glossterm"><a href="#dt-primary-input-port">primary
input port</a></em> if <tt class="tag-attribute">primary</tt> is
specified with the value <tt class="literal">true</tt> or if the
step has only a single input port and <tt class=
"tag-attribute">primary</tt> is not specified. <a name=
"err.inline.S0030" id="err.inline.S0030"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0030"><code class=
"errqname">err:XS0030</code></a>) to specify that more than one
input port is the primary.</p>
<p>The <tt class="tag-attribute">kind</tt> attribute distinguishes
between the two kinds of inputs: document inputs and parameter
inputs. An input port is a document input port if <tt class=
"tag-attribute">kind</tt> is specified with the value “<tt class=
"literal">document</tt>” or if <tt class="tag-attribute">kind</tt>
is not specified.</p>
<p>If a connection is provided in the declaration, then <tt class=
"tag-attribute">select</tt> may be used to select a portion of the
input identified by the <a href="#p.empty"><tt class=
"tag-element">p:empty</tt></a>, <a href="#p.document"><tt class=
"tag-element">p:document</tt></a>, <a href="#p.data"><tt class=
"tag-element">p:data</tt></a>, or <a href="#p.inline"><tt class=
"tag-element">p:inline</tt></a> elements in the <a href=
"#p.input"><tt class="tag-element">p:input</tt></a>. This select
expression applies <em>only</em> if the default connection is used.
If an explicit connection is provided by the caller, then the
default select expression is ignored.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The <a href="#p.pipe"><tt class="tag-element">p:pipe</tt></a>
element is explicitly excluded from a declaration because it would
make the default value of an input dependent on the execution of
some part of the pipeline. Default values are designed so that they
can be computed statically.</p>
</div>
<p>On a <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> for an atomic step, the
<a href="#p.input"><tt class="tag-element">p:input</tt></a> simply
declares the input port. <a name="err.inline.S0042" id=
"err.inline.S0042"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0042"><code class="errqname">err:XS0042</code></a>) to
attempt to provide a connection for an input port on the
declaration of an atomic step.</p>
<p>An input <em>connection</em> has the following form:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p>If no connection is provided for a <em class=
"glossterm"><a href="#dt-primary-input-port">primary input
port</a></em>, the input will be connected to the <em class=
"glossterm"><a href="#dt-default-readable-port">default readable
port</a></em>. <a name="err.inline.S0032" id=
"err.inline.S0032"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0032"><code class="errqname">err:XS0032</code></a>) if no
connection is provided and the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> is
undefined.</p>
<p>A <tt class="tag-attribute">select</tt> expression <span class=
"rfc2119">may</span> also be provided with a connection. The
<tt class="tag-attribute">select</tt> expression, if specified,
applies the specified XPath select expression to the document(s)
that are read. Each selected node is wrapped in a document (unless
it is a document) and provided to the input port. In other
words,</p>
<div class="programlisting">
<pre>
&lt;p:input port="source"&gt;
  &lt;p:document href="http://example.org/input.html"/&gt;
&lt;/p:input&gt;
</pre></div>
<p>provides a single document, but</p>
<div class="programlisting">
<pre>
&lt;p:input port="source" select="//html:div" xmlns:html="http://www.w3.org/1999/xhtml"&gt;
  &lt;p:document href="http://example.org/input.html"/&gt;
&lt;/p:input&gt;
</pre></div>
<p>provides a sequence of zero or more documents, one for each
<tt class="code">html:div</tt> in <tt class=
"uri">http://example.org/input.html</tt>. (Note that in the case of
nested <tt class="code">html:div</tt> elements, this may result in
the same content being returned in several documents.)</p>
<p>A select expression can equally be applied to input read from
another step. This input:</p>
<div class="programlisting">
<pre>
&lt;p:input port="source" select="//html:div" xmlns:html="http://www.w3.org/1999/xhtml"&gt;
  &lt;p:pipe step="origin" port="result"/&gt;
&lt;/p:input&gt;
</pre></div>
<p>provides a sequence of zero or more documents, one for each
<tt class="code">html:div</tt> in the document (or each of the
documents) that is read from the <tt class="literal">result</tt>
port of the step named <tt class="literal">origin</tt>.</p>
<p>The base URI of the document that results from a select
expression is the base URI of the matched element or document.
<a name="err.inline.D0016" id="err.inline.D0016"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0016"><code class=
"errqname">err:XD0016</code></a>) if the <tt class=
"tag-attribute">select</tt> expression on a <a href=
"#p.input"><tt class="tag-element">p:input</tt></a> returns atomic
values or anything other than element or document nodes (or an
empty sequence).</p>
<p>An input declaration may include a default connection. If no
connection is provided for an input port which has a default
connection, then the input is treated as if the default connection
appeared.</p>
<p>A default connection does not satisfy the requirement that a
primary input port is automatically connected by the processor, nor
is it used when no default readable port is defined. In other
words, a <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> or a <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> can
define defaults for all of its inputs, whether they are primary or
not, but defining a default for a primary input usually has no
effect. It's never used by an atomic step since the step, when it's
called, will always connect the primary input port to the default
readable port (or cause a static error). The only case where it has
value is on a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> when that pipeline is invoked
directly by the processor. In that case, the processor <span class=
"rfc2119">must</span> use the default connection if no external
connection is provided for the port.</p>
</div>
<div class="section">
<h5><a name="parameter-inputs" id=
"parameter-inputs"></a>5.1.2&#160;Parameter Inputs</h5>
<p>The declaration of a parameter input identifies the name of the
port and that the port is a parameter input.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var><br />
&#160;&#160;<strong>kind</strong> = "parameter"&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p>The <tt class="tag-attribute">port</tt> attribute defines the
name of the port. <a name="err.inline.S0011.1" id=
"err.inline.S0011.1"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0011"><code class="errqname">err:XS0011</code></a>) to
identify two ports with the same name on the same step.</p>
<p>The <tt class="tag-attribute">sequence</tt> attribute determines
whether or not a sequence of documents is allowed on the port. A
sequence of documents is always allowed on a parameter input port.
<a name="err.inline.S0040" id="err.inline.S0040"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0040"><code class=
"errqname">err:XS0040</code></a>) to specify any value other than
<tt class="literal">true</tt>.</p>
<p>The <tt class="tag-attribute">primary</tt> attribute is used to
identify the <em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em>. An input port is a <em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em> if it is a <em class="glossterm"><a href=
"#dt-parameter-input-port">parameter input port</a></em> and
<tt class="tag-attribute">primary</tt> is specified with the value
<tt class="literal">true</tt> or if the step has only a single
parameter input port and <tt class="tag-attribute">primary</tt> is
not specified. <a name="err.inline.S0030.1" id=
"err.inline.S0030.1"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0030"><code class="errqname">err:XS0030</code></a>) to
specify that more than one parameter input port is the primary.</p>
<p>The <tt class="tag-attribute">kind</tt> attribute distinguishes
between the two kinds of inputs: document inputs and parameter
inputs. An input port is a parameter input port only if the
<tt class="tag-attribute">kind</tt> attribute is specified with the
value “parameter”. <a name="err.inline.S0033" id=
"err.inline.S0033"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0033"><code class="errqname">err:XS0033</code></a>) to
specify any kind of input other than “document” or “parameter”.</p>
<p>A parameter input port is a distinguished kind of input port. It
exists only to receive computed parameters; if a step does not have
a parameter input port then it cannot receive parameters. A
parameter input port must satisfy all the constraints of a normal,
document input port.</p>
<p><a name="err.inline.S0035" id="err.inline.S0035"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0035"><code class=
"errqname">err:XS0035</code></a>) if the declaration of a parameter
input port contains a connection; parameter input port declarations
must be empty.</p>
<p>When used on a step, parameter input ports are connected just
like ordinary document ports. Parameter input ports always accept a
sequence of documents. If no explicit connection is provided for a
<em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em>, then the port will be connected to the primary
parameter input port of the pipeline which contains the step. If no
connection is provided for a parameter input port other than the
primary parameter input port, then the port will be connected to an
<em class="glossterm"><a href="#dt-empty-sequence">empty
sequence</a></em> of documents.</p>
<p><a name="err.inline.S0055" id="err.inline.S0055"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0055"><code class=
"errqname">err:XS0055</code></a>) if a primary parameter input port
is unconnected and the pipeline that contains the step has no
primary parameter input port unless at least one explicit <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a> is
provided for that port.</p>
<p>In other words, it is an error to leave a parameter input port
unconnected, but any parameter passed explicitly to that port
satisfies the connection requirement.</p>
<p>This is an error:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:input port="source"/&gt;
&lt;p:output port="result"/&gt;

&lt;p:xslt&gt;
  &lt;p:input port="stylesheet"&gt;
    &lt;p:document href="http://example.com/stylesheets/doc.xsl"/&gt;
  &lt;/p:input&gt;
&lt;/p:xslt&gt;

&lt;/p:declare-step&gt;
</pre></div>
<p>The parameter input port on the <a href="#c.xslt"><tt class=
"tag-element">p:xslt</tt></a> step has no connection and the
pipeline that contains the step has no primary parameter input
port.</p>
<p>This is not an error:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:input port="source"/&gt;
&lt;p:output port="result"/&gt;

&lt;p:xslt&gt;
  &lt;p:input port="stylesheet"&gt;
    &lt;p:document href="http://example.com/stylesheets/doc.xsl"/&gt;
  &lt;/p:input&gt;
  &lt;p:with-param name="mode" select="'debug'"/&gt;
&lt;/p:xslt&gt;

&lt;/p:declare-step&gt;
</pre></div>
<p>Explicitly setting the “<tt class="literal">mode</tt>” parameter
satisfies the binding requirement. No other parameters can be
passed to the <a href="#c.xslt"><tt class=
"tag-element">p:xslt</tt></a> step.</p>
<p>This, also, is not an error:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;

&lt;p:xslt&gt;
  &lt;p:input port="stylesheet"&gt;
    &lt;p:document href="http://example.com/stylesheets/doc.xsl"/&gt;
  &lt;/p:input&gt;
  &lt;p:with-param name="mode" select="'debug'"/&gt;
&lt;/p:xslt&gt;

&lt;/p:pipeline&gt;
</pre></div>
<p>The parameter input port on the <a href="#c.xslt"><tt class=
"tag-element">p:xslt</tt></a> step is bound to the primary
parameter input port of the pipeline. The <a href=
"#c.xslt"><tt class="tag-element">p:xslt</tt></a> step will receive
the “<tt class="literal">mode</tt>” parameter and any other
parameters passed to the pipeline.</p>
<p>If a parameter input port on a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> is not connected, it is treated
as if it was connected to an automatically created <a href=
"#c.sink"><tt class="tag-element">p:sink</tt></a> step. In other
words, if a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> does not contain any steps that
have parameter input ports, or if those ports are all explicitly
connected elsewhere, the parameter input port is ignored. In this
one case, it is not an error for an input port to be
unconnected.</p>
<p>A step which accepts a parameter input reads all of the
documents presented on that port, using each <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> (either at the
root or inside the <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a>) to establish the value of the
named parameter. If the same name appears more than once, the last
value specified is used. If the step also has literal <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a>
elements, they are also considered in document order. In other
words, <a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> elements that appear before the
parameter input may be overridden by the computed parameters;
<a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> elements that appear after may
override the computed values.</p>
<p>If a connection is manufactured for a primary parameter input
port, that connection occurs logically last among the other
parameters, options, and connections passed to the step. In other
words, the parameter values that appear on that port will be used
even if other values were specified with <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a>
elements. Users can change this priority by making the connection
explicit and placing any <a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> elements that they wish to
function as overrides after the connection.</p>
<p>All of the documents that appear on a parameter input must
either be <a href="#cv.param"><tt class=
"tag-element">c:param</tt></a> documents or <a href=
"#cv.param-set"><tt class="tag-element">c:param-set</tt></a>
documents.</p>
<p>Consider the example in <a href="#ex.parameter" title=
"A Parameter Example">Example&#160;10, “A Parameter
Example”</a>.</p>
<div class="example-wrapper" id="ex.parameter">
<div class="title">Example&#160;10.&#160;A Parameter Example</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
            version="1.0"
            name="main"&gt;

&lt;p:xslt&gt;
  &lt;p:input port="source"&gt;
    &lt;p:pipe step="main" port="source"/&gt;
  &lt;/p:input&gt;
  &lt;p:input port="stylesheet"&gt;
    &lt;p:document href="http://example.com/stylesheets/doc.xsl"/&gt;
  &lt;/p:input&gt;
  &lt;p:with-param name="output-type" select="'html'"/&gt;
  &lt;p:input port="parameters"&gt;
    &lt;p:pipe step="main" port="parameters"/&gt;
  &lt;/p:input&gt;
&lt;/p:xslt&gt;

&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
<p>This <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> declares that it accepts
parameters. Suppose that (through some <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>
mechanism) I have passed the parameters “<tt class=
"varname">output-type</tt>=<tt class="literal">fo</tt>” and
<tt class="varname">profile</tt>=<tt class=
"literal">unclassified</tt>” to the pipeline. These parameters are
available on the <tt class="literal">parameters</tt> input
port.</p>
<p>When the XSLT step runs, it will read those parameters and
combine them with any parameters specified literally on the step.
Because the parameter input comes <em>after</em> the literal
declaration for <tt class="varname">output-type</tt> on the step,
the XSLT stylesheet will see both values that I passed in
(“<tt class="varname">output-type</tt>=<tt class="literal">fo</tt>
and “<tt class="varname">profile</tt>=<tt class=
"literal">unclassified</tt>”).</p>
<p>If the parameter input came <em>before</em> the literal
declaration, then the XSLT stylesheet would see “<tt class=
"varname">output-type</tt>=<tt class="literal">html</tt>” and
<tt class="varname">profile</tt>=<tt class=
"literal">unclassified</tt>”.</p>
<p>Most steps don't bother to declare parameter inputs, or provide
explicit connections for them, and “the right thing” usually
happens.</p>
<div class="section">
<h6><a name="cv.param" id="cv.param"></a>5.1.2.1&#160;The c:param
element</h6>
<p>A <tt class="tag-element">c:param</tt> represents a parameter on
a parameter input.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:param<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;namespace? = <var>anyURI</var><br />
&#160;&#160;<strong>value</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p>The <tt class="tag-attribute">name</tt> attribute of the
<tt class="tag-element">c:param</tt> must have the lexical form of
a QName.</p>
<p>If the <tt class="tag-attribute">namespace</tt> attribute is
specified, then the expanded name of the parameter is constructed
from the specified namespace and the <tt class=
"tag-attribute">name</tt> value. <a name="err.inline.D0025" id=
"err.inline.D0025"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0025"><code class="errqname">err:XD0025</code></a>) if the
<tt class="tag-attribute">namespace</tt> attribute is specified,
the <tt class="tag-attribute">name</tt> contains a colon, and the
specified namespace is not the same as the in-scope namespace
binding for the specified prefix.</p>
<p>If the <tt class="tag-attribute">namespace</tt> attribute is not
specified, and the <tt class="tag-attribute">name</tt> contains a
colon, then the expanded name of the parameter is constructed using
the <tt class="tag-attribute">name</tt> value and the namespace
declarations in-scope on the <tt class="tag-element">c:param</tt>
element.</p>
<p>If the <tt class="tag-attribute">namespace</tt> attribute is not
specified, and the <tt class="tag-attribute">name</tt> does not
contain a colon, then the expanded name of the parameter is in no
namespace.</p>
<p>Any namespace-qualified attribute names that appear on the
<tt class="tag-element">c:param</tt> element are ignored. <a name=
"err.inline.D0014" id="err.inline.D0014"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0014"><code class=
"errqname">err:XD0014</code></a>) for any unqualified attribute
names other than “<tt class="literal">name</tt>”, “<tt class=
"literal">namespace</tt>”, or “<tt class="literal">value</tt>” to
appear on a <tt class="tag-element">c:param</tt> element.</p>
</div>
<div class="section">
<h6><a name="cv.param-set" id="cv.param-set"></a>5.1.2.2&#160;The
c:param-set element</h6>
<p>A <tt class="tag-element">c:param-set</tt> represents a set of
parameters on a parameter input.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:param-set&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.param">c:param</a>*<br />
&lt;/c:param-set&gt;</code></p>
<p>The <tt class="tag-element">c:param-set</tt> contains zero or
more <a href="#cv.param"><tt class="tag-element">c:param</tt></a>
elements. <a name="err.inline.D0018" id="err.inline.D0018"></a>It
is a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0018"><code class=
"errqname">err:XD0018</code></a>) if the parameter list contains
any elements other than <a href="#cv.param"><tt class=
"tag-element">c:param</tt></a>.</p>
<p>Any namespace-qualified attribute names that appear on the
<tt class="tag-element">c:param-set</tt> element are ignored.
<a name="err.inline.D0014.1" id="err.inline.D0014.1"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0014"><code class=
"errqname">err:XD0014</code></a>) for any unqualified attribute
names to appear on a <tt class="tag-element">c:param-set</tt>
element.</p>
</div>
</div>
</div>
<div class="section">
<h4><a name="p.iteration-source" id=
"p.iteration-source"></a>5.2&#160;p:iteration-source</h4>
<p>A <tt class="tag-element">p:iteration-source</tt> identifies
input to a <a href="#p.for-each"><tt class=
"tag-element">p:for-each</tt></a>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:iteration-source<br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:iteration-source&gt;</code></p>
<p>The <tt class="tag-attribute">select</tt> attribute and
<em class="glossterm"><a href="#dt-connection">connection</a></em>
of a <tt class="tag-element">p:iteration-source</tt> work the same
way that they do in a <a href="#p.input"><tt class=
"tag-element">p:input</tt></a>.</p>
</div>
<div class="section">
<h4><a name="p.viewport-source" id=
"p.viewport-source"></a>5.3&#160;p:viewport-source</h4>
<p>A <tt class="tag-element">p:viewport-source</tt> identifies
input to a <a href="#p.viewport"><tt class=
"tag-element">p:viewport</tt></a>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:viewport-source&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)?<br />
&lt;/p:viewport-source&gt;</code></p>
<p>Only one <em class="glossterm"><a href=
"#dt-connection">connection</a></em> is allowed and it works the
same way that connections work on a <a href="#p.input"><tt class=
"tag-element">p:input</tt></a>. <a name="err.inline.D0003.1" id=
"err.inline.D0003.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0003"><code class="errqname">err:XD0003</code></a>) unless
exactly one document appears on the <tt class=
"tag-element">p:viewport-source</tt>. No <tt class=
"tag-attribute">select</tt> expression is allowed.</p>
</div>
<div class="section">
<h4><a name="p.output" id="p.output"></a>5.4&#160;p:output</h4>
<p>A <tt class="tag-element">p:output</tt> identifies an output
port, optionally connecting an input for it, if necessary.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:output<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var>&#160;/&gt;</code></p>
<p>The <tt class="tag-attribute">port</tt> attribute defines the
name of the port. <a name="err.inline.S0011.2" id=
"err.inline.S0011.2"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0011"><code class="errqname">err:XS0011</code></a>) to
identify two ports with the same name on the same step.</p>
<p>An output declaration can indicate if a sequence of documents is
allowed to appear on the declared port. If <tt class=
"tag-attribute">sequence</tt> is specified with the value
<tt class="literal">true</tt>, then a sequence is allowed. <a name=
"err.inline.D0007" id="err.inline.D0007"></a>If <tt class=
"tag-attribute">sequence</tt> is not specified on <tt class=
"tag-element">p:output</tt>, or has the value false, then it is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0007"><code class=
"errqname">err:XD0007</code></a>) if the step does not produce
exactly one document on the declared port.</p>
<p>The <tt class="tag-attribute">primary</tt> attribute is used to
identify the primary output port. An output port is a primary
output port if <tt class="tag-attribute">primary</tt> is specified
with the value <tt class="literal">true</tt> or if the step has
only a single output port and primary is not specified. <a name=
"err.inline.S0014" id="err.inline.S0014"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0014"><code class=
"errqname">err:XS0014</code></a>) to identify more than one output
port as primary.</p>
<p>On <em class="glossterm"><a href="#dt-compound-step">compound
steps</a></em>, the declaration <span class="rfc2119">may</span> be
accompanied by a <em class="glossterm"><a href=
"#dt-connection">connection</a></em> for the output.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:output<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:output&gt;</code></p>
<p><a name="err.inline.S0029" id="err.inline.S0029"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0029"><code class=
"errqname">err:XS0029</code></a>) to specify a connection for a
<tt class="tag-element">p:output</tt> inside a <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>
for an atomic step.</p>
<p>If a connection is provided for a <tt class=
"tag-element">p:output</tt>, documents are <em>read from</em> that
connection and those documents form the output that <em>is
written</em> to the output port. In other words, placing a <a href=
"#p.document"><tt class="tag-element">p:document</tt></a> inside a
<tt class="tag-element">p:output</tt> causes the processor to
<em>read that document</em> and provide it on the output port. It
<em>does not</em> cause the processor to <em>write</em> the output
to that document.</p>
</div>
<div class="section">
<h4><a name="p.log" id="p.log"></a>5.5&#160;p:log</h4>
<p>A <tt class="tag-element">p:log</tt> element is a debugging aid.
It associates a URI with a specific output port on a step:</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:log<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;href? = <var>anyURI</var>&#160;/&gt;</code></p>
<p>The semantics of <tt class="tag-element">p:log</tt> are that it
writes to the specified IRI whatever document or documents appear
on the specified port. <a name="impl-33" id="impl-33"></a>If the
<tt class="tag-attribute">href</tt> attribute is not specified, the
location of the log file or files is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p><a name="impl-34" id="impl-34"></a>How each document or sequence
of documents is represented in a <tt class="tag-element">p:log</tt>
is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.
Pipelines are not expected to be able to consume their own logging
output. <a name="impl-35" id="impl-35"></a>The ability of a step to
read the <tt class="tag-element">p:log</tt> output of some former
step is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p><a name="err.inline.S0026" id="err.inline.S0026"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0026"><code class=
"errqname">err:XS0026</code></a>) if the port specified on the
<tt class="tag-element">p:log</tt> is not the name of an output
port on the step in which it appears or if more than one <tt class=
"tag-element">p:log</tt> element is applied to the same port.</p>
<p>Implementations may, at user option, ignore all <tt class=
"tag-element">p:log</tt> elements.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>This element represents a potential security risk: running
unexamined 3rd-party pipelines could result in vital system
resources being overwritten.</p>
</div>
</div>
<div class="section">
<h4><a name="p.serialization" id=
"p.serialization"></a>5.6&#160;p:serialization</h4>
<p>The <tt class="tag-element">p:serialization</tt> element allows
the user to request serialization properties on a <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>
output.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:serialization<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;byte-order-mark? = <var>boolean</var><br />
&#160;&#160;cdata-section-elements? = <var>NMTOKENS</var><br />
&#160;&#160;doctype-public? = <var>string</var><br />
&#160;&#160;doctype-system? = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var><br />
&#160;&#160;escape-uri-attributes? = <var>boolean</var><br />
&#160;&#160;include-content-type? = <var>boolean</var><br />
&#160;&#160;indent? = <var>boolean</var><br />
&#160;&#160;media-type? = <var>string</var><br />
&#160;&#160;method? = <var>QName</var><br />
&#160;&#160;normalization-form? =
<var>NFC|NFD|NFKC|NFKD|fully-normalized|none|xs:NMTOKEN</var><br />
&#160;&#160;omit-xml-declaration? = <var>boolean</var><br />
&#160;&#160;standalone? = <var>true|false|omit</var><br />
&#160;&#160;undeclare-prefixes? = <var>boolean</var><br />
&#160;&#160;version? = <var>string</var>&#160;/&gt;</code></p>
<p>If the pipeline processor serializes the output on the specified
port, it <span class="rfc2119">must</span> use the serialization
options specified. If the processor is not serializing (if, for
example, the pipeline has been called from another pipeline), then
the <tt class="tag-element">p:serialization</tt> <span class=
"rfc2119">must</span> be ignored. The processor <span class=
"rfc2119">may</span> reject statically a pipeline that requests
serialization options that it cannot provide.</p>
<p><a name="impl-36" id="impl-36"></a>The default value of any
serialization options not specified on a particular <tt class=
"tag-element">p:serialization</tt> element is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. The
allowed options are defined by [<a href=
"#xml-serialization"><span class=
"abbrev">Serialization</span></a>]. <a name="err.inline.D0020" id=
"err.inline.D0020"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0020"><code class="errqname">err:XD0020</code></a>) if the
combination of serialization options specified or defaulted is not
allowed. Implementations <span class="rfc2119">must</span> check
that all of the specified serialization options are allowed if they
serialize the specified output. If the specified output is not
being serialized (because it is being returned as the result of a
call from within another pipeline, for example) implementations
<span class="rfc2119">may</span> but are not required to check that
the specified options are allowed.</p>
<p>The semantics of the attributes on a <tt class=
"tag-element">p:serialization</tt> are described in <a href=
"#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>.</p>
<p><a name="err.inline.S0039" id="err.inline.S0039"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0039"><code class=
"errqname">err:XS0039</code></a>) if the port specified on the
<tt class="tag-element">p:serialization</tt> is not the name of an
output port on the pipeline in which it appears or if more than one
<tt class="tag-element">p:serialization</tt> element is applied to
the same port.</p>
</div>
<div class="section">
<h4><a name="variables-options-parameters" id=
"variables-options-parameters"></a>5.7&#160;Variables, Options, and
Parameters</h4>
<p>Variables, options, and parameters provide a mechanism for
pipeline authors to construct temporary results and hold onto them
for reuse.</p>
<p>Variables are created in compound steps and, like XSLT
variables, are single assignment, though they may be shadowed by
subsequent declarations of other variables with the same name.</p>
<p>Options can be declared on atomic or compound steps. The value
of an option can be specified by the caller invoking the step. Any
value specified by the caller takes precedence over any default
value specified in the declaration.</p>
<p>Parameters, unlike options and variables, have names that can be
computed at runtime. The most common use of parameters is to pass
parameter values to XSLT stylesheets.</p>
<div class="section">
<h5><a name="p.variable" id=
"p.variable"></a>5.7.1&#160;p:variable</h5>
<p>A <tt class="tag-element">p:variable</tt> declares a variable
and associates a value with it.</p>
<p>The name of the variable <span class="rfc2119">must</span> be a
QName. If it does not contain a prefix then it is in no namespace.
<a name="err.inline.S0028" id="err.inline.S0028"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0028"><code class=
"errqname">err:XS0028</code></a>) to declare an option or variable
in the XProc namespace.</p>
<p>The variable's value is specified with a <tt class=
"tag-attribute">select</tt> attribute. The <tt class=
"tag-attribute">select</tt> attribute <span class=
"rfc2119">must</span> be specified. The content of the <tt class=
"tag-attribute">select</tt> attribute is an XPath expression which
will be evaluated to provide the value of the variable.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:variable<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:variable&gt;</code></p>
<p>If a <tt class="tag-attribute">select</tt> expression is given,
it is evaluated as an XPath expression using the appropriate
context as described in <a href="#xpath-context" title=
"XPaths in XProc">Section&#160;2.6, “XPaths in XProc”</a>, for the
enclosing <em class="glossterm"><a href=
"#dt-container">container</a></em>, with the addition of bindings
for all preceding-sibling <tt class="tag-element">p:variable</tt>
and <a href="#p.option"><tt class="tag-element">p:option</tt></a>
elements. Regardless of the implicit type of the expression, when
XPath 1.0 is being used, the string value of the expression becomes
the value of the variable; when XPath 2.0 is being used, the type
is treated as an <tt class="type">xs:untypedAtomic</tt>.</p>
<p>Since all <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope bindings</a></em> are present in
the Processor XPath Context as variable bindings, <tt class=
"tag-attribute">select</tt> expressions may refer to the value of
<em class="glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em> by variable reference. If a variable reference
uses a QName that is not the name of an <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
binding</a></em>, an XPath evaluation error will occur.</p>
<p>If a <tt class="tag-attribute">select</tt> expression is given,
the <em class="glossterm"><a href="#dt-readable-ports">readable
ports</a></em> available for document connections are the
<em class="glossterm"><a href="#dt-readable-ports">readable
ports</a></em> in the environment inherited by the first step in
the surrounding <em class="glossterm"><a href=
"#dt-container">container</a></em>'s <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em>. However, in order
to avoid ordering paradoxes, <a name="err.inline.S0019" id=
"err.inline.S0019"></a>it is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0019"><code class="errqname">err:XS0019</code></a>) for a
variable's document connection to refer to the output port of any
step in the surrounding <em class="glossterm"><a href=
"#dt-container">container</a></em>'s <em class="glossterm"><a href=
"#dt-contained-steps">contained steps</a></em>.</p>
<p>If a <tt class="tag-attribute">select</tt> expression is given
but no document connection is provided, the implicit connection is
to the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em> in the
environment inherited by the first step in the surrounding
<em class="glossterm"><a href="#dt-container">container</a></em>'s
<em class="glossterm"><a href="#dt-contained-steps">contained
steps</a></em>. If there is no default readable port, the
connection is treated as if <a href="#p.empty"><tt class=
"tag-element">p:empty</tt></a> was specified.</p>
<p><a name="err.inline.D0008.2" id="err.inline.D0008.2"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0008"><code class=
"errqname">err:XD0008</code></a>) if a sequence of more than one
document appears on the connection for a <tt class=
"tag-element">p:variable</tt>. In an XPath 1.0 implementation, if
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a> is
given or implied as the document connection, an <a href=
"#empty-xpath-context">empty document node</a> is used as the
context node. In an XPath 2.0 implementation, the context item is
undefined. <a name="err.inline.D0026" id="err.inline.D0026"></a>It
is a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0026"><code class=
"errqname">err:XD0026</code></a>) if the <tt class=
"tag-attribute">select</tt> expression makes reference to the
context node, size, or position when the context item is
undefined.</p>
</div>
<div class="section">
<h5><a name="p.option" id="p.option"></a>5.7.2&#160;p:option</h5>
<p>A <tt class="tag-element">p:option</tt> declares an option and
may associate a default value with it. The <tt class=
"tag-element">p:option</tt> tag can only be used in a <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>
or a <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a> (which is a syntactic
abbreviation for a step declaration).</p>
<p>The name of the option <span class="rfc2119">must</span> be a
QName. If it does not contain a prefix then it is in no namespace.
<a name="err.inline.S0028.1" id="err.inline.S0028.1"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0028"><code class=
"errqname">err:XS0028</code></a>) to declare an option or variable
in the XProc namespace.</p>
<p><a name="err.inline.S0004.1" id="err.inline.S0004.1"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0004"><code class=
"errqname">err:XS0004</code></a>) to declare two or more options on
the same step with the same name.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;required? = <var>boolean</var>&#160;/&gt;</code></p>
<p>An option may be declared as <tt class=
"tag-attribute">required</tt>. <a name="err.inline.S0018" id=
"err.inline.S0018"></a>If an option is required, it is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0018"><code class=
"errqname">err:XS0018</code></a>) to invoke the step without
specifying a value for that option.</p>
<p>If an option is not declared to be required, it <span class=
"rfc2119">may</span> be given a default value. The value is
specified with a <tt class="tag-attribute">select</tt>
attribute.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;required? = <var>boolean</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&#160;/&gt;</code></p>
<p>If a <tt class="tag-attribute">select</tt> attribute is
specified, its content is an XPath expression which will be
evaluated to provide the value of the option, which may differ from
one instance of the step type to another.</p>
<p>The <tt class="tag-attribute">select</tt> expression is only
evaluated when its actual value is needed by an instance of the
step type being declared. In this case, it is evaluated as
described in <a href="#p.with-option" title=
"p:with-option">Section&#160;5.7.3, “p:with-option”</a> except
that</p>
<div class="itemizedlist">
<ul>
<li>
<p>In an XPath 1.0 implementation, an <a href=
"#empty-xpath-context">empty document node</a> is used as the
context. In an XPath 2.0 implementation, the context item is
undefined.</p>
</li>
<li>
<p>the variable bindings consist only of bindings for options whose
declaration precedes the <tt class="tag-element">p:option</tt>
itself in the surrounding step <em class="glossterm"><a href=
"#dt-signature">signature</a></em>;</p>
</li>
<li>
<p>the in-scope namespaces are the in-scope namespaces of the
<tt class="tag-element">p:option</tt> itself.</p>
</li>
</ul>
</div>
<p><a name="err.inline.S0017" id="err.inline.S0017"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0017"><code class=
"errqname">err:XS0017</code></a>) to specify that an option is both
<tt class="tag-attribute">required</tt> <em>and</em> has a default
value.</p>
<p><a name="err.inline.D0026.1" id="err.inline.D0026.1"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0026"><code class=
"errqname">err:XD0026</code></a>) if the <tt class=
"tag-attribute">select</tt> expression makes reference to the
context node, size, or position.</p>
<p>Regardless of the implicit type of the expression, when XPath
1.0 is being used, the string value of the expression becomes the
value of the option; when XPath 2.0 is being used, the value is an
<tt class="type">xs:untypedAtomic</tt>.</p>
</div>
<div class="section">
<h5><a name="p.with-option" id=
"p.with-option"></a>5.7.3&#160;p:with-option</h5>
<p>A <tt class="tag-element">p:with-option</tt> provides an actual
value for an option when a step is invoked.</p>
<p>The name of the option <span class="rfc2119">must</span> be a
QName. If it does not contain a prefix then it is in no namespace.
<a name="err.inline.S0031.1" id="err.inline.S0031.1"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0031"><code class=
"errqname">err:XS0031</code></a>) to use an option name in
<tt class="tag-element">p:with-option</tt> if the step type being
invoked has not declared an option with that name. (This error does
not apply for steps in the XProc namespace when the processor is
operating in <a href="#vers-forwcomp">forwards-compatible
mode</a>.)</p>
<p><a name="err.inline.S0004.2" id="err.inline.S0004.2"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0004"><code class=
"errqname">err:XS0004</code></a>) to include more than one
<tt class="tag-element">p:with-option</tt> with the same option
name as part of the same step invocation.</p>
<p>The actual value is specified with a <tt class=
"tag-attribute">select</tt> attribute. The <tt class=
"tag-attribute">select</tt> attribute <span class=
"rfc2119">must</span> be specified. The value of the <tt class=
"tag-attribute">select</tt> attribute is an XPath expression which
will be evaluated to provide the value of the variable.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:with-option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:with-option&gt;</code></p>
<p>Regardless of the implicit type of the expression, when XPath
1.0 is being used, the string value of the expression becomes the
value of the option; when XPath 2.0 is being used, the value is an
<tt class="type">xs:untypedAtomic</tt>.</p>
<p>All <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope bindings</a></em> for the step
instance itself are present in the Processor XPath Context as
variable bindings, so <tt class="tag-attribute">select</tt>
expressions may refer to any option or variable bound in those
<em class="glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em> by variable reference. If a variable reference
uses a QName that is not the name of an <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
binding</a></em> or preceding sibling option, an XPath evaluation
error will occur.</p>
<p>If a <tt class="tag-attribute">select</tt> expression is used
but no document connection is provided, the implicit connection is
to the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>. If
there is no default readable port, the connection is treated as if
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a> was
specified.</p>
<p><a name="err.inline.D0008.3" id="err.inline.D0008.3"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0008"><code class=
"errqname">err:XD0008</code></a>) if a sequence of more than one
document appears on the connection for a <tt class=
"tag-element">p:with-option</tt>. In an XPath 1.0 implementation,
if <a href="#p.empty"><tt class="tag-element">p:empty</tt></a> is
given or implied as the document connection, an <a href=
"#empty-xpath-context">empty document node</a> is used as the
context node. In an XPath 2.0 implementation, the context item is
undefined. <a name="err.inline.D0026.2" id=
"err.inline.D0026.2"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0026"><code class="errqname">err:XD0026</code></a>) if the
<tt class="tag-attribute">select</tt> expression makes reference to
the context node, size, or position when the context item is
undefined.</p>
</div>
<div class="section">
<h5><a name="p.with-param" id=
"p.with-param"></a>5.7.4&#160;p:with-param</h5>
<p>The <tt class="tag-element">p:with-param</tt> element is used to
establish the value of a parameter. The parameter <span class=
"rfc2119">must</span> be given a value when it is used. (Parameter
names aren't known in advance; there's no provision for declaring
them.)</p>
<p>The name of the parameter <span class="rfc2119">must</span> be a
QName. If it does not contain a prefix then it is in no namespace.
<a name="err.inline.D0031" id="err.inline.D0031"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0031"><code class=
"errqname">err:XD0031</code></a>) to use the XProc namespace in the
name of a parameter.</p>
<p>The value is specified with a <tt class=
"tag-attribute">select</tt> attribute. The <tt class=
"tag-attribute">select</tt> attribute <span class=
"rfc2119">must</span> be specified. The content of the <tt class=
"tag-attribute">select</tt> attribute is an XPath expression which
will be evaluated to provide the value of the variable.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:with-param<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var><br />
&#160;&#160;port? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:with-param&gt;</code></p>
<p>The values of parameters for a step <span class=
"rfc2119">must</span> be computed after all the options in the
step's <em class="glossterm"><a href=
"#dt-signature">signature</a></em> have had their values computed.
If a <tt class="tag-attribute">select</tt> expression is given on a
<tt class="tag-element">p:with-param</tt>, it is evaluated as an
XPath expression using the appropriate context as described in
<a href="#xpath-context" title="XPaths in XProc">Section&#160;2.6,
“XPaths in XProc”</a>, for the containing step, with the addition
of variable bindings for all options declared in the containing
step's <em class="glossterm"><a href=
"#dt-signature">signature</a></em>.</p>
<p>Regardless of the implicit type of the expression, when XPath
1.0 is being used, the string value of the expression becomes the
value of the parameter; when XPath 2.0 is being used, the value is
an <tt class="type">xs:untypedAtomic</tt>.</p>
<p>All <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope bindings</a></em> for the step
instance itself are present in the Processor XPath Context as
variable bindings, so <tt class="tag-attribute">select</tt>
expressions may refer to any option or variable bound in those
<em class="glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em>, as well as to any option declared in the step
signature, by variable reference. If a variable reference uses a
QName that is not the name of an <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope binding</a></em> or declared
option, an XPath evaluation error will occur.</p>
<p>If a <tt class="tag-attribute">select</tt> expression is used
but no document connection is provided, the implicit connection is
to the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>. If
there is no default readable port, the connection is treated as if
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a> was
specified.</p>
<p><a name="err.inline.D0008.4" id="err.inline.D0008.4"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0008"><code class=
"errqname">err:XD0008</code></a>) if a sequence of more than one
document appears on the connection for a <tt class=
"tag-element">p:with-param</tt>. In an XPath 1.0 implementation, if
<a href="#p.empty"><tt class="tag-element">p:empty</tt></a> is
given or implied as the document connection, an <a href=
"#empty-xpath-context">empty document node</a> is used as the
context node. In an XPath 2.0 implementation, the context item is
undefined. <a name="err.inline.D0026.3" id=
"err.inline.D0026.3"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0026"><code class="errqname">err:XD0026</code></a>) if the
<tt class="tag-attribute">select</tt> expression makes reference to
the context node, size, or position when the context item is
undefined.</p>
<p>If the optional <tt class="tag-attribute">port</tt> attribute is
specified, then the parameter appears on the named port, otherwise
the parameter appears on the step's <em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em>. <a name="err.inline.S0034" id=
"err.inline.S0034"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0034"><code class="errqname">err:XS0034</code></a>) if the
specified port is not a parameter input port or if no port is
specified and the step does not have a primary parameter input
port.</p>
</div>
<div class="section">
<h5><a name="opt-param-bindings" id=
"opt-param-bindings"></a>5.7.5&#160;Namespaces on variables,
options, and parameters</h5>
<p>Variable, option and parameter values carry with them not only
their literal or computed string value but also a set of
namespaces. To see why this is necessary, consider the following
step:</p>
<div class="programlisting">
<pre>
&lt;p:delete xmlns:p="http://www.w3.org/ns/xproc"&gt;
  &lt;p:with-option name="match" select="'html:div'"
                 xmlns:html="http://www.w3.org/1999/xhtml"/&gt;
&lt;/p:delete&gt;
</pre></div>
<p>The <a href="#c.delete"><tt class=
"tag-element">p:delete</tt></a> step will delete elements that
match the expression “<tt class="literal">html:div</tt>”, but that
expression can only be correctly interpreted if there's a namespace
binding for the prefix “<tt class="literal">html</tt>” so that
binding has to travel with the option.</p>
<p>The default namespace bindings associated with a variable,
option or parameter value are computed as follows:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>If the <tt class="tag-attribute">select</tt> attribute was used
to specify the value and it consisted of a single <tt class=
"literal">VariableReference</tt> (per [<a href=
"#xpath"><span class="abbrev">XPath 1.0</span></a>] or [<a href=
"#xpath2"><span class="abbrev">XPath 2.0</span></a>], as
appropriate), then the namespace bindings from the referenced
option or variable are used.</p>
</li>
<li>
<p>If the <tt class="tag-attribute">select</tt> attribute was used
to specify the value and it evaluated to a node-set, then the
in-scope namespaces from the first node in the selected node-set
(or, if it's not an element, its parent) are used.</p>
<p>The expression is evaluated in the appropriate context, See
<a href="#xpath-context" title="XPaths in XProc">Section&#160;2.6,
“XPaths in XProc”</a>.</p>
</li>
<li>
<p>Otherwise, the in-scope namespaces from the element providing
the value are used. (For options specified using <a href=
"#option-shortcut">syntactic shortcuts</a>, the step element itself
is providing the value.)</p>
</li>
</ol>
</div>
<p>The default namespace is never included in the namespace
bindings for a variable, option or parameter value. Unqualified
names are always in no-namespace.</p>
<p>Unfortunately, in more complex situations, there may be no
single variable, option or parameter that can reliably be expected
to have the correct set of namespace bindings. Consider this
pipeline:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline type="ex:delete-in-div"
            version="1.0"
            xmlns:p="http://www.w3.org/ns/xproc"
            xmlns:ex="http://example.org/ns/ex"
            xmlns:h="http://www.w3.org/1999/xhtml"&gt;
&lt;p:option name="divchild" required="true"/&gt;

&lt;p:delete&gt;
  &lt;p:with-option name="match" select="concat('h:div/',$divchild)"/&gt;
&lt;/p:delete&gt;

&lt;/p:pipeline&gt;
</pre></div>
<p>It defines an atomic step (“<tt class=
"literal">ex:delete-in-div</tt>”) that deletes elements that occur
inside of XHTML div elements. It might be used as follows:</p>
<div class="programlisting">
<pre>
&lt;ex:delete-in-div xmlns:p="http://www.w3.org/ns/xproc"
                  xmlns:ex="http://example.org/ns/ex"
                  xmlns:html="http://www.w3.org/1999/xhtml"
    divchild="html:p[@class='delete']"/&gt;
</pre></div>
<p>In this case, the <tt class="varname">match</tt> option passed
to the <a href="#c.delete"><tt class=
"tag-element">p:delete</tt></a> step needs <em>both</em> the
namespace binding of “<tt class="literal">h</tt>” specified in the
<tt class="tag-element">ex:delete-in-div</tt> pipeline definition
<em>and</em> the namespace binding of “<tt class=
"literal">html</tt>” specified in the <tt class=
"varname">divchild</tt> option on the call of that pipeline. It's
not sufficient to provide just one of the sets of bindings.</p>
<p id="p.namespaces">The <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element can be used as a child
of <a href="#p.variable"><tt class=
"tag-element">p:variable</tt></a>, <a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a> or
<a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> to provide explicit
bindings.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:namespaces<br />
&#160;&#160;binding? = <var>QName</var><br />
&#160;&#160;element? = <var>XPathExpression</var><br />
&#160;&#160;except-prefixes? = <var>prefix
list</var>&#160;/&gt;</code></p>
<p>The namespace bindings specified by a <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a>
element are determined as follows:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>If the <tt class="tag-attribute">binding</tt> attribute is
specified, it <span class="rfc2119">must</span> contain the name of
a single <em class="glossterm"><a href=
"#dt-in-scope-bindings">in-scope binding</a></em>. The namespace
bindings associated with that binding are used. <a name=
"err.inline.S0020" id="err.inline.S0020"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0020"><code class=
"errqname">err:XS0020</code></a>) if the <tt class=
"tag-attribute">binding</tt> attribute on <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a> is
specified and its value is not the name of an <em class=
"glossterm"><a href="#dt-in-scope-bindings">in-scope
binding</a></em>.</p>
</li>
<li>
<p>If the <tt class="tag-attribute">element</tt> attribute is
specified, it <span class="rfc2119">must</span> contain an XPath
expression which identifies a single element node (the input
connection for this expression is the same as the connection for
the <a href="#p.option"><tt class="tag-element">p:option</tt></a>
or <a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> which contains it). The
in-scope namespaces of that node are used.</p>
<p>The expression is evaluated in the appropriate context, See
<a href="#xpath-context" title="XPaths in XProc">Section&#160;2.6,
“XPaths in XProc”</a>.</p>
<p><a name="err.inline.D0009" id="err.inline.D0009"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0009"><code class=
"errqname">err:XD0009</code></a>) if the <tt class=
"tag-attribute">element</tt> attribute on <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a> is
specified and it does not identify a single element node.</p>
</li>
<li>
<p>If neither <tt class="tag-attribute">binding</tt> nor <tt class=
"tag-attribute">element</tt> is specified, the in-scope namespaces
on the <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element itself are used.</p>
</li>
</ol>
</div>
<p>Irrespective of how the set of namespaces are determined, the
<tt class="tag-attribute">except-prefixes</tt> attribute can be
used to exclude one or more namespaces. The value of the
except-prefixes attribute <span class="rfc2119">must</span> be a
sequence of tokens, each of which <span class="rfc2119">must</span>
be a prefix bound to a namespace in the in-scope namespaces of the
<a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element. All bindings of
prefixes to each of the namespaces thus identified are excluded.
<a name="err.inline.S0051" id="err.inline.S0051"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0051"><code class=
"errqname">err:XS0051</code></a>) if the <tt class=
"tag-attribute">except-prefixes</tt> attribute on <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a> does
not contain a list of tokens or if any of those tokens is not a
prefix bound to a namespace in the in-scope namespaces of the
<a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element.</p>
<p><a name="err.inline.S0041" id="err.inline.S0041"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0041"><code class=
"errqname">err:XS0041</code></a>) to specify both <tt class=
"tag-attribute">binding</tt> and <tt class=
"tag-attribute">element</tt> on the same <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a>
element.</p>
<p>If a <a href="#p.variable"><tt class=
"tag-element">p:variable</tt></a>, <a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a> or
<a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> includes one or more <a href=
"#p.namespaces"><tt class="tag-element">p:namespaces</tt></a>
elements, then the union of all the namespaces specified on those
elements are used as the bindings for the variable, option or
parameter value. In this case, the in-scope namespaces on the
<a href="#p.variable"><tt class="tag-element">p:variable</tt></a>,
<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <a href=
"#p.with-param"><tt class="tag-element">p:with-param</tt></a> are
ignored. <a name="err.inline.D0013" id="err.inline.D0013"></a>It is
a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0013"><code class=
"errqname">err:XD0013</code></a>) if the specified namespace
bindings are inconsistent; that is, if the same prefix is bound to
two different namespace names.</p>
<p>For example, this would allow the preceding example to work:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline type="ex:delete-in-div"
            version="1.0"
            xmlns:p="http://www.w3.org/ns/xproc"
            xmlns:ex="http://example.org/ns/ex"
            xmlns:h="http://www.w3.org/1999/xhtml"&gt;
&lt;p:option name="divchild" required="true"/&gt;

&lt;p:delete&gt;
  &lt;p:with-option name="match" select="concat('h:div/',$divchild)"&gt;
    &lt;p:namespaces xmlns:html="http://www.w3.org/1999/xhtml"/&gt;
  &lt;/p:with-option&gt;
&lt;/p:delete&gt;

&lt;/p:pipeline&gt;
</pre></div>
<p>The <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> element provides namespace
bindings for both of the prefixes necessary to correctly interpret
the expression ultimately passed to the <a href=
"#c.delete"><tt class="tag-element">p:delete</tt></a> step (the
binding for <tt class="literal">html:</tt> is explicitly provided
and the binding for <tt class="literal">h:</tt> is in-scope).</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The use of <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> here, when all of the bindings
are provided with explicit namespace declarations, is unnecessary.
The bindings could simply be placed on the parent <a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a>
element. We use <a href="#p.namespaces"><tt class=
"tag-element">p:namespaces</tt></a> here only to make the example
parallel to the one which follows.</p>
</div>
<p>The preceding solution has the weakness that it depends on
knowing the bindings that will be used by the caller. A more
flexible solution would use the <tt class=
"tag-attribute">binding</tt> attribute to copy the bindings from
the caller's option value.</p>
<div class="programlisting">
<pre>
&lt;p:pipeline type="ex:delete-in-div"
            version="1.0"
            xmlns:p="http://www.w3.org/ns/xproc"
            xmlns:ex="http://example.org/ns/ex"
            xmlns:h="http://www.w3.org/1999/xhtml"&gt;
&lt;p:option name="divchild" required="true"/&gt;

&lt;p:delete&gt;
  &lt;p:with-option name="match" select="concat('h:div/',$divchild)"&gt;
    &lt;p:namespaces binding="divchild"/&gt;
    &lt;p:namespaces xmlns:h="http://www.w3.org/1999/xhtml"/&gt;
  &lt;/p:with-option&gt;
&lt;/p:delete&gt;

&lt;/p:pipeline&gt;
</pre></div>
<p>This example will succeed as long as the caller-specified option
does not bind the “<tt class="literal">h</tt>” prefix to something
other than the XHTML namespace.</p>
</div>
</div>
<div class="section">
<h4><a name="p.declare-step" id=
"p.declare-step"></a>5.8&#160;p:declare-step</h4>
<p>A <tt class="tag-element">p:declare-step</tt> provides the type
and <em class="glossterm"><a href=
"#dt-signature">signature</a></em> of an <em class=
"glossterm"><a href="#dt-atomic-step">atomic step</a></em> or
pipeline. It declares the inputs, outputs, and options for all
steps of that type.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:declare-step<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.option">p:option</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.serialization">p:serialization</a>)*,<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.pipeline">p:pipeline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.import">p:import</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)?<br />
&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="tag-attribute">type</tt> can be from
any namespace provided that the expanded-QName of the value has a
non-null namespace URI. <a name="err.inline.S0025" id=
"err.inline.S0025"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0025"><code class="errqname">err:XS0025</code></a>) if the
expanded-QName value of the <tt class="tag-attribute">type</tt>
attribute is in no namespace or in the XProc namespace. Except as
described in <a href="#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>, the XProc namespace <span class="rfc2119">must
not</span> be used in the type of steps. Neither users nor
implementers may define additional steps in the XProc
namespace.</p>
<p>Irrespective of the context in which the <tt class=
"tag-element">p:declare-step</tt> occurs, there are initially no
option or variable names in-scope inside a <tt class=
"tag-element">p:declare-step</tt>. That is, <a href=
"#p.option"><tt class="tag-element">p:option</tt></a> and <a href=
"#p.variable"><tt class="tag-element">p:variable</tt></a> elements
can refer to values declared by their preceding siblings, but not
by any of their ancestors.</p>
<p><a name="impl-37" id="impl-37"></a>When a declared step is
evaluated directly by the XProc processor (as opposed to occurring
as an atomic step in some <em class="glossterm"><a href=
"#dt-container">container</a></em>), how the input and output ports
are connected to documents is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>A step declaration is not a <a href="#step-concept">step</a> in
its own right. Sibling steps cannot refer to the inputs or outputs
of a <tt class="tag-element">p:declare-step</tt> using <a href=
"#p.pipe"><tt class="tag-element">p:pipe</tt></a>; only instances
of the type can be referenced.</p>
<p>The <tt class="tag-attribute">version</tt> attribute identifies
the version of XProc for which this step declaration was authored.
If the <tt class="tag-element">p:declare-step</tt> has no ancestors
in the XProc namespace, then it <span class="rfc2119">must</span>
have a <tt class="tag-attribute">version</tt> attribute. See
<a href="#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>.</p>
<p>For a description of <tt class=
"tag-attribute">psvi-required</tt>, see <a href="#psvi-support"
title="PSVIs in XProc">Section&#160;2.8, “PSVIs in XProc”</a>. For
<tt class="tag-attribute">xpath-version</tt>, see <a href=
"#xpath-context" title="XPaths in XProc">Section&#160;2.6, “XPaths
in XProc”</a>. For <tt class=
"tag-attribute">exclude-inline-prefixes</tt>, see <a href=
"#p.inline"><tt class="tag-element">p:inline</tt></a>.</p>
<div class="section">
<h5><a name="declare-atomic-steps" id=
"declare-atomic-steps"></a>5.8.1&#160;Declaring atomic steps</h5>
<p>When declaring an atomic step, the subpipeline in the
declaration <span class="rfc2119">must</span> be empty. And,
conversely, if the subpipeline in a declaration is empty, the
declaration <span class="rfc2119">must</span> be for an atomic
step.</p>
<p><a name="impl-38" id="impl-38"></a>Implementations may use
<em class="glossterm"><a href="#dt-extension-attribute">extension
attributes</a></em> to provide <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>
information about a declared step. For example, such an attribute
might identify the code which implements steps of this type.</p>
<p>It is not an error for a pipeline to include declarations for
steps that a particular processor does not know how to implement.
It is, of course, an error to attempt to evaluate such steps.</p>
<p>If <a href="#p.log"><tt class="tag-element">p:log</tt></a> or
<a href="#p.serialization"><tt class=
"tag-element">p:serialization</tt></a> elements appear in the
declaration of an atomic step, they will only be used if the atomic
step is directly evaluated by the processor. They have no effect if
the step appears in a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>; only the serialization
options of the “top level” step or pipeline are used because that
is the only step which the processor is required to serialize.</p>
</div>
<div class="section">
<h5><a name="declare-pipelines" id=
"declare-pipelines"></a>5.8.2&#160;Declaring pipelines</h5>
<p>When a <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> declares a pipeline, that
pipeline encapsulates the behavior of the specified <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>. Its
children declare inputs, outputs, and options that the pipeline
exposes and identify the steps in its subpipeline.</p>
<p><a name="impl-39" id="impl-39"></a>The subpipeline may include
declarations of additional steps (e.g., other pipelines or other
step types that are provided by a particular implementation or in
some <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> way)
and import other pipelines. If a pipeline has been imported, it may
be invoked as a step within the subpipeline that imported it.</p>
<p>The environment inherited by the <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em> is the <em class=
"glossterm"><a href="#dt-empty-environment">empty
environment</a></em> with these modifications:</p>
<div class="itemizedlist">
<ul>
<li>
<p>All of the declared inputs are added to the <em class=
"glossterm"><a href="#dt-readable-ports">readable ports</a></em> in
the environment.</p>
</li>
<li>
<p>If a <em class="glossterm"><a href=
"#dt-primary-input-port">primary input port</a></em> is declared,
that port is the <em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em>,
otherwise the default readable port is undefined.</p>
</li>
</ul>
</div>
<p>If a <em class="glossterm"><a href=
"#dt-primary-output-port">primary output port</a></em> is declared
and that port has no <em class="glossterm"><a href=
"#dt-connection">connection</a></em>, then it is connected to the
<em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em> of the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the <em class=
"glossterm"><a href="#dt-subpipeline">subpipeline</a></em>.
<a name="err.inline.S0006.2" id="err.inline.S0006.2"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0006"><code class=
"errqname">err:XS0006</code></a>) if the primary output port is
unconnected and the <em class="glossterm"><a href=
"#dt-last-step">last step</a></em> in the subpipeline does not have
a primary output port.</p>
<p>The requested <tt class="tag-attribute">xpath-version</tt>
<span class="rfc2119">must</span> be used to evaluate XPath
expressions subject to the constraints outlined in <a href=
"#xpath-context" title="XPaths in XProc">Section&#160;2.6, “XPaths
in XProc”</a>.</p>
<p>The <tt class="tag-attribute">psvi-required</tt> attribute
allows the author to declare that a step relies on the processor's
ability to pass PSVI annotations between steps, see <a href=
"#psvi-support" title="PSVIs in XProc">Section&#160;2.8, “PSVIs in
XProc”</a>. If the attribute is not specified, the value
<tt class="literal">false</tt>” is assumed.</p>
</div>
</div>
<div class="section">
<h4><a name="p.library" id="p.library"></a>5.9&#160;p:library</h4>
<p>A <tt class="tag-element">p:library</tt> is a collection of step
declarations and/or pipeline definitions.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:library<br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.import">p:import</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.pipeline">p:pipeline</a>)*<br />
&lt;/p:library&gt;</code></p>
<p>The <tt class="tag-attribute">version</tt> attribute identifies
the version of XProc for which this library was authored. If the
<tt class="tag-element">p:library</tt> has no ancestors in the
XProc namespace, then it <span class="rfc2119">must</span> have a
<tt class="tag-attribute">version</tt> attribute. See <a href=
"#versioning-considerations" title=
"Versioning Considerations">Section&#160;2.13, “Versioning
Considerations”</a>.</p>
<p>For a description of <tt class=
"tag-attribute">psvi-required</tt>, see <a href="#psvi-support"
title="PSVIs in XProc">Section&#160;2.8, “PSVIs in XProc”</a>; for
<tt class="tag-attribute">xpath-version</tt>, see <a href=
"#xpath-context" title="XPaths in XProc">Section&#160;2.6, “XPaths
in XProc”</a>; for <tt class=
"tag-attribute">exclude-inline-prefixes</tt>, see <a href=
"#p.inline"><tt class="tag-element">p:inline</tt></a>.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The steps declared in a pipeline library are referred to by
their type. It is not an error to put a <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a> or
<a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a> without a <tt class=
"tag-attribute">type</tt> in a <tt class=
"tag-element">p:library</tt>, but there is no standard mechanism
for instantiating it or referring to it. It is effectively
invisible.</p>
</div>
<p>Libraries can import pipelines and/or other libraries. See also
<a href="#handling-imports" title=
"Handling Circular and Re-entrant Library Imports (Non-Normative)">Appendix&#160;G,
<i>Handling Circular and Re-entrant Library Imports
(Non-Normative)</i></a>.</p>
</div>
<div class="section">
<h4><a name="p.import" id="p.import"></a>5.10&#160;p:import</h4>
<p>An <tt class="tag-element">p:import</tt> loads a pipeline or
pipeline library, making it available in the pipeline or library
which contains the <tt class="tag-element">p:import</tt>.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:import<br />
&#160;&#160;<strong>href</strong> =
<var>anyURI</var>&#160;/&gt;</code></p>
<p>An import statement loads the specified IRI and makes any
pipelines declared within it available to the current pipeline.</p>
<p><a name="err.inline.S0052" id="err.inline.S0052"></a>It is a
<em class="glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0052"><code class=
"errqname">err:XS0052</code></a>) if the URI of a <tt class=
"tag-element">p:import</tt> cannot be retrieved or if, once
retrieved, it does not point to a <a href="#p.library"><tt class=
"tag-element">p:library</tt></a>, <a href=
"#p.declare-step"><tt class="tag-element">p:declare-step</tt></a>,
or <a href="#p.pipeline"><tt class=
"tag-element">p:pipeline</tt></a>. <a name="err.inline.S0053" id=
"err.inline.S0053"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0053"><code class="errqname">err:XS0053</code></a>) to
import a single pipeline if that pipeline does not have a
<tt class="tag-attribute">type</tt>.</p>
<p>Attempts to retrieve the library identified by the URI value may
be redirected at the parser level (for example, in an entity
resolver) or below (at the protocol level, for example, via an HTTP
Location: header). In the absence of additional information outside
the scope of this specification within the resource, the base URI
of the library is always the URI of the actual resource returned.
In other words, it is the URI of the resource retrieved after all
redirection has occurred.</p>
<p>As imports are processed, a processor may encounter new
<tt class="tag-element">p:import</tt> elements whose library URI is
the same as one it has already processed in some other context.
This may happen as a consequence of resolving the URI. If the
actual base URI is the same as one that has already been processed,
the implementation must recognize it as the same library and should
not need to process the resource. Also, a duplicate, circular chain
of imports, or a re-entrant import is not an error and
implementations must take the necessary steps to avoid infinite
loops and/or incorrect notification of duplicate step definitions.
It is not an error for a library to import itself. An example of
such steps is listed in <a href="#handling-imports" title=
"Handling Circular and Re-entrant Library Imports (Non-Normative)">Appendix&#160;G,
<i>Handling Circular and Re-entrant Library Imports
(Non-Normative)</i></a>.</p>
<p>A library is considered the same library if the URI of the
resource retrieved is the same. If a pipeline or library author
uses two different URI values that resolve to the same resource,
they must not be considered the same imported library.</p>
</div>
<div class="section">
<h4><a name="p.pipe" id="p.pipe"></a>5.11&#160;p:pipe</h4>
<p>A <tt class="tag-element">p:pipe</tt> connects an input to a
port on another step.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipe<br />
&#160;&#160;<strong>step</strong> = <var>NCName</var><br />
&#160;&#160;<strong>port</strong> =
<var>NCName</var>&#160;/&gt;</code></p>
<p>The <tt class="tag-element">p:pipe</tt> element connects to a
readable port of another step. It identifies the readable port to
which it connects with the name of the step in the <tt class=
"tag-attribute">step</tt> attribute and the name of the port on
that step in the <tt class="tag-attribute">port</tt> attribute.</p>
<p><a name="err.inline.S0022" id="err.inline.S0022"></a>In all
cases except the <a href="#p.output"><tt class=
"tag-element">p:output</tt></a> of a <em class="glossterm"><a href=
"#dt-compound-step">compound step</a></em>, it is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0022"><code class=
"errqname">err:XS0022</code></a>) if the port identified by a
<tt class="tag-element">p:pipe</tt> is not in the <em class=
"glossterm"><a href="#dt-readable-ports">readable ports</a></em> of
the step that contains the <tt class="tag-element">p:pipe</tt>.</p>
<p>A <tt class="tag-element">p:pipe</tt> that is a <em class=
"glossterm"><a href="#dt-connection">connection</a></em> for an
<a href="#p.output"><tt class="tag-element">p:output</tt></a> of a
<em class="glossterm"><a href="#dt-compound-step">compound
step</a></em> may connect to one of the readable ports of the
compound step or to an output port on one of the compound step's
<em class="glossterm"><a href="#dt-contained-steps">contained
steps</a></em>. In other words, the output of a compound step can
simply be a copy of one of the available inputs or it can be the
output of one of its children.</p>
</div>
<div class="section">
<h4><a name="p.inline" id="p.inline"></a>5.12&#160;p:inline</h4>
<p>A <tt class="tag-element">p:inline</tt> provides a document
inline.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:inline<br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix
list</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>anyElement</var><br />
&lt;/p:inline&gt;</code></p>
<p>The content of the <tt class="tag-element">p:inline</tt> element
is wrapped in a document node and passed as input. The base URI of
the document is the base URI of the <tt class=
"tag-element">p:inline</tt> element. <a name="err.inline.S0024" id=
"err.inline.S0024"></a>It is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0024"><code class="errqname">err:XS0024</code></a>) if the
content of the <tt class="tag-element">p:inline</tt> element does
not consist of exactly one element, optionally preceded and/or
followed by any number of processing instructions, comments or
whitespace characters.</p>
<p>The in-scope namespaces of the inline document differ from the
in-scope namespace of the content of the <tt class=
"tag-element">p:inline</tt> element in that bindings for all its
<em>excluded namespaces</em>, as defined below, are removed:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The XProc namespace itself (<tt class=
"uri">http://www.w3.org/ns/xproc</tt>) is excluded.</p>
</li>
<li>
<p>A namespace URI designated by using an <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute on the
enclosing <tt class="tag-element">p:inline</tt> is excluded.</p>
</li>
<li>
<p>A namespace URI designated by using an <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute on any
ancestor <a href="#p.declare-step"><tt class=
"tag-element">p:declare-step</tt></a>, <a href=
"#p.pipeline"><tt class="tag-element">p:pipeline</tt></a>, or
<a href="#p.library"><tt class="tag-element">p:library</tt></a> is
also excluded. (In other words, the effect of several <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attributes among the
ancestors of <tt class="tag-element">p:inline</tt> is
cumulative.)</p>
</li>
</ul>
</div>
<p>The value of each <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute is
interpreted as follows:</p>
<p>The value of the attribute is either <tt class=
"literal">#all</tt>, or a whitespace-separated list of tokens, each
of which is either a namespace prefix or <tt class=
"literal">#default</tt>. The namespace bound to each of the
prefixes is designated as an excluded namespace. <a name=
"err.inline.S0057" id="err.inline.S0057"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0057"><code class=
"errqname">err:XS0057</code></a>) if the <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute does not
contain a list of tokens or if any of those tokens (except
<tt class="literal">#all</tt> or <tt class="literal">#default</tt>)
is not a prefix bound to a namespace in the in-scope namespaces of
the element on which it occurs.</p>
<p>The default namespace of the element on which <tt class=
"tag-attribute">exclude-inline-prefixes</tt> occurs may be
designated as an excluded namespace by including <tt class=
"literal">#default</tt> in the list of namespace prefixes. <a name=
"err.inline.S0058" id="err.inline.S0058"></a>It is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0058"><code class=
"errqname">err:XS0058</code></a>) if the value <tt class=
"literal">#default</tt> is used within the <tt class=
"tag-attribute">exclude-inline-prefixes</tt> attribute and there is
no default namespace in scope.</p>
<p>The value <tt class="literal">#all</tt> indicates that all
namespaces that are in scope for the element on which <tt class=
"tag-attribute">exclude-inline-prefixes</tt> occurs are designated
as excluded namespaces.</p>
<p>The XProc processor <span class="rfc2119">must</span> include
all in-scope prefixes that are not explicitly excluded. If the
namespace associated with an excluded prefix is used in the
expanded-QName of a descendant element or attribute, the processor
<span class="rfc2119">may</span> include that prefix anyway, or it
may generate a new prefix.</p>
<p>Consider this example:</p>
<div class="programlisting">
<pre>
&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
  &lt;p:output port="result"/&gt;
  &lt;p:serialization port="result" indent="true"/&gt;

  &lt;p:identity xmlns:a="http://example.com/a"
              xmlns:b="http://example.com/b"
              xmlns:c="http://example.com/c"&gt;
    &lt;p:input port="source"&gt;
      &lt;p:inline exclude-inline-prefixes="a b"&gt;
        &lt;doc&gt;
          &lt;b:part/&gt;
        &lt;/doc&gt;
      &lt;/p:inline&gt;
    &lt;/p:input&gt;
  &lt;/p:identity&gt;

&lt;/p:declare-step&gt;
</pre></div>
<p>which might produce a result like this:</p>
<div class="programlisting">
<pre>
&lt;doc xmlns:c="http://example.com/c"&gt;
   &lt;b:part xmlns:b="http://example.com/b"/&gt;
 &lt;/doc&gt;
</pre></div>
<p>The declaration for “<tt class="literal">c</tt>” must be present
because it was not excluded. The “<tt class="literal">part</tt>
element uses the namespace bound to “<tt class="literal">b</tt>”,
so <em>some</em> binding must be present. In this example, the
original prefix has been preserved, but it would be equally correct
if a different prefix had been used.</p>
</div>
<div class="section">
<h4><a name="p.document" id=
"p.document"></a>5.13&#160;p:document</h4>
<p>A <tt class="tag-element">p:document</tt> reads an XML document
from a URI.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:document<br />
&#160;&#160;<strong>href</strong> =
<var>anyURI</var>&#160;/&gt;</code></p>
<p>The document identified by the URI in the <tt class=
"tag-attribute">href</tt> attribute is loaded and returned. If the
URI protocol supports redirection, then redirects <span class=
"rfc2119">must</span> be followed.</p>
<p><a name="err.inline.D0011" id="err.inline.D0011"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0011"><code class=
"errqname">err:XD0011</code></a>) if the resource referenced by a
<tt class="tag-element">p:document</tt> element does not exist,
cannot be accessed, or is not a well-formed XML document.</p>
<p>The parser which the <tt class="tag-element">p:document</tt>
element employs <span class="rfc2119">must</span> process the
external subset; all general and external parsed entities
<span class="rfc2119">must</span> be fully expanded. It
<span class="rfc2119">may</span> perform <tt class=
"tag-attribute">xml:id</tt> processing, but it <span class=
"rfc2119">must not</span> perform any other processing, such as
expanding XIncludes. The parser <span class="rfc2119">must</span>
be conformant to <em class="citetitle">Namespaces in XML</em>.
Loading the document <span class="rfc2119">must not</span> fail due
to validation errors.</p>
<p>Use the <a href="#c.load"><tt class=
"tag-element">p:load</tt></a> step if you need to perform DTD-based
validation.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>A <tt class="tag-element">p:document</tt> always <em>reads</em>
from the specified IRI. In the context of a <a href=
"#p.input"><tt class="tag-element">p:input</tt></a>, this seems
perfectly natural. In the context of a <a href=
"#p.output"><tt class="tag-element">p:output</tt></a>, this may
seem a little asymmetrical. Putting a <tt class=
"tag-element">p:document</tt> in a <a href="#p.output"><tt class=
"tag-element">p:output</tt></a> causes the pipeline to
<em>read</em> from the specified IRI and provide that document
<em>as an output</em> on that port.</p>
<p>Use <a href="#c.store"><tt class="tag-element">p:store</tt></a>
to store the results that appear on a <a href=
"#p.output"><tt class="tag-element">p:output</tt></a>.</p>
</div>
</div>
<div class="section">
<h4><a name="p.data" id="p.data"></a>5.14&#160;p:data</h4>
<p>A <tt class="tag-element">p:data</tt> reads an arbitrary
resource from a URI.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:data<br />
&#160;&#160;<strong>href</strong> = <var>anyURI</var><br />
&#160;&#160;wrapper? = <var>QName</var><br />
&#160;&#160;wrapper-prefix? = <var>string</var><br />
&#160;&#160;wrapper-namespace? = <var>string</var><br />
&#160;&#160;content-type? = <var>string</var>&#160;/&gt;</code></p>
<p>The resource identified by the URI in the <tt class=
"tag-attribute">href</tt> attribute is loaded, encoded, wrapped in
the wrapper element, and returned as a document. If the URI
protocol supports redirection, then redirects <span class=
"rfc2119">must</span> be followed.</p>
<p>The value of the <tt class="tag-attribute">wrapper</tt>
attribute <span class="rfc2119">must</span> be a <tt class=
"type">QName</tt>. If the lexical value does not contain a colon,
then the <tt class="tag-attribute">wrapper-namespace</tt> may be
used to specify the namespace of the wrapper. In that case, the
<tt class="tag-attribute">wrapper-prefix</tt> may be specified to
suggest a prefix for the wrapper element. <a name=
"err.inline.D0034" id="err.inline.D0034"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0034"><code class=
"errqname">err:XD0034</code></a>) to specify a new namespace or
prefix if the lexical value of the specified name contains a colon
(or if no <tt class="tag-attribute">wrapper</tt> is explicitly
specified).</p>
<p>In other words, these two <tt class="tag-element">p:data</tt>
elements produce equivalent wrappers:</p>
<div class="programlisting">
<pre>
&lt;p:data href="..."
        xmlns:x="http://example.com/ns/"
        wrapper="x:wrap"/&gt;
&lt;p:data href="..."
        wrapper="wrap" wrapper-prefix="x"
        wrapper-namespace="http://example.com/ns/"/&gt;
</pre></div>
<p>but this <tt class="tag-element">p:data</tt> element will raise
an error:</p>
<div class="programlisting">
<pre>
&lt;p:data href="..."
        xmlns:x="http://example.com/ns/"
        wrapper="x:wrap" wrapper-prefix="x"
        wrapper-namespace="http://example.com/ns/"/&gt;
</pre></div>
<p>If no wrapper element is specified, the default is <tt class=
"tag-element">c:data</tt>:</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:data<br />
&#160;&#160;content-type? = <var>string</var><br />
&#160;&#160;charset? = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:data&gt;</code></p>
<p><a name="err.inline.D0029" id="err.inline.D0029"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.D0029"><code class=
"errqname">err:XD0029</code></a>) if the document referenced by a
<tt class="tag-element">p:data</tt> element does not exist, cannot
be accessed, or cannot be encoded as specified.</p>
<p>Exactly how the data is encoded depends on the media type of the
resource. If the resource has a content type associated with it
(e.g., if the resource was retrieved with HTTP), then that content
type <span class="rfc2119">must</span> be used, otherwise, if the
user specified a <tt class="tag-attribute">content-type</tt> on the
<tt class="tag-element">p:data</tt>, then that content type should
be assumed. <a name="impl-40" id="impl-40"></a>If no content type
was specified or is associated with the resource, the inferred
content type is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<div class="itemizedlist">
<ul>
<li>
<p>If the media type of the response is an XML media type or text
type with a <tt class="literal">charset</tt> parameter that is a
Unicode character encoding (per [<a href=
"#unicodetr17"><span class="abbrev">Unicode TR#17</span></a>]) or
is recognized as a non-XML media type whose contents are encoded as
a sequence of Unicode characters (e.g. it has a <tt class=
"literal">charset</tt> parameter or the definition of the media
type is such that it requires Unicode), the data <span class=
"rfc2119">must</span> be encoded as Unicode character sequence.</p>
</li>
<li>
<p>If the media type is not an appropriate text type, or if the
processor does not recognize the media type, the content is
base64-encoded.</p>
</li>
</ul>
</div>
<p>The resulting data is wrapped in an element with the name
specified in the <tt class="tag-attribute">wrapper</tt> attribute
(or <tt class="tag-element">c:data</tt> if no <tt class=
"tag-attribute">wrapper</tt> is specified).</p>
<p>Implementations <span class="rfc2119">should</span> add a
<tt class="tag-attribute">content-type</tt> attribute to the
wrapper element which indicates the specified or inferred media
type of the resource (including any parameters). If the content was
base64-encoded, the wrapper <span class="rfc2119">must</span> have
an <tt class="tag-attribute">encoding</tt> attribute which
specifies “<tt class="literal">base64</tt>”.</p>
<p>If an <tt class="tag-attribute">encoding</tt> is specified, a
<tt class="tag-attribute">charset</tt> may also be specified. The
character set may be specified as a parameter on the <tt class=
"tag-attribute">content-type</tt> or via the separate <tt class=
"tag-attribute">charset</tt> option. If it is specified in both
places, the values <span class="rfc2119">must</span> be
consistent.</p>
<p>If <tt class="tag-attribute">content-type</tt>, <tt class=
"tag-attribute">encoding</tt>, or <tt class=
"tag-attribute">charset</tt> attributes are specified on a
<tt class="tag-element">c:data</tt> wrapper, they <span class=
"rfc2119">must not</span> be in a namespace; if the user-specified
wrapper is not <tt class="tag-element">c:data</tt>, then the
attributes <span class="rfc2119">must</span> be in the <tt class=
"uri">http://www.w3.org/ns/xproc-step</tt> namespace.</p>
<p>Implementations may record additional details in <a href=
"#extension-attributes">extension attributes</a>.</p>
<p>For example, this <a href="#c.identity"><tt class=
"tag-element">p:identity</tt></a> step:</p>
<div class="programlisting">
<pre>
&lt;p:identity name="readcsv"&gt;
  &lt;p:input port="source"&gt;
    &lt;p:data href="stateabbr.csv"/&gt;
  &lt;/p:input&gt;
&lt;/p:identity&gt;
</pre></div>
<p>might produce output like this:</p>
<div class="programlisting">
<pre>
&lt;c:data xmlns:c="http://www.w3.org/2007/03/xproc-step"
        content-type="text/plain"&gt;
AL,Alabama
AK,Alaska
AZ,Arizona

&lt;/c:data&gt;
</pre></div>
<p>Whereas this pipeline fragment:</p>
<div class="programlisting">
<pre>
&lt;p:identity name="readpng"&gt;
  &lt;p:input port="source"&gt;
    &lt;p:data href="icon.png" content-type="image/png"/&gt;
  &lt;/p:input&gt;
&lt;/p:identity&gt;

&lt;p:add-attribute name="makeimg" match="img" attribute-name="src"&gt;
  &lt;p:input port="source"&gt;&lt;p:inline&gt;&lt;img/&gt;&lt;/p:inline&gt;&lt;/p:input&gt;
  &lt;p:with-option name="attribute-value"
                 select="concat('data:image/png;base64,',/*/node())"&gt;
    &lt;p:pipe step="readpng" port="result"/&gt;
  &lt;/p:with-option&gt;
&lt;/p:add-attribute&gt;
</pre></div>
<p>produces a single <tt class="tag-element">img</tt> element with
an inline graphic (represented using a <tt class=
"literal">data:</tt> URI):</p>
<div class="programlisting">
<pre>
&lt;img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
WXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QsEDycHOWjhgQAAAB10RVh0Q29tbWVudABDcmVhdGVk
IHdpdGggVGhlIEdJTVDvZCVuAAABjklEQVQ4y42Tv0tbcRTFz3t5kuQFwUVFEYIGU6q4mU0RlCDR
qYO2g4gdghUyKSFDwD/AwS2IoIMSHOLgpOLg4CIOWdy76GBoqQUJLlr66aCW6LuoF+7wvefcc3/w
vZLgpbe0wOoqn/Ro5TKRVIpLi6tkkpoFpFJUj48JSVI2y4LnBTm+D1paYqa5OQiGw5DN8nV7m1hv
L99f4o4Dk5Mc6Pwcd2yMXauL/n5+FAqsWdXjca5LJbokSXt7fOzu5toSaWsLxpqaIJcjr0ZbXGQh
HDaWZPjQEGc7O3jPBC4u8EZHOXkruaODPxsbDMuylRWSra3cviYwO0upMcdtfNRqGq/X5esVu7nR
BxMol4knEtTfGsH3+bu8zLdnydUqXjrN/nsWKEEiwdXmJp3/BYpFctFokOi6EIsF444DU1McSZLW
1+nq6eGnVWlkhNrcHBXXNUe5z+f5rEyGA8cxD+pufp7BYtH+yhL09fFbkYjd4vQ0W08jFgp8se7l
wY3gwAC/KhXanwROTwlNTHBocf8BTQe7F9dc2bMAAAAASUVORK5CYII="/&gt;
</pre></div>
<p>Some steps, such as <a href="#c.xquery"><tt class=
"tag-element">p:xquery</tt></a> and <a href=
"#c.validate-with-relax-ng"><tt class=
"tag-element">p:validate-with-relax-ng</tt></a>, are designed to
process non-XML inputs. If a base64-encoded input occurs in such a
context, it <span class="rfc2119">should</span> be decoded before
processing. In this way, for example, an XQuery document can be
read with <tt class="tag-element">p:data</tt> and passed to the
<a href="#c.xquery"><tt class="tag-element">p:xquery</tt></a> step
without regard to how the data was encoded.</p>
</div>
<div class="section">
<h4><a name="p.empty" id="p.empty"></a>5.15&#160;p:empty</h4>
<p>A <tt class="tag-element">p:empty</tt> connects to an <em class=
"glossterm"><a href="#dt-empty-sequence">empty sequence</a></em> of
documents.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:empty&#160;/&gt;</code></p>
</div>
<div class="section">
<h4><a name="p.documentation" id=
"p.documentation"></a>5.16&#160;p:documentation</h4>
<p>A <tt class="tag-element">p:documentation</tt> contains
human-readable documentation.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:documentation&gt;<br />
&#160;&#160;&#160;&#160;<var>any-well-formed-content</var>*<br />
&lt;/p:documentation&gt;</code></p>
<p>There are no constraints on the content of the <tt class=
"tag-element">p:documentation</tt> element. Documentation is
ignored by pipeline processors. See <a href="#documentation" title=
"Documentation">Section&#160;3.6, “Documentation”</a>.</p>
</div>
<div class="section">
<h4><a name="p.pipeinfo" id=
"p.pipeinfo"></a>5.17&#160;p:pipeinfo</h4>
<p>A <tt class="tag-element">p:pipeinfo</tt> contains ancillary
information for steps in the pipeline.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipeinfo&gt;<br />
&#160;&#160;&#160;&#160;<var>any-well-formed-content</var>*<br />
&lt;/p:pipeinfo&gt;</code></p>
<p>There are no constraints on the content of the <tt class=
"tag-element">p:pipeinfo</tt> element, see <a href="#annotations"
title="Processor annotations">Section&#160;3.7, “Processor
annotations”</a>.</p>
</div>
</div>
<div class="section">
<h3><a name="errors" id="errors"></a>6&#160;Errors</h3>
<p>Errors in a pipeline can be divided into two classes: static
errors and dynamic errors.</p>
<div class="section">
<h4><a name="static-errors" id="static-errors"></a>6.1&#160;Static
Errors</h4>
<p><span class="termdef" id="dt-static-error">[Definition: A
<em class="glossterm">static error</em> is one which can be
detected before pipeline evaluation is even attempted.]</span>
Examples of static errors include cycles and incorrect
specification of inputs and outputs.</p>
<p>Static errors are fatal and must be detected before any steps
are evaluated.</p>
<p>For a complete list of static errors, see <a href=
"#app.static-errors" title="Static Errors">Section&#160;E.1,
“Static Errors”</a>.</p>
</div>
<div class="section">
<h4><a name="dynamic-errors" id=
"dynamic-errors"></a>6.2&#160;Dynamic Errors</h4>
<p>A <span class="termdef" id="dt-dynamic-error">[Definition: A
<em class="glossterm">dynamic error</em> is one which occurs while
a pipeline is being evaluated.]</span> Examples of dynamic errors
include references to URIs that cannot be resolved, steps which
fail, and pipelines that exhaust the capacity of an implementation
(such as memory or disk space).</p>
<p>If a step fails due to a dynamic error, failure propagates
upwards until either a <a href="#p.try"><tt class=
"tag-element">p:try</tt></a> is encountered or the entire pipeline
fails. In other words, outside of a <a href="#p.try"><tt class=
"tag-element">p:try</tt></a>, step failure causes the entire
pipeline to fail.</p>
<p>For a complete list of dynamic errors, see <a href=
"#app.dynamic-errors" title="Dynamic Errors">Section&#160;E.2,
“Dynamic Errors”</a>.</p>
</div>
<div class="section">
<h4><a name="step-errors" id="step-errors"></a>6.3&#160;Step
Errors</h4>
<p>Several of the steps in the standard and option step library can
generate dynamic errors.</p>
<p>For a complete list of the dynamic errors raised by builtin
pipeline steps, see <a href="#app.step-errors" title=
"Step Errors">Section&#160;E.3, “Step Errors”</a>.</p>
</div>
</div>
<div class="section">
<h3><a name="std-components" id=
"std-components"></a>7&#160;Standard Step Library</h3>
<p>This section describes the standard XProc steps. A
machine-readable description of these steps may be found in
<a href="http://www.w3.org/2008/xproc-1.0.xpl">xproc-1.0.xpl</a>.</p>
<p>When a step in this library produces an output document, the
base URI of the output is the base URI of the step's primary input
document unless the step's process explicitly sets an <tt class=
"tag-attribute">xml:base</tt> attribute or the step's description
explicitly states how the base URI is constructed.</p>
<p id="cv.result">Also, in this section, several steps use this
element for result information:</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:result&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:result&gt;</code></p>
<p>When a step uses an XPath to compute an option value, the XPath
context is as defined in <a href="#xpath-context" title=
"XPaths in XProc">Section&#160;2.6, “XPaths in XProc”</a>.</p>
<p>When a step specifies a particular version of a technology,
implementations <span class="rfc2119">must</span> implement that
version or a subsequent version that is backwards compatible with
that version. At user-option, they may implement other
non-backwards compatible versions.</p>
<div class="section">
<h4><a name="std-required" id="std-required"></a>7.1&#160;Required
Steps</h4>
<p>This section describes standard steps that must be supported by
any conforming processor.</p>
<div class="section">
<h5><a name="c.add-attribute" id=
"c.add-attribute"></a>7.1.1&#160;p:add-attribute</h5>
<p>The <tt class="code">p:add-attribute</tt> step adds a single
attribute to a set of matching elements. The input document
specified on the <tt class="code">source</tt> is processed for
matches specified by the match pattern in the <tt class=
"option">match</tt> option. For each of these matches, the
attribute whose name is specified by the <tt class=
"option">attribute-name</tt> option is set to the attribute value
specified by the <tt class="option">attribute-value</tt>
option.</p>
<p>The resulting document is produced on the <tt class=
"code">result</tt> output port and consists of a exact copy of the
input with the exception of the matched elements. Each of the
matched elements is copied to the output with the addition of the
specified attribute with the specified value.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:add-attribute</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-name</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-value</code><code>"</code>
<code class="attr required-attr">required</code><code>="</code><code class="value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.1" id="err.inline.C0023.1"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if the match pattern does not
match an element.</p>
<p>The value of the <tt class="option">attribute-name</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">attribute-namespace</tt> may be used to specify the
namespace of the attribute. In that case, the <tt class=
"tag-attribute">attribute-prefix</tt> may be specified to suggest a
prefix for the attribute name. <a name="err.inline.D0034.1" id=
"err.inline.D0034.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon. The corresponding expanded name is
used to construct the attribute.</p>
<p>The value of the <tt class="option">attribute-value</tt> option
<span class="rfc2119">must</span> be a legal attribute value
according to XML.</p>
<p>If an attribute with the same name as the expanded name from the
<tt class="option">attribute-name</tt> option exists on the matched
element, the value specified in the <tt class=
"option">attribute-value</tt> option is used to set the value of
that existing attribute. That is, the value of the existing
attribute is changed to the <tt class="option">attribute-value</tt>
value.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>If multiple attributes need to be set on the same element(s),
the <a href="#c.set-attributes"><tt class=
"tag-element">p:set-attributes</tt></a> step can be used to set
them all at once.</p>
</div>
<p>This step cannot be used to add namespace declarations. <a name=
"err.inline.C0059" id="err.inline.C0059"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0059"><code class=
"errqname">err:XC0059</code></a>) if the QName value in the
<tt class="option">attribute-name</tt> option uses the prefix
<tt class="literal">xmlns</tt>” or any other prefix that resolves
to the namespace name “<tt class=
"uri">http://www.w3.org/2000/xmlns/</tt>”. Note, however, that
while namespace declarations cannot be added explicitly by this
step, adding an attribute whose name is in a namespace for which
there is no namespace declaration in scope on the matched element
may result in a namespace binding being added by <a href=
"#namespace-fixup" title=
"Namespace Fixup on Outputs">Section&#160;2.4.1, “Namespace Fixup
on Outputs”</a>.</p>
<p>If an attribute named <tt class="tag-attribute">xml:base</tt> is
added or changed, the base URI of the element <span class=
"rfc2119">must</span> also be amended accordingly.</p>
</div>
<div class="section">
<h5><a name="c.add-xml-base" id=
"c.add-xml-base"></a>7.1.2&#160;p:add-xml-base</h5>
<p>The <tt class="code">p:add-xml-base</tt> step exposes the base
URI via explicit <tt class="code">xml:base</tt> attributes. The
input document from the <tt class="port">source</tt> port is
replicated to the <tt class="port">result</tt> port with <tt class=
"code">xml:base</tt> attributes added to or corrected on each
element as specified by the options on this step.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:add-xml-base</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">all</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">relative</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">all</tt> option <span class=
"rfc2119">must</span> be a boolean.</p>
<p>The value of the <tt class="option">relative</tt> option
<span class="rfc2119">must</span> be a boolean.</p>
<p><a name="err.inline.C0058" id="err.inline.C0058"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0058"><code class=
"errqname">err:XC0058</code></a>) if the <tt class=
"option">all</tt> and <tt class="option">relative</tt> options are
<em>both</em> <tt class="literal">true</tt>.</p>
<p>The <tt class="tag-element">p:add-xml-base</tt> step modifies
its input as follows:</p>
<div class="itemizedlist">
<ul>
<li>
<p>For the document element: force the element to have an
<tt class="tag-attribute">xml:base</tt> attribute with the
document's [base URI] property's value as its value.</p>
</li>
<li>
<p>For other elements:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If the <tt class="option">all</tt> option has the value
<tt class="literal">true</tt>, force the element to have an
<tt class="tag-attribute">xml:base</tt> attribute with the
element's [base URI] value as its value.</p>
</li>
<li>
<p>If the element's [base URI] is different from the its parent's
[base URI], force the element to have an <tt class=
"tag-attribute">xml:base</tt> attribute with the following value:
if the value of the <tt class="option">relative</tt> option is
<tt class="literal">true</tt>, a string which, when resolved
against the parent's [base URI], will give the element's [base
URI], otherwise the element's [base URI].</p>
</li>
<li>
<p>Otherwise, if there is an <tt class=
"tag-attribute">xml:base</tt> attribute present, remove it.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
<div class="section">
<h5><a name="c.compare" id=
"c.compare"></a>7.1.3&#160;p:compare</h5>
<p>The <tt class="code">p:compare</tt> step compares two documents
for equality.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:compare</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">alternate</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fail-if-not-equal</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">fail-if-not-equal</tt>
option <span class="rfc2119">must</span> be a boolean.</p>
<p>This step takes single documents on each of two ports and
compares them using the <tt class="function">fn:deep-equal</tt> (as
defined in [<a href="#xpath-functions"><span class="abbrev">XPath
2.0 Functions and Operators</span></a>]). <a name=
"err.inline.C0019" id="err.inline.C0019"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0019"><code class=
"errqname">err:XC0019</code></a>) if the documents are not equal,
and the value of the <tt class="option">fail-if-not-equal</tt>
option is <tt class="literal">true</tt>. If the documents are
equal, or if the value of the <tt class=
"option">fail-if-not-equal</tt> option is <tt class=
"literal">false</tt>, a <a href="#cv.result"><tt class=
"tag-element">c:result</tt></a> document is produced with contents
<tt class="literal">true</tt> if the documents are equal, otherwise
<tt class="literal">false</tt>.</p>
</div>
<div class="section">
<h5><a name="c.count" id="c.count"></a>7.1.4&#160;p:count</h5>
<p>The <tt class="code">p:count</tt> step counts the number of
documents in the <tt class="code">source</tt> input sequence and
returns a single document on <tt class="code">result</tt>
containing that number. The generated document contains a single
<a href="#cv.result"><tt class="tag-element">c:result</tt></a>
element whose contents is the string representation of the number
of documents in the sequence.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:count</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">limit</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">0</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>If the <tt class="tag-attribute">limit</tt> option is specified
and is greater than zero, the <tt class="tag-element">p:count</tt>
step will count at most that many documents. This provides a
convenient mechanism to discover, for example, if a sequence
consists of more than 1 document, without requiring every single
document to be buffered before processing can continue.</p>
</div>
<div class="section">
<h5><a name="c.delete" id="c.delete"></a>7.1.5&#160;p:delete</h5>
<p>The <tt class="code">p:delete</tt> step deletes items specified
by a match pattern from the <tt class="code">source</tt> input
document and produces the resulting document, with the deleted
items removed, on the <tt class="port">result</tt> port.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:delete</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. A match
pattern may match multiple items to be deleted.</p>
<p>If an element is selected by the <tt class="option">match</tt>
option, the entire subtree rooted at that element is deleted.</p>
<p>This step cannot be used to remove namespaces. <a name=
"err.inline.C0062" id="err.inline.C0062"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0062"><code class=
"errqname">err:XC0062</code></a>) if the <tt class=
"option">match</tt> option matches a namespace node. Also, note
that deleting an attribute named <tt class=
"tag-attribute">xml:base</tt> does not change the base URI of the
element on which it occurred.</p>
</div>
<div class="section">
<h5><a name="c.directory-list" id=
"c.directory-list"></a>7.1.6&#160;p:directory-list</h5>
<p>The <tt class="code">p:directory-list</tt> step produces a list
of the contents of a specified directory.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:directory-list</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">path</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-filter</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">RegularExpression</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">exclude-filter</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">RegularExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">path</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It is interpreted as an IRI reference. If it is
relative, it is made absolute against the base URI of the element
on which it is specified (<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <tt class=
"tag-element">p:directory-list</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p><a name="err.inline.C0017" id="err.inline.C0017"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0017"><code class=
"errqname">err:XC0017</code></a>) if the absolute path does not
identify a directory. <a name="err.inline.C0012" id=
"err.inline.C0012"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0012"><code class="errqname">err:XC0012</code></a>) if the
contents of the directory path are not available to the step due to
access restrictions in the environment in which the pipeline is
run.</p>
<p><a name="impl-41" id="impl-41"></a>Conformant processors
<span class="rfc2119">must</span> support directory paths whose
scheme is <tt class="code">file</tt>. It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> what
other schemes are supported by <tt class=
"tag-element">p:directory-list</tt>, and what the interpretation of
'directory', 'file' and 'contents' is for those schemes.</p>
<p>If present, the value of the <tt class=
"option">include-filter</tt> or <tt class=
"option">exclude-filter</tt> option <span class=
"rfc2119">must</span> be a regular expression as specified in
[<a href="#xpath-functions"><span class="abbrev">XPath 2.0
Functions and Operators</span></a>], section 7.61 “<tt class=
"literal">Regular Expression Syntax</tt>”.</p>
<p>If the <tt class="option">include-filter</tt> pattern matches a
directory entry's name, the entry is included in the output. If the
<tt class="option">exclude-filter</tt> pattern matches a directory
entry's name, the entry is excluded in the output. If both options
are provided, the include filter is processed first, then the
exclude filter.</p>
<p id="cv.directory">The result document produced for the specified
directory path has a <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a> document element whose base URI
is the directory path and whose <tt class="tag-attribute">name</tt>
attribute is the last segment of the directory path (that is, the
directory's (local) name).</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:directory<br />
&#160;&#160;<strong>name</strong> = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.file">c:file</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.directory">c:directory</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.other">c:other</a>)*<br />
&lt;/c:directory&gt;</code></p>
<p>Its contents are determined as follows, based on the entries in
the directory identified by the directory path. For each entry in
the directory, if either no <tt class="option">filter</tt> was
specified, or the (local) name of the entry matches the filter
pattern, a <a href="#cv.file"><tt class=
"tag-element">c:file</tt></a>, a <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a>, or a <a href=
"#cv.other"><tt class="tag-element">c:other</tt></a> element is
produced, as follows:</p>
<div class="itemizedlist">
<ul>
<li>
<p>A <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a> is produced for each
subdirectory not determined to be special.</p>
</li>
<li>
<p id="cv.file">A <a href="#cv.file"><tt class=
"tag-element">c:file</tt></a> is produced for each file not
determined to be special.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:file<br />
&#160;&#160;<strong>name</strong> =
<var>string</var>&#160;/&gt;</code></p>
</li>
<li>
<p id="cv.other"><a name="impl-42" id="impl-42"></a>Any file or
directory determined to be special by the <tt class=
"tag-element">p:directory-list</tt> step may be output using a
<a href="#cv.other"><tt class="tag-element">c:other</tt></a>
element but the criteria for marking a file as special are
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:other<br />
&#160;&#160;<strong>name</strong> =
<var>string</var>&#160;/&gt;</code></p>
</li>
</ul>
</div>
<p>When a directory entry is a subdirectory, that directory's
entries are not output as part of that entry's <a href=
"#cv.directory"><tt class="tag-element">c:directory</tt></a>. A
user must apply this step again to the subdirectory to list
subdirectory contents.</p>
<p>Each of the elements <a href="#cv.file"><tt class=
"tag-element">c:file</tt></a>, <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a>, and <a href=
"#cv.other"><tt class="tag-element">c:other</tt></a> has a
<tt class="code">name</tt> attribute when it appears within the
top-level <a href="#cv.directory"><tt class=
"tag-element">c:directory</tt></a> element, whose value is a
relative IRI reference, giving the (local) file or directory
name.</p>
<p><a name="impl-43" id="impl-43"></a>Any attributes other than
<tt class="tag-attribute">name</tt> on <a href=
"#cv.file"><tt class="tag-element">c:file</tt></a>, <a href=
"#cv.directory"><tt class="tag-element">c:directory</tt></a>, or
<a href="#cv.other"><tt class="tag-element">c:other</tt></a> are
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</div>
<div class="section">
<h5><a name="c.error" id="c.error"></a>7.1.7&#160;p:error</h5>
<p>The <tt class="code">p:error</tt> step generates a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic error</a></em>
using the input provided to the step.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:error</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">code</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">code-namespace</tt> may be used to specify the
namespace of the code. In that case, the <tt class=
"tag-attribute">code-prefix</tt> may be specified to suggest a
prefix for the code. <a name="err.inline.D0034.2" id=
"err.inline.D0034.2"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>This step uses the document provided on its input as the content
of the error raised. An instance of the <a href=
"#cv.errors"><tt class="tag-element">c:errors</tt></a> element will
be produced on the error output port, as is always the case for
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
errors</a></em>. The error generated can be caught by a <a href=
"#p.try"><tt class="tag-element">p:try</tt></a> just like any other
dynamic error.</p>
<p>For authoring convenience, the <tt class=
"tag-element">p:error</tt> step is declared with a single, primary
output port. With respect to <em class="glossterm"><a href=
"#dt-connection">connections</a></em>, this port behaves like any
other output port even though nothing can ever appear on it since
the step always fails.</p>
<p>For example, given the following invocation:</p>
<div class="programlisting">
<pre>
&lt;p:error xmlns:my="http://www.example.org/error"
         name="bad-document" code="my:unk12"&gt;
   &lt;p:input port="source"&gt;
     &lt;p:inline&gt;
       &lt;message&gt;The document element is unknown.&lt;/message&gt;
     &lt;/p:inline&gt;
   &lt;/p:input&gt;
&lt;/p:error&gt;
</pre></div>
<p>The error vocabulary element (and document) generated on the
error output port would be:</p>
<div class="programlisting">
<pre>
&lt;c:errors xmlns:c="http://www.w3.org/ns/xproc-step"
          xmlns:p="http://www.w3.org/ns/xproc"
          xmlns:my="http://www.example.org/error"&gt;
 &lt;c:error name="bad-document" type="p:error"
          code="my:unk12"&gt;&lt;message&gt;The document element is unknown.&lt;/message&gt;
&lt;/c:error&gt;
&lt;/c:errors&gt;
</pre></div>
<p>The <tt class="tag-attribute">href</tt>, <tt class=
"tag-attribute">line</tt> and <tt class=
"tag-attribute">column</tt>, or <tt class=
"tag-attribute">offset</tt>, might also be present on the <a href=
"#cv.error"><tt class="tag-element">c:error</tt></a> to identify
the location of the <tt class="tag-element">p:error</tt> element in
the pipeline.</p>
</div>
<div class="section">
<h5><a name="c.escape-markup" id=
"c.escape-markup"></a>7.1.8&#160;p:escape-markup</h5>
<p>The <tt class="code">p:escape-markup</tt> step applies XML
serialization to the children of the document element and replaces
those children with their serialization. The outcome is a single
element with text content that represents the "escaped" syntax of
the children as they were serialized.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:escape-markup</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>This step supports the standard serialization options as
specified in <a href="#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>. These options control how the output markup is
produced before it is escaped.</p>
<p>For example, the input:</p>
<div class="programlisting">
<pre>
&lt;description&gt;
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;This is a chunk of XHTML.&lt;/p&gt;
&lt;/div&gt;
&lt;/description&gt;
</pre></div>
<p>produces:</p>
<div class="programlisting">
<pre>
&lt;description&gt;
&amp;lt;div xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;p&gt;This is a chunk of XHTML.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/description&gt;
</pre></div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The result of this step is an XML document that contains the
Unicode characters that are the characters that result from
escaping the input. It is not encoded characters in a serialized
octet stream, therefore, the serialization options related to
encoding characters (<tt class="option">byte-order-mark</tt>,
<tt class="option">encoding</tt>, and <tt class=
"option">normalization-form</tt>) do not apply. They are omitted
from the standard serialization options on this step.</p>
</div>
<p>By default, this step <span class="rfc2119">must not</span>
generate an XML declaration in the escaped result.</p>
</div>
<div class="section">
<h5><a name="c.filter" id="c.filter"></a>7.1.9&#160;p:filter</h5>
<p>The <tt class="code">p:filter</tt> step selects portions of the
source document based on a (possibly dynamically constructed) XPath
select expression.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:filter</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">select</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>This step behaves just like an <a href="#p.input"><tt class=
"tag-element">p:input</tt></a> with a <tt class=
"tag-attribute">select</tt> expression except that the select
expression is computed dynamically.</p>
</div>
<div class="section">
<h5><a name="c.http-request" id=
"c.http-request"></a>7.1.10&#160;p:http-request</h5>
<p>The <tt class="code">p:http-request</tt> step provides for
interaction with resources over HTTP or related protocols. The
input document provided on the <tt class="port">source</tt> port
specifies a request by a single <a href="#cv.request"><tt class=
"tag-element">c:request</tt></a> element. This element specifies
the method, resource, and other request properties as well as
possibly including an entity body (content) for the request.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:http-request</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The standard serialization options are provided to control the
serialization of any XML content which is sent as part of the
request. The effect of these options is as specified in <a href=
"#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>. See <a href="#c.request_body" title=
"Request Entity body conversion">Section&#160;7.1.10.2, “Request
Entity body conversion”</a> for a discussion of when serialization
occurs in constructing a request.</p>
<p><a name="err.inline.C0040" id="err.inline.C0040"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0040"><code class=
"errqname">err:XC0040</code></a>) if the document element of the
document that arrives on the <tt class="port">source</tt> port is
not <a href="#cv.request"><tt class=
"tag-element">c:request</tt></a>.</p>
<div class="section">
<h6><a name="cv.request" id=
"cv.request"></a>7.1.10.1&#160;Specifying a request</h6>
<p>An HTTP request is represented by a <tt class=
"tag-element">c:request</tt> element.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:request<br />
&#160;&#160;<strong>method</strong> = <var>NCName</var><br />
&#160;&#160;href? = <var>anyURI</var><br />
&#160;&#160;detailed? = <var>boolean</var><br />
&#160;&#160;status-only? = <var>boolean</var><br />
&#160;&#160;username? = <var>string</var><br />
&#160;&#160;password? = <var>string</var><br />
&#160;&#160;auth-method? = <var>string</var><br />
&#160;&#160;send-authorization? = <var>boolean</var><br />
&#160;&#160;override-content-type? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.header">c:header</a>*,<br />
&#160;&#160;&#160;&#160;&#160;(<a href=
"#cv.multipart">c:multipart</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.body">c:body</a>)?)<br />
&lt;/c:request&gt;</code></p>
<p><a name="err.inline.C0006" id="err.inline.C0006"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0006"><code class=
"errqname">err:XC0006</code></a>) if the <tt class=
"tag-attribute">method</tt> is not specified on a <tt class=
"tag-element">c:request</tt>. <a name="err.inline.C0005" id=
"err.inline.C0005"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0005"><code class="errqname">err:XC0005</code></a>) if the
request contains a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> or <a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> but the <tt class=
"tag-attribute">method</tt> does not allow for an entity body being
sent with the request.</p>
<p><a name="err.inline.C0004" id="err.inline.C0004"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0004"><code class=
"errqname">err:XC0004</code></a>) if the <tt class=
"code">status-only</tt> attribute has the value <tt class=
"literal">true</tt> and the <tt class="code">detailed</tt>
attribute does not have the value <tt class=
"literal">true</tt>.</p>
<p>The <tt class="code">method</tt> attribute specifies the method
to be used against the IRI specified by the <tt class=
"code">href</tt> attribute, e.g. <tt class="code">GET</tt> or
<tt class="code">POST</tt> (the value is not case-sensitive). If
the <tt class="code">href</tt> attribute is not absolute, it will
be resolved against the base URI of the element on which it is
occurs.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>In the case of simple “GET” requests, implementors are
encouraged to support as many protocols as practical. In
particular, pipeline authors may attempt to use <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
to load documents with computed URIs using the <tt class=
"literal">file:</tt> scheme.</p>
</div>
<p>If the <tt class="code">username</tt> attribute is specified,
the <tt class="code">username</tt>, <tt class="code">password</tt>,
<tt class="code">auth-method</tt>, and <tt class=
"code">send-authorization</tt> attributes are used to handle
authentication according to the selected authentication method.</p>
<p>For the purposes of avoiding an authentication challenge, if the
<tt class="code">send-authorization</tt> attribute has the value
<tt class="literal">true</tt> and the authentication method
specified by the <tt class="code">auth-method</tt> supports
generation of an <tt class="code">Authorization</tt> header without
a challenge, then an <tt class="code">Authorization</tt> header is
generated and sent on the first request. If the <tt class=
"code">send-authorization</tt> attribute is absent or has the value
<tt class="literal">false</tt>, then the first request is sent
without an <tt class="code">Authorization</tt> header.</p>
<p>If the initial response to the request is an authentication
challenge, the <tt class="code">auth-method</tt>, <tt class=
"code">username</tt>, <tt class="code">password</tt> and any
relevant data from the challenge are used to generate an <tt class=
"code">Authorization</tt> header and the request is sent again. If
that authorization fails, the request is not retried.</p>
<p>Appropriate values for the <tt class="code">auth-method</tt>
attribute are “Basic” or “Digest” but other values are allowed. If
the authentication method is “Basic” or “Digest”, authentication is
handled as per [<a href="#rfc2617"><span class="abbrev">RFC
2617</span></a>]. <a name="impl-44" id="impl-44"></a>The
interpretation of <tt class="code">auth-method</tt> values on
<tt class="tag-element">c:request</tt> other than “Basic” or
“Digest” is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p><a name="err.inline.C0003" id="err.inline.C0003"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0003"><code class=
"errqname">err:XC0003</code></a>) if a <tt class=
"option">username</tt> or <tt class="option">password</tt> is
specified without specifying an <tt class=
"option">auth-method</tt>, if the requested <tt class=
"option">auth-method</tt> isn't supported, or the authentication
challenge contains an authentication method that isn't supported.
All implementations are required to support "Basic" and "Digest"
authentication per [<a href="#rfc2617"><span class="abbrev">RFC
2617</span></a>].</p>
<p>The <tt class="code">c:header</tt> element specifies a header
name and value, either for inclusion in a request, or as received
in a response.</p>
<p class="element-syntax element-syntax-step-vocabulary" id=
"cv.header"><code>&lt;c:header<br />
&#160;&#160;<strong>name</strong> = <var>string</var><br />
&#160;&#160;<strong>value</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p>The request is formulated from the attribute values on the
<tt class="tag-element">c:request</tt> element and its <a href=
"#cv.header"><tt class="tag-element">c:header</tt></a> and <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a> or
<a href="#cv.body"><tt class="tag-element">c:body</tt></a>
children, if present, and transmitted to the host (and port, if
present) specified by the <tt class="code">href</tt> attribute. The
details of how the request entity body, if any, is constructed are
given in <a href="#c.response_body" title=
"Converting Response Entity Bodies">Section&#160;7.1.10.4,
“Converting Response Entity Bodies”</a>.</p>
<p>When the request is formulated, the step and/or protocol
implementation may add headers as necessary to either complete the
request or as appropriate for the content specified (e.g. transfer
encodings). A user of this step is guaranteed that their requested
headers and content will be sent with the exception of any
conflicts with protocol-related headers.</p>
<p>The <a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step allows users to specify
independently values that are not always independent. For example,
some combinations of <a href="#cv.header"><tt class=
"tag-element">c:header</tt></a> values (e.g., <tt class=
"literal">Content-Type</tt>) may be inconsistent with values that
the step and/or protocol implementation must set. In a few cases,
the step provides more than one mechanism to specify what is
actually a single value (e.g., the boundary string in multipart
messages). <a name="err.inline.C0020" id="err.inline.C0020"></a>It
is a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0020"><code class=
"errqname">err:XC0020</code></a>) if the the user specifies a value
or values that are inconsistent with each other or with the
requirements of the step or protocol.</p>
</div>
<div class="section">
<h6><a name="c.request_body" id=
"c.request_body"></a>7.1.10.2&#160;Request Entity body
conversion</h6>
<p>The <tt class="code">c:multipart</tt> element specifies a
multi-part body, per [<a href="#rfc1521"><span class="abbrev">RFC
1521</span></a>], either for inclusion in a request or as received
in a response.</p>
<p class="element-syntax element-syntax-step-vocabulary" id=
"cv.multipart"><code>&lt;c:multipart<br />
&#160;&#160;<strong>content-type</strong> = <var>string</var><br />
&#160;&#160;<strong>boundary</strong> = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.body">c:body</a>+<br />
&lt;/c:multipart&gt;</code></p>
<p>In the context of a request, the media type of the <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a>
<span class="rfc2119">must</span> be a multipart media type (i.e.
have a main type of 'multipart'). If the <tt class=
"code">content-type</tt> attribute is not specified, a value of
"multipart/mixed" will be assumed.</p>
<p>The <tt class="code">boundary</tt> attribute is required and is
used to provide a multipart boundary marker. The implementation
must use this boundary marker and must prefix the value with the
string “<tt class="literal">--</tt>” when formulating the multipart
message. <a name="err.inline.C0002" id="err.inline.C0002"></a>It is
a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0002"><code class=
"errqname">err:XC0002</code></a>) if the value starts with the
string “<tt class="literal">--</tt>”.</p>
<p>If the boundary is also specified as a parameter in the
<tt class="option">content-type</tt> option, then the parameter
value specified and the <tt class="option">boundary</tt> value
specified <span class="rfc2119">must</span> be the same. If the
boundary is specified in both the <tt class="option">boundary</tt>
option and the <tt class="option">content-type</tt> option then the
two values <span class="rfc2119">must</span> be the same.</p>
<p>The <a href="#cv.body"><tt class="tag-element">c:body</tt></a>
element holds the body or body part of the message. Each of the
attributes holds controls some aspect of the encoding the request
body or decoding the body element's content when the request is
formulated. These are specified as follows:</p>
<p class="element-syntax element-syntax-step-vocabulary" id=
"cv.body"><code>&lt;c:body<br />
&#160;&#160;<strong>content-type</strong> = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var><br />
&#160;&#160;id? = <var>string</var><br />
&#160;&#160;description? = <var>string</var><br />
&#160;&#160;disposition? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>anyElement</var>*<br />
&lt;/c:body&gt;</code></p>
<p>The <tt class="code">content-type</tt> attribute specifies the
media type of the body or body part, that is, the value of its
<tt class="code">Content-Type</tt> header. If the media type is not
an XML type or text, the content must already be
base64-encoded.</p>
<p>The <tt class="code">encoding</tt> attribute controls the
decoding of the element content for formulating the body. A value
of <tt class="literal">base64</tt> indicates the element's content
is a base64 encoded string whose byte stream should be sent as the
message body. <a name="impl-45" id="impl-45"></a>An implementation
may support encodings other than <tt class="literal">base64</tt>
but these encodings and their names are <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.
<a name="err.inline.C0052" id="err.inline.C0052"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0052"><code class=
"errqname">err:XC0052</code></a>) if the encoding specified is not
supported by the implementation.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The <a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step provides only a single
set of serialization options for XML media types. There's no direct
support for sending a multipart message with two XML parts encoded
differently.</p>
</div>
<p>For each body or body part, the <tt class="code">id</tt>
attribute specifies the value of the <tt class=
"code">Content-ID</tt> header; the <tt class=
"code">description</tt> attribute specifies the value of the
<tt class="code">Content-Description</tt> header; and the
<tt class="code">disposition</tt> attribute specifies the value of
the <tt class="code">Content-Disposition</tt> header.</p>
<p>If an entity body is to be sent as part of a request (e.g. a
<tt class="code">POST</tt>), either a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> element, specifying the request
entity body, or a <a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> element, specifying multiple
entity body parts, may be used. When <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a> is
used it may contain multiple <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> children. A <a href=
"#cv.body"><tt class="tag-element">c:body</tt></a> specifies the
construction of a body or body part as follows:</p>
<p>If the <tt class="code">content-type</tt> attribute does not
specify an XML media type, or the <tt class="code">encoding</tt>
attribute is “<tt class="literal">base64</tt>”, then <a name=
"err.inline.C0028" id="err.inline.C0028"></a>it is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0028"><code class=
"errqname">err:XC0028</code></a>) if the content of the <a href=
"#cv.body"><tt class="tag-element">c:body</tt></a> element does not
consist entirely of characters, and the entity body or body part
will consist of exactly those characters.</p>
<p>Otherwise (the <tt class="code">content-type</tt> attribute
<em>does</em> specify an XML media type and the <tt class=
"code">encoding</tt> attribute is <em>not</em> 'base64'), <a name=
"err.inline.C0022" id="err.inline.C0022"></a>it is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0022"><code class=
"errqname">err:XC0022</code></a>) if the content of the <a href=
"#cv.body"><tt class="tag-element">c:body</tt></a> element does not
consist of exactly one element, optionally preceded and/or followed
by any number of processing instructions, comments or whitespace
characters, and the entity body or body part will consist of the
serialization of a document node containing that content. The
serialization of that document is controlled by the serialization
options on the <tt class="code">p:http-request</tt> step
itself.</p>
<p>For example, the following input to a <tt class=
"code">p:http-request</tt> step will POST a small XML document:</p>
<div class="programlisting">
<pre>
&lt;c:request method="POST" href="http://example.com/someservice"&gt;
&lt;c:body xmlns:c="http://www.w3.org/ns/xproc-step" content-type="application/xml"&gt;
&lt;doc&gt;
&lt;title&gt;My document&lt;/title&gt;
&lt;/doc&gt;
&lt;/c:body&gt;
&lt;/c:request&gt;
</pre></div>
<p>The corresponding request should look something like this:</p>
<div class="programlisting">
<pre>
POST http://example.com/someservice HTTP/1.1
Host: example.com
Content-Type: application/xml; charset="utf-8"

&lt;?xml version='1.0'?&gt;
&lt;doc&gt;
&lt;title&gt;My document&lt;/title&gt;
&lt;/doc&gt;
</pre></div>
</div>
<div class="section">
<h6><a name="c.request_response" id=
"c.request_response"></a>7.1.10.3&#160;Managing the response</h6>
<p>The handling of the response to the request and the generation
of the step's result document is controlled by the <tt class=
"code">status-only</tt>, <tt class=
"code">override-content-type</tt> and <tt class=
"code">detailed</tt> attributes on the <a href=
"#cv.request"><tt class="tag-element">c:request</tt></a> input.</p>
<p>The <tt class="code">override-content-type</tt> attribute
controls interpretation of the response's <tt class=
"code">Content-Type</tt> header. If this attribute is present, the
response will be treated as if it returned the <tt class=
"code">Content-Type</tt> given by its value. This original
<tt class="code">Content-Type</tt> header will however be reflected
unchanged as a <a href="#cv.header"><tt class=
"tag-element">c:header</tt></a> in the result document. <a name=
"err.inline.C0030" id="err.inline.C0030"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0030"><code class=
"errqname">err:XC0030</code></a>) if the <tt class=
"code">override-content-type</tt> value cannot be used (e.g.
<tt class="code">text/plain</tt> to override <tt class=
"code">image/png</tt>).</p>
<p>If the <tt class="code">status-only</tt> attribute has the value
<tt class="literal">true</tt>, the result document will contain
only header information. The entity of the response will not be
processed to produce a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> or <a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> element.</p>
<p>The <a href="#c.response"><tt class=
"tag-element">c:response</tt></a> element represents an HTTP
response. The response's status code is encoded in the <tt class=
"code">status</tt> attribute and the headers and entity body are
processing into <a href="#cv.header"><tt class=
"tag-element">c:header</tt></a> and <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a> or
<a href="#cv.body"><tt class="tag-element">c:body</tt></a>
content.</p>
<p class="element-syntax element-syntax-step-vocabulary" id=
"c.response"><code>&lt;c:response<br />
&#160;&#160;status? = <var>integer</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.header">c:header</a>*,<br />
&#160;&#160;&#160;&#160;&#160;(<a href=
"#cv.multipart">c:multipart</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.body">c:body</a>)?)<br />
&lt;/c:response&gt;</code></p>
<p>The value of the <tt class="code">detailed</tt> attribute
determines the content of the result document. If it is <tt class=
"literal">true</tt>, the response to the request is handled as
follows:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>A single <a href="#c.response"><tt class=
"tag-element">c:response</tt></a> element is produced with the
<tt class="code">status</tt> attribute containing the status of the
response received.</p>
</li>
<li>
<p>Each response header is translated into a <a href=
"#cv.header"><tt class="tag-element">c:header</tt></a> element.</p>
</li>
<li>
<p>Unless the <tt class="code">status-only</tt> attribute has a
value <tt class="literal">true</tt>, the entity body of the
response is converted into a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> or <a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> element via the rules given in
<a href="#c.response_body" title=
"Converting Response Entity Bodies">Section&#160;7.1.10.4,
“Converting Response Entity Bodies”</a>.</p>
</li>
</ol>
</div>
<p>Otherwise (the <tt class="code">detailed</tt> attribute is not
specified or its value is <tt class="literal">false</tt>), the
response to the request is handled as follows:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>If the media type (as determined by the <tt class=
"code">override-content-type</tt> attribute or the <tt class=
"code">Content-Type</tt> response header) is an XML media type, the
entity is decoded if necessary, then parsed as an XML document and
produced on the <tt class="code">result</tt> output port as the
entire output of the step.</p>
</li>
<li>
<p>Otherwise, the entity body of the response is converted into a
<a href="#cv.body"><tt class="tag-element">c:body</tt></a> or
<a href="#cv.multipart"><tt class=
"tag-element">c:multipart</tt></a> element via the rules given in
<a href="#c.response_body" title=
"Converting Response Entity Bodies">Section&#160;7.1.10.4,
“Converting Response Entity Bodies”</a>.</p>
</li>
</ol>
</div>
<p>In either case the base URI of the output document is the
resolved value of the <tt class="code">href</tt> attribute from the
input <a href="#cv.request"><tt class=
"tag-element">c:request</tt></a>.</p>
<div class="section">
<h6><a name="redirects" id=
"redirects"></a>7.1.10.3.1&#160;Redirects</h6>
<p>One possible response from an HTTP request is a redirect,
indicated by a status code in the three-hundred range. The precise
semantics of the 3xx return codes are laid out by section
<em class="citetitle">10.3 Redirection 3xx</em> in [<a href=
"#rfc2616"><span class="abbrev">RFC 2616</span></a>].</p>
<p>The <a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step <span class=
"rfc2119">should</span> follow redirect requests (in a manner
consistent with [<a href="#rfc2616"><span class="abbrev">RFC
2616</span></a>]) if they are returned by the server.</p>
</div>
<div class="section">
<h6><a name="cookies" id="cookies"></a>7.1.10.3.2&#160;Cookies</h6>
<p>With one exception, in version 1.0 of XProc, the <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
step does not provide any standard mechanisms for managing cookies.
<a name="impl-46" id="impl-46"></a>Pipeline authors that need to
preserve cookies across several <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
calls in the same pipeline or across multiple invocations of the
same or different pipelines will have to rely on <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>
mechanisms.</p>
<p>The exception arises in the case of redirection. If a redirect
response includes cookies, those cookies <span class=
"rfc2119">should</span> be forwarded as appropriate to the
redirected location when the redirection is followed.</p>
<p>This behavior will allow the <a href=
"#c.http-request"><tt class="tag-element">p:http-request</tt></a>
step to interoperate with web services that use cookies as part of
an authentication protocol.</p>
</div>
</div>
<div class="section">
<h6><a name="c.response_body" id=
"c.response_body"></a>7.1.10.4&#160;Converting Response Entity
Bodies</h6>
<p>The entity of a response may be multipart per [<a href=
"#rfc1521"><span class="abbrev">RFC 1521</span></a>]. In those
situations, the result document will be a <a href=
"#cv.multipart"><tt class="tag-element">c:multipart</tt></a>
element that contains multiple <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> elements inside.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Although it is technically possible for any of the individual
parts of a multipart message to <em>also</em> be multipart, XProc
does not provide a standard representation for such messages.
<a name="impl-47" id="impl-47"></a>The interpretation of a
multipart message inside another multipart message is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</div>
<p>The result of the <a href="#c.http-request"><tt class=
"tag-element">p:http-request</tt></a> step is an XML document. For
media types (images, binaries, etc.) that can't be represented as a
sequence of Unicode characters, the response is encoded as
<tt class="literal">base64</tt> and then returned as text children
of the <a href="#cv.body"><tt class="tag-element">c:body</tt></a>
element. If the content is base64-encoded, the <tt class=
"tag-attribute">encoding</tt> attribute on <a href=
"#cv.body"><tt class="tag-element">c:body</tt></a> must be set to
<tt class="literal">base64</tt>”.</p>
<p>If the media type of the response is a text type with a
<tt class="code">charset</tt> parameter that is a Unicode character
encoding (per [<a href="#unicodetr17"><span class="abbrev">Unicode
TR#17</span></a>]) or is recognized as a non-XML media type whose
contents are encoded as a sequence of Unicode characters (e.g. it
has a character parameter or the definition of the media type is
such that it requires Unicode), the content of the constructed
<a href="#cv.body"><tt class="tag-element">c:body</tt></a> element
is the translation of the text into a sequence of Unicode
characters.</p>
<p>If the response is an XML media type, the content of the
constructed <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> element is the result of decoding the
body as necessary, then parsing it with an XML parser. If the
content is not well-formed, the step fails.</p>
<p>In a <a href="#cv.body"><tt class="tag-element">c:body</tt></a>
in a response, the <tt class="tag-attribute">content-type</tt>
attribute <span class="rfc2119">must</span> be an exact copy of the
value returned in the <tt class="literal">Content-Type</tt> header.
That is, it must reflect the content type actually returned, not
any override value that may have been specified, and it must
include any parameters returned by the server.</p>
<p>In the case of a multipart response, the same rules apply when
constructing a <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> element for each body part
encountered.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Given the above description, any content identified as
<tt class="code">text/html</tt> will be encoded as (escaped) text
or base64-encoded in the <a href="#cv.body"><tt class=
"tag-element">c:body</tt></a> element, as HTML isn't always
well-formed XML. A user can attempt to convert such content into
XML using the <a href="#c.unescape-markup"><tt class=
"tag-element">p:unescape-markup</tt></a> step.</p>
</div>
</div>
<div class="section">
<h6><a name="example-http-request" id=
"example-http-request"></a>7.1.10.5&#160;HTTP Request Example</h6>
<p>A simple form might be posted as follows:</p>
<div class="programlisting">
<pre>
&lt;c:request method="POST" href="http://www.example.com/form-action" xmlns:c="http://www.w3.org/ns/xproc-step"&gt;
&lt;c:body content-type="application/x-www-form-urlencoded"&gt;
name=W3C&amp;amp;spec=XProc
&lt;/c:body&gt;
&lt;/c:request&gt;
</pre></div>
<p>and if the response was an XHTML document, the result document
would be:</p>
<div class="programlisting">
<pre>
&lt;c:response status="200" xmlns:c="http://www.w3.org/ns/xproc-step"&gt;
&lt;c:header name="Date" value=" Wed, 09 May 2007 23:12:24 GMT"/&gt;
&lt;c:header name="Server" value="Apache/1.3.37 (Unix) PHP/4.4.5"/&gt;
&lt;c:header name="Vary" value="negotiate,accept"/&gt;
&lt;c:header name="TCN" value="choice"/&gt;
&lt;c:header name="P3P" value="policyref='http://www.w3.org/2001/05/P3P/p3p.xml'"/&gt;
&lt;c:header name="Cache-Control" value="max-age=600"/&gt;
&lt;c:header name="Expires" value="Wed, 09 May 2007 23:22:24 GMT"/&gt;
&lt;c:header name="Last-Modified" value="Tue, 08 May 2007 16:10:49 GMT"/&gt;
&lt;c:header name="ETag" value="'4640a109;42380ddc'"/&gt;
&lt;c:header name="Accept-Ranges" value="bytes"/&gt;
&lt;c:header name="Keep-Alive" value="timeout=2, max=100"/&gt;
&lt;c:header name="Connection" value="Keep-Alive"/&gt;
&lt;c:body content-type="application/xhtml+xml"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;&lt;title&gt;OK&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;&lt;p&gt;OK!&lt;/p&gt;&lt;/body&gt;
&lt;/html&gt;
&lt;/c:body&gt;
&lt;/c:response&gt;
</pre></div>
</div>
</div>
<div class="section">
<h5><a name="c.identity" id=
"c.identity"></a>7.1.11&#160;p:identity</h5>
<p>The <tt class="code">p:identity</tt> step makes a verbatim copy
of its input available on its output.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:identity</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>If the implementation supports passing PSVI annotations between
steps, the <tt class="tag-element">p:identity</tt> step
<span class="rfc2119">must</span> preserve any annotations that
appear in the input.</p>
</div>
<div class="section">
<h5><a name="c.insert" id="c.insert"></a>7.1.12&#160;p:insert</h5>
<p>The <tt class="code">p:insert</tt> step inserts the <tt class=
"code">insertion</tt> port's document into the <tt class=
"port">source</tt> port's document relative to the matching
elements in the <tt class="code">source</tt> port's document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:insert</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">insertion</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'/*'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">position</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"first-child"
| "last-child" | "before" | "after"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.2" id="err.inline.C0023.2"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that pattern matches anything
other than element, text, processing-instruction, or comment nodes.
Multiple matches are allowed, in which case multiple copies of the
<tt class="port">insertion</tt> documents will occur. If no
elements match, then the document is unchanged.</p>
<p>The value of the <tt class="option">position</tt> option
<span class="rfc2119">must</span> be an NMTOKEN in the following
list:</p>
<div class="itemizedlist">
<ul>
<li>
<p><tt class="literal">first-child</tt>” - the insertion is made
as the first child of the match;</p>
</li>
<li>
<p><tt class="literal">last-child</tt>” - the insertion is made as
the last child of the match;</p>
</li>
<li>
<p><tt class="literal">before</tt>” - the insertion is made as the
immediate preceding sibling of the match;</p>
</li>
<li>
<p><tt class="literal">after</tt>” - the insertion is made as the
immediate following sibling of the match.</p>
</li>
</ul>
</div>
<p><a name="err.inline.C0025" id="err.inline.C0025"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0025"><code class=
"errqname">err:XC0025</code></a>) if the match pattern matches
anything other than an element node and the value of the <tt class=
"option">position</tt> option is “<tt class=
"literal">first-child</tt>” or “<tt class=
"literal">last-child</tt>”.</p>
<p>As the inserted elements are part of the output of the step they
are not considered in determining matching elements. If an empty
sequence appears on the <tt class="port">insertion</tt> port, the
result will be the same as the source.</p>
</div>
<div class="section">
<h5><a name="c.label-elements" id=
"c.label-elements"></a>7.1.13&#160;p:label-elements</h5>
<p>The <tt class="code">p:label-elements</tt> step generates a
label for each matched element and stores that label in the
specified attribute.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:label-elements</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml:id'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">label</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'concat("_",$p:index)'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'*'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">replace</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">attribute</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">attribute-namespace</tt> may be used to specify the
namespace of the attribute name. In that case, the <tt class=
"tag-attribute">attribute-prefix</tt> may be specified to suggest a
prefix for the attribute name. <a name="err.inline.D0034.3" id=
"err.inline.D0034.3"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>The value of the <tt class="option">label</tt> option is an
XPath expression used to generate the value of the attribute
label.</p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.3" id="err.inline.C0023.3"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that expression matches
anything other than element nodes.</p>
<p>The value of the <tt class="option">replace</tt> <span class=
"rfc2119">must</span> be a boolean value and is used to indicate
whether existing attribute values are replaced.</p>
<p>This step operates by generating attribute labels for each
element matched. For every matched element, the expression is
evaluated with the context node set to the matched element. An
attribute is added to the matched element using the attribute name
is specified the <tt class="option">attribute</tt> option and the
string value of result of evaluating the expression. If the
attribute already exists on the matched element, the value is
replaced with the string value only if the <tt class=
"option">replace</tt> option has the value of <tt class=
"literal">true</tt>.</p>
<p>If this step is used to add or change the value of an attribute
named “<tt class="literal">xml:base</tt>”, the base URI of the
element <span class="rfc2119">must</span> also be amended
accordingly.</p>
<p>An implementation must bind the variable “<tt class=
"literal">p:index</tt>” in the static context of each evaluation of
the XPath expression to the position of the element in the sequence
of matched elements. In other words, the first element (in document
order) matched gets the value “<tt class="literal">1</tt>”, the
second gets the value “<tt class="literal">2</tt>”, the third,
<tt class="literal">3</tt>”, etc.</p>
<p>The result of the p:label-elements step is the input document
with the attribute labels associated with matched elements. All
other non-matching content remains the same.</p>
</div>
<div class="section">
<h5><a name="c.load" id="c.load"></a>7.1.14&#160;p:load</h5>
<p>The <tt class="code">p:load</tt> step has no inputs but produces
as its result an XML resource specified by an IRI.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:load</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-validate</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">href</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It is interpreted as an IRI reference. If it is
relative, it is made absolute against the base URI of the element
on which it is specified (<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <tt class=
"tag-element">p:load</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p>The value of the <tt class="option">dtd-validate</tt> option
<span class="rfc2119">must</span> be a boolean.</p>
<p>The <tt class="tag-element">p:load</tt> step is the same as
<a href="#p.document"><tt class="tag-element">p:document</tt></a>
with two additions:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>The URI to be accessed can be constructed dynamically by the
pipeline.</p>
</li>
<li>
<p>The <tt class="tag-element">p:load</tt> step has an option to
invoke DTD validation.</p>
</li>
</ol>
</div>
<p>When <tt class="option">dtd-validate</tt> is <tt class=
"literal">false</tt>, <tt class="tag-element">p:load</tt>
processing is the same as <a href="#p.document"><tt class=
"tag-element">p:document</tt></a> processing on the computed
<tt class="option">href</tt> value.</p>
<p>When <tt class="option">dtd-validate</tt> is <tt class=
"literal">true</tt>, <tt class="tag-element">p:load</tt> processing
is the same as <a href="#p.document"><tt class=
"tag-element">p:document</tt></a> processing on the computed
<tt class="option">href</tt> value but <span class=
"rfc2119">must</span> use a validating parser. <a name=
"err.inline.C0027" id="err.inline.C0027"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0027"><code class=
"errqname">err:XC0027</code></a>) if the document is not valid or
the step doesn't support DTD validation.</p>
<p>The retrieved document is produced on the <tt class=
"port">result</tt> port. The base URI of the result is the
(absolute) IRI used to retrieve it.</p>
</div>
<div class="section">
<h5><a name="c.make-absolute-uris" id=
"c.make-absolute-uris"></a>7.1.15&#160;p:make-absolute-uris</h5>
<p>The <tt class="code">p:make-absolute-uris</tt> step makes an
element or attribute's value in the source document an absolute IRI
value in the result document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:make-absolute-uris</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">base-uri</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.4" id="err.inline.C0023.4"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if the pattern matches anything
other than element or attribute nodes.</p>
<p>The value of the <tt class="option">base-uri</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It is interpreted as an IRI reference. If it is
relative, it is made absolute against the base URI of the element
on which it is specified (<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <tt class=
"tag-element">p:make-absolute-uris</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p>For every element or attribute in the input document which
matches the specified pattern, its XPath string-value is resolved
against the specified base URI and the resulting absolute IRI is
used as the matched node's entire contents in the output.</p>
<p>The base URI used for resolution defaults to the matched
attribute's element or the matched element's base URI unless the
<tt class="option">base-uri</tt> option is specified. When the
<tt class="option">base-uri</tt> option is specified, the option
value is used as the base URI regardless of any contextual base URI
value in the document. This option value is resolved against the
base URI of the <a href="#p.option"><tt class=
"tag-element">p:option</tt></a> element used to set the option.</p>
<p><a name="impl-48" id="impl-48"></a>If the IRI reference
specified by the <tt class="option">base-uri</tt> option on
<tt class="tag-element">p:make-absolute-uris</tt> is not valid, or
if it is absent and the input document has no base URI, the results
are <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</div>
<div class="section">
<h5><a name="c.namespace-rename" id=
"c.namespace-rename"></a>7.1.16&#160;p:namespace-rename</h5>
<p>The <tt class="code">p:namespace-rename</tt> step renames any
namespace declaration or use of a namespace in a document to a new
IRI value.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:namespace-rename</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">from</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">to</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">apply-to</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'all'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"all"
| "elements" | "attributes"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">from</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It <span class="rfc2119">should</span> be
either empty or absolute, but will not be resolved in any case.</p>
<p>The value of the <tt class="option">to</tt> option <span class=
"rfc2119">must</span> be an <tt class="type">anyURI</tt>. It
<span class="rfc2119">should</span> be empty or absolute, but will
not be resolved in any case.</p>
<p>The value of the <tt class="option">apply-to</tt> option
<span class="rfc2119">must</span> be one of “<tt class=
"literal">all</tt>”, “<tt class="literal">elements</tt>”, or
<tt class="literal">attributes</tt>”. If the value is “<tt class=
"literal">elements</tt>”, only elements will be renamed, if the
value is “<tt class="literal">attributes</tt>”, only attributes
will be renamed, if the value is “<tt class="literal">all</tt>”,
both elements and attributes will be renamed.</p>
<p><a name="err.inline.C0014" id="err.inline.C0014"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0014"><code class=
"errqname">err:XC0014</code></a>) if the XML namespace (<tt class=
"uri">http://www.w3.org/XML/1998/namespace</tt>) or the XMLNS
namespace (<tt class="uri">http://www.w3.org/2000/xmlns/</tt>) is
the value of either the <tt class="option">from</tt> option or the
<tt class="option">to</tt> option.</p>
<p>If the value of the <tt class="option">from</tt> option is the
same as the value of the <tt class="option">to</tt> option, the
input is reproduced unchanged on the output. Otherwise, namespace
bindings, namespace attributes and element and attribute names are
changed as follows:</p>
<div class="itemizedlist">
<ul>
<li>
<p>Namespace bindings: If the <tt class="option">from</tt> option
is present and its value is not the empty string, then every
binding of a prefix (or the default namespace) in the input
document whose value is the same as the value of the <tt class=
"option">from</tt> option is</p>
<div class="itemizedlist">
<ul>
<li>
<p>replaced in the output with a binding to the value of the
<tt class="option">to</tt> option, provided it is present and not
the empty string;</p>
</li>
<li>
<p>otherwise (the <tt class="option">to</tt> option is not
specified or has an empty string as its value) absent from the
output.</p>
</li>
</ul>
</div>
<p>If the <tt class="option">from</tt> option is absent, or its
value is the empty string, then no bindings are changed or
removed.</p>
</li>
<li>
<p>Elements and attributes: If the <tt class="option">from</tt>
option is present and its value is not the empty string, for every
element and attribute, as appropriate, in the input whose namespace
name is the same as the value of the <tt class="option">from</tt>
option, in the output its namespace name is</p>
<div class="itemizedlist">
<ul>
<li>
<p>replaced with the value of the <tt class="option">to</tt>
option, provided it is present and not the empty string;</p>
</li>
<li>
<p>otherwise (the <tt class="option">to</tt> option is not
specified or has an empty string as its value) changed to have no
value.</p>
</li>
</ul>
</div>
<p>If the <tt class="option">from</tt> option is absent, or its
value is the empty string, then for every element and attribute, as
appropriate, whose namespace name has no value, in the output its
namespace name is set to the value of the <tt class=
"option">to</tt> option.</p>
</li>
<li>
<p>Namespace attributes: If the <tt class="option">from</tt> option
is present and its value is not the empty string, for every
namespace attribute in the input whose value is the same as the
value of the <tt class="option">from</tt> option, in the output</p>
<div class="itemizedlist">
<ul>
<li>
<p>the namespace attribute's value is replaced with the value of
the <tt class="option">to</tt> option, provided it is present and
not the empty string;</p>
</li>
<li>
<p>otherwise (the <tt class="option">to</tt> option is not
specified or has an empty string as its value) the namespace
attribute is absent.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The <tt class="option">apply-to</tt> option is primarily
intended to make it possible to avoid renaming attributes when the
<tt class="option">from</tt> option specifies no namespace, since
many attributes are in no namespace.</p>
<p>Care should be taken when specifying no namespace with the
<tt class="option">to</tt> option. Prefixed names in content, for
example QNames and XPath expressions, may end up with no
appropriate namespace binding.</p>
</div>
</div>
<div class="section">
<h5><a name="c.pack" id="c.pack"></a>7.1.17&#160;p:pack</h5>
<p>The <tt class="code">p:pack</tt> step merges two document
sequences in a pair-wise fashion.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:pack</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">alternate</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">wrapper</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">wrapper-namespace</tt> may be used to specify the
namespace of the wrapper. In that case, the <tt class=
"tag-attribute">wrapper-prefix</tt> may be specified to suggest a
prefix for the wrapper element. <a name="err.inline.D0034.4" id=
"err.inline.D0034.4"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>The step takes each pair of documents, in order, one from the
<tt class="port">source</tt> port and one from the <tt class=
"port">alternate</tt> port, wraps them with a new element node
whose QName is the value specified in the <tt class=
"option">wrapper</tt> option, and writes that element to the
<tt class="port">result</tt> port as a document.</p>
<p>If the step reaches the end of one input sequence before the
other, then it simply wraps each of the remaining documents in the
longer sequence.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>In the common case, where the document element of a document in
the <tt class="port">result</tt> sequence has two element children,
any comments, processing instructions, or white space text nodes
that occur between them may have come from either of the input
documents; this step does not attempt to distinguish which one.</p>
</div>
</div>
<div class="section">
<h5><a name="c.parameters" id=
"c.parameters"></a>7.1.18&#160;p:parameters</h5>
<p>The <tt class="code">p:parameters</tt> step exposes a set of
parameters as a <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a> document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:parameters</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>Each parameter passed to the step is converted into a <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> element. The
step resolves duplicate parameters in the normal way (see <a href=
"#parameter-inputs" title="Parameter Inputs">Section&#160;5.1.2,
“Parameter Inputs”</a>) so at most one parameter with any given
name will appear in the result. The resulting <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> elements are
wrapped in a <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a> and the parameter set document
is written to the <tt class="port">result</tt> port. <a name=
"impl-49" id="impl-49"></a>The order in which <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> elements occur
in the <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a> is <em class=
"glossterm"><a href="#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p>For consistency and user convenience, if any of the parameters
have names that are in a namespace, the <tt class=
"tag-attribute">namespace</tt> attribute on the <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> element
<span class="rfc2119">must</span> be used. Each <tt class=
"tag-attribute">name</tt> <span class="rfc2119">must</span> be an
NCName.</p>
<p>The base URI of the output document is the URI of the pipeline
document that contains the step.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>Since the <tt class="port">parameters</tt> port is <em>not</em>
primary, any explicit <a href="#p.with-param"><tt class=
"tag-element">p:with-param</tt></a> settings <span class=
"rfc2119">must</span> include a <tt class="tag-attribute">port</tt>
attribute, per the last paragraph of <a href="#p.with-param" title=
"p:with-param">Section&#160;5.7.4, “p:with-param”</a>.</p>
</div>
</div>
<div class="section">
<h5><a name="c.rename" id="c.rename"></a>7.1.19&#160;p:rename</h5>
<p>The <tt class="code">p:rename</tt> step renames elements,
attributes, or processing-instruction targets in a document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:rename</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-name</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option must be an
XSLTMatchPattern. <a name="err.inline.C0023.5" id=
"err.inline.C0023.5"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0023"><code class="errqname">err:XC0023</code></a>) if the
pattern matches anything other than element, attribute or
processing instruction nodes.</p>
<p>The value of the <tt class="option">new-name</tt> option must be
a <tt class="type">QName</tt>. If the lexical value does not
contain a colon, then the <tt class=
"tag-attribute">new-namespace</tt> may be used to specify the
namespace of the new name. In that case, the <tt class=
"tag-attribute">new-prefix</tt> may be specified to suggest a
prefix for the new name. <a name="err.inline.D0034.5" id=
"err.inline.D0034.5"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>Each element, attribute, or processing-instruction in the input
matched by the match pattern specified in the <tt class=
"option">match</tt> option is renamed in the output to the name
specified by the <tt class="option">new-name</tt> option.</p>
<p>If the <tt class="option">match</tt> option matches an attribute
and if the element on which it occurs already has an attribute
whose expanded name is the same as the expanded name of the
specified <tt class="option">new-name</tt>, then the results is as
if the current attribute named “<em class="replaceable"><tt class=
"replaceable">new-name</tt></em>” was deleted before renaming the
matched attribute.</p>
<p>With respect to attributes named “<tt class=
"literal">xml:base</tt>”, the following semantics apply: renaming
an <em>from</em><tt class="literal">xml:base</tt><em>to</em>
something else has no effect on the underlying base URI of the
element; however, if an attribute is renamed <em>from</em>
something else <em>to</em><tt class="literal">xml:base</tt>”, the
base URI of the element <span class="rfc2119">must</span> also be
amended accordingly.</p>
<p>If the pattern matches processing instructions, then it is the
processing instruction target that is renamed. <a name=
"err.inline.C0013" id="err.inline.C0013"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0013"><code class=
"errqname">err:XC0013</code></a>) if the pattern matches a
processing instruction and the new name has a non-null
namespace.</p>
</div>
<div class="section">
<h5><a name="c.replace" id=
"c.replace"></a>7.1.20&#160;p:replace</h5>
<p>The <tt class="code">p:replace</tt> step replaces matching nodes
in its primary input with the document element of the <tt class=
"code">replacement</tt> port's document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:replace</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">replacement</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.6" id="err.inline.C0023.6"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that pattern matches anything
other than element, text, processing-instruction, or comment nodes.
Multiple matches are allowed, in which case multiple copies of the
<tt class="port">replacement</tt> document will occur.</p>
<p>Every node in the primary input matching the specified pattern
is replaced in the output is replaced by the document element of
the <tt class="port">replacement</tt> document. Only non-nested
matches are replaced. That is, once a node is replaced, its
descendants cannot be matched.</p>
</div>
<div class="section">
<h5><a name="c.set-attributes" id=
"c.set-attributes"></a>7.1.21&#160;p:set-attributes</h5>
<p>The <tt class="tag-element">p:set-attributes</tt> step sets
attributes on matching elements.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:set-attributes</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">attributes</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.7" id="err.inline.C0023.7"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that pattern matches anything
other than element nodes.</p>
<p>Each attribute on the document element of the document that
appears on the <tt class="port">attributes</tt> port is copied to
each element that matches the <tt class="option">match</tt>
expression.</p>
<p>If an attribute with the same name as one of the attributes to
be copied already exists, the value specified on the <tt class=
"port">attribute</tt> port's document is used. The result port of
this step produces a copy of the <tt class="port">source</tt>
port's document with the matching elements' attributes
modified.</p>
<p>The matching elements are specified by the match pattern in the
<tt class="option">match</tt> option. All matching elements are
processed. If no elements match, the step will not change any
elements.</p>
<p>This step must not copy namespace declarations. If the
attributes copied from the <tt class="port">attributes</tt> use
namespaces, prefixes, or prefixes bound to different namespaces,
the document produced on the <tt class="port">result</tt> output
port will require <a href="#namespace-fixup">namespace
fixup</a>.</p>
<p>If an attribute named <tt class="tag-attribute">xml:base</tt> is
added or changed, the base URI of the element <span class=
"rfc2119">must</span> also be amended accordingly.</p>
</div>
<div class="section">
<h5><a name="c.sink" id="c.sink"></a>7.1.22&#160;p:sink</h5>
<p>The <tt class="tag-element">p:sink</tt> step accepts a sequence
of documents and discards them. It has no output.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:sink</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
</div>
<div class="section">
<h5><a name="c.split-sequence" id=
"c.split-sequence"></a>7.1.23&#160;p:split-sequence</h5>
<p>The <tt class="tag-element">p:split-sequence</tt> step accepts a
sequence of documents and divides it into two sequences.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:split-sequence</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">matched</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">not-matched</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">initial-only</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">test</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">test</tt> option
<span class="rfc2119">must</span> be an XPathExpression.</p>
<p>The XPath expression in the <tt class="option">test</tt> option
is applied to each document in the input sequence. If the effective
boolean value of the expression is true, the document is copied to
the <tt class="port">matched</tt> port; otherwise it is copied to
the <tt class="port">not-matched</tt> port.</p>
<p>If the <tt class="option">initial-only</tt> option is true, then
when the first document that does not satisfy the test expression
is encountered, it <em>and all the documents that follow it</em>
are written to the <tt class="port">not-matched</tt> port. In other
words, it only writes the initial series of matched documents
(which may be empty) to the <tt class="port">matched</tt> port. All
other documents are written to the <tt class=
"port">not-matched</tt> port, irrespective of whether or not they
match.</p>
<p>The <a href="#xpath-context">XPath context</a> for the
<tt class="option">test</tt> option changes over time. For each
document that appears on the <tt class="code">source</tt> port, the
expression is evaluated with that document as the context document.
The context position (<tt class="code">position()</tt>) is the
position of that document within the sequence and the context size
(<tt class="code">last()</tt>) is the total number of documents in
the sequence.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>In principle, this component cannot stream because it must
buffer all of the input sequence in order to find the context size.
In practice, if the test expression does not use the <tt class=
"function">last()</tt> function, the implementation can stream and
ignore the context size.</p>
</div>
<p>If the implementation supports passing PSVI annotations between
steps, the <tt class="tag-element">p:split-sequence</tt> step
<span class="rfc2119">must</span> preserve any annotations that
appear in the input.</p>
</div>
<div class="section">
<h5><a name="c.store" id="c.store"></a>7.1.24&#160;p:store</h5>
<p>The <tt class="tag-element">p:store</tt> step stores a
serialized version of its input to a URI. This step outputs a
reference to the location of the stored document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:store</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">href</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. If it is relative, it is made absolute against
the base URI of the element on which it is specified (<a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a> or
<tt class="tag-element">p:store</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p>The step attempts to store the XML document to the specified
URI. <a name="err.inline.C0050" id="err.inline.C0050"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0050"><code class=
"errqname">err:XC0050</code></a>) if the URI scheme is not
supported or the step cannot store to the specified location.</p>
<p>The output of this step is a document containing a single
<a href="#cv.result"><tt class="tag-element">c:result</tt></a>
element whose content is the absolute URI of the document stored by
the step.</p>
<p>The standard serialization options are provided to control the
serialization of the XML content when it is stored. These options
are as specified in <a href="#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>.</p>
</div>
<div class="section">
<h5><a name="c.string-replace" id=
"c.string-replace"></a>7.1.25&#160;p:string-replace</h5>
<p>The <tt class="tag-element">p:string-replace</tt> step matches
nodes in the document provided on the <tt class="port">source</tt>
port and replaces them with the string result of evaluating an
XPath expression.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:string-replace</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">replace</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern.</p>
<p>The value of the <tt class="option">replace</tt> option
<span class="rfc2119">must</span> be an XPathExpression.</p>
<p>The matched nodes are specified with the match pattern in the
<tt class="option">match</tt> option. For each matching node, the
XPath expression provided by the <tt class="option">replace</tt>
option is evaluated with the matching node as the XPath context
node. The string value of the result is used in the output. Nodes
that do not match are copied without change.</p>
<p>If the expression given in the <tt class="option">match</tt>
option matches an <em>attribute</em>, the string value of the
<tt class="option">replace</tt> expression is used as the new value
of the attribute in the output. If the attribute is named
<tt class="tag-attribute">xml:base</tt>”, the base URI of the
element <span class="rfc2119">must</span> also be amended
accordingly.</p>
<p>If the expression matches any other kind of node, the entire
node (and <em>not</em> just its contents) is replaced by the string
value of the <tt class="option">replace</tt> expression.</p>
</div>
<div class="section">
<h5><a name="c.unescape-markup" id=
"c.unescape-markup"></a>7.1.26&#160;p:unescape-markup</h5>
<p>The <tt class="tag-element">p:unescape-markup</tt> step takes
the string value of the document element and parses the content as
if it was a Unicode character stream containing serialized XML. The
output consists of the same document element with children that
result from the parse. This is the reverse of the <a href=
"#c.escape-markup"><tt class="tag-element">p:escape-markup</tt></a>
step.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:unescape-markup</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">content-type</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'application/xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">charset</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">namespace</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. It <span class="rfc2119">should</span> be
absolute, but will not be resolved.</p>
<p>When the string value is parsed, the original document element
is preserved so that the result will be well-formed XML even if the
content consists of multiple, sibling elements.</p>
<p>The <tt class="option">namespace</tt> option specifies a default
namespace. Elements that are in no namespace in the unescaped
content will be placed into this namespace unless there is an
in-scope namespace declaration that specifies a different namespace
(or explicitly undeclares the default namespace).</p>
<p>The <tt class="option">content-type</tt> option <span class=
"rfc2119">may</span> be used to specify an alternate content type
for the string value. An implementation <span class=
"rfc2119">may</span> use a different parser to produce XML content
depending on the specified content-type. For example, an
implementation might provide an HTML to XHTML parser (e.g.
[<a href="#tidy"><span class="abbrev">HTML Tidy</span></a>] or
[<a href="#tagsoup"><span class="abbrev">TagSoup</span></a>]) for
the content type '<tt class="literal">text/html</tt>'.</p>
<p>All implementations <span class="rfc2119">must</span> support
the content type <tt class="literal">application/xml</tt>, and must
use a standard XML parser for it. <a name="err.inline.C0051" id=
"err.inline.C0051"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0051"><code class="errqname">err:XC0051</code></a>) if the
content-type specified is not supported by the implementation.
<a name="impl-50" id="impl-50"></a>Behavior of <tt class=
"tag-element">p:unescape-markup</tt> for <tt class=
"option">content-type</tt>s other than <tt class=
"literal">application/xml</tt> is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>The <tt class="option">encoding</tt> option specifies how the
data is encoded. All implementations <span class=
"rfc2119">must</span> support the <tt class="literal">base64</tt>
encoding (and the absence of an encoding option, which implies that
the content is plain Unicode text). <a name="err.inline.C0052.1"
id="err.inline.C0052.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0052"><code class="errqname">err:XC0052</code></a>) if the
encoding specified is not supported by the implementation.</p>
<p>If an <tt class="option">encoding</tt> is specified, a
<tt class="option">charset</tt> may also be specified. The
character set may be specified as a parameter on the <tt class=
"option">content-type</tt> or via the separate <tt class=
"option">charset</tt> option. If it is specified in both places,
the value of the <tt class="option">charset</tt> option
<span class="rfc2119">must</span> be used.</p>
<p>If the specified <tt class="option">encoding</tt> is <tt class=
"literal">base64</tt>, then the character set <span class=
"rfc2119">must</span> be specified. <a name="err.inline.C0010" id=
"err.inline.C0010"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0010"><code class="errqname">err:XC0010</code></a>) if an
encoding of <tt class="literal">base64</tt> is specified and the
character set is not specified or if the specified character set is
not supported by the implementation.</p>
<p>The octet-stream that results from decoding the text
<span class="rfc2119">must</span> be interpreted using the
character encoding named by the value of the <tt class=
"option">charset</tt> option to produce a sequence of Unicode
characters to parse.</p>
<p>If no <tt class="option">encoding</tt> is specified, the
character set is ignored, irrespective of where it was
specified.</p>
<p>For example, with the 'namespace' option set to the XHTML
namespace, the following input:</p>
<div class="programlisting">
<pre>
&lt;description&gt;
&amp;lt;p&gt;This is a chunk.&amp;lt;/p&gt;
&amp;lt;p&gt;This is a another chunk.&amp;lt;/p&gt;
&lt;/description&gt;
</pre></div>
<p>would produce:</p>
<div class="programlisting">
<pre>
&lt;description&gt;
&lt;p xmlns="http://www.w3.org/1999/xhtml"&gt;This is a chunk.&lt;/p&gt;
&lt;p xmlns="http://www.w3.org/1999/xhtml"&gt;This is a another chunk.&lt;/p&gt;
&lt;/description&gt;
</pre></div>
</div>
<div class="section">
<h5><a name="c.unwrap" id="c.unwrap"></a>7.1.27&#160;p:unwrap</h5>
<p>The <tt class="tag-element">p:unwrap</tt> step replaces matched
elements with their children.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:unwrap</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.8" id="err.inline.C0023.8"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if that pattern matches anything
other than element nodes.</p>
<p>Every element in the <tt class="port">source</tt> document that
matches the specified <tt class="option">match</tt> pattern is
replaced by its children, effectively “unwrapping” the children
from their parent. Non-element nodes and unmatched elements are
passed through unchanged.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The matching applies to the entire document, not just the
“top-most” matches. A pattern of the form <tt class=
"literal">h:div</tt> will replace <em>all</em> <tt class=
"tag-element">h:div</tt> elements, not just the top-most ones.</p>
</div>
<p>This step produces a single document; if the document element is
unwrapped, the result might not be well-formed XML.</p>
</div>
<div class="section">
<h5><a name="c.wrap" id="c.wrap"></a>7.1.28&#160;p:wrap</h5>
<p>The <tt class="tag-element">p:wrap</tt> step wraps matching
nodes in the <tt class="port">source</tt> document with a new
parent element.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:wrap</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">group-adjacent</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">wrapper</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">wrapper-namespace</tt> may be used to specify the
namespace of the wrapper. In that case, the <tt class=
"tag-attribute">wrapper-prefix</tt> may be specified to suggest a
prefix for the wrapper element. <a name="err.inline.D0034.6" id=
"err.inline.D0034.6"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>The value of the <tt class="option">match</tt> option
<span class="rfc2119">must</span> be an XSLTMatchPattern. <a name=
"err.inline.C0023.9" id="err.inline.C0023.9"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0023"><code class=
"errqname">err:XC0023</code></a>) if the pattern matches anything
other than document, element, text, processing instruction, and
comment nodes.</p>
<p>The value of the <tt class="option">group-adjacent</tt> option
<span class="rfc2119">must</span> be an XPathExpression.</p>
<p>If the node matched is the document node (<tt class=
"code">match="/"</tt>), the result is a new document where the
document element is a new element node whose QName is the value
specified in the <tt class="option">wrapper</tt> option. That new
element contains copies of all of the children of the original
document node.</p>
<p>When the match pattern does not match the document node, every
node that matches the specified <tt class="option">match</tt>
pattern is replaced with a new element node whose QName is the
value specified in the <tt class="option">wrapper</tt> option. The
content of that new element is a copy of the original, matching
node. The <tt class="tag-element">p:wrap</tt> step performs a
"deep" wrapping, the children of the matching node and their
descendants are processed and wrappers are added to all matching
nodes.</p>
<p>The <tt class="option">group-adjacent</tt> option can be used to
group adjacent matching nodes in a single wrapper element. The
specified XPath expression is evaluated for each matching node with
that node as the XPath context node. Whenever two or more adjacent
matching nodes have the same “group adjacent” value, they are
wrapped together in a single wrapper element.</p>
<p>Two matching nodes are considered adjacent if and only if they
are siblings and either there are no nodes between them or all
intervening, non-matching nodes are whitespace text, comment, or
processing instruction nodes.</p>
</div>
<div class="section">
<h5><a name="c.wrap-sequence" id=
"c.wrap-sequence"></a>7.1.29&#160;p:wrap-sequence</h5>
<p>The <tt class="tag-element">p:wrap-sequence</tt> step accepts a
sequence of documents and produces either a single document or a
new sequence of documents.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:wrap-sequence</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">group-adjacent</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">wrapper</tt> option
<span class="rfc2119">must</span> be a <tt class="type">QName</tt>.
If the lexical value does not contain a colon, then the <tt class=
"tag-attribute">wrapper-namespace</tt> may be used to specify the
namespace of the wrapper. In that case, the <tt class=
"tag-attribute">wrapper-prefix</tt> may be specified to suggest a
prefix for the wrapper element. <a name="err.inline.D0034.7" id=
"err.inline.D0034.7"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0034"><code class="errqname">err:XD0034</code></a>) to
specify a new namespace or prefix if the lexical value of the
specified name contains a colon.</p>
<p>The value of the <tt class="option">group-adjacent</tt> option
<span class="rfc2119">must</span> be an XPathExpression.</p>
<p>In its simplest form, <tt class=
"tag-element">p:wrap-sequence</tt> takes a sequence of documents
and produces a single, new document by placing each document in the
<tt class="port">source</tt> sequence inside a new document element
as sequential siblings. The name of the document element is the
value specified in the <tt class="option">wrapper</tt> option.</p>
<p>The <tt class="option">group-adjacent</tt> option can be used to
group adjacent documents. The <a href="#xpath-context">XPath
context</a> for the <tt class="option">group-adjacent</tt> option
changes over time. For each document that appears on the <tt class=
"code">source</tt> port, the expression is evaluated with that
document as the context document. The context position (<tt class=
"code">position()</tt>) is the position of that document within the
sequence and the context size (<tt class="code">last()</tt>) is the
total number of documents in the sequence. Whenever two or more
sequentially adjacent documents have the same “group adjacent”
value, they are wrapped together in a single wrapper element.</p>
</div>
<div class="section">
<h5><a name="c.xinclude" id=
"c.xinclude"></a>7.1.30&#160;p:xinclude</h5>
<p>The <tt class="tag-element">p:xinclude</tt> step applies
[<a href="#xinclude"><span class="abbrev">XInclude</span></a>]
processing to the <tt class="port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xinclude</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fixup-xml-base</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fixup-xml-lang</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">fixup-xml-base</tt> option
<span class="rfc2119">must</span> be a boolean. If it is true, base
URI fixup will be performed as per [<a href=
"#xinclude"><span class="abbrev">XInclude</span></a>].</p>
<p>The value of the <tt class="option">fixup-xml-lang</tt> option
<span class="rfc2119">must</span> be a boolean. If it is true,
language fixup will be performed as per [<a href=
"#xinclude"><span class="abbrev">XInclude</span></a>].</p>
<p>The included documents are located with the base URI of the
input document and are not provided as input to the step.</p>
<p><a name="err.inline.C0029" id="err.inline.C0029"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0029"><code class=
"errqname">err:XC0029</code></a>) if an XInclude error occurs
during processing.</p>
</div>
<div class="section">
<h5><a name="c.xslt" id="c.xslt"></a>7.1.31&#160;p:xslt</h5>
<p>The <tt class="tag-element">p:xslt</tt> step applies an
[<a href="#xslt10"><span class="abbrev">XSLT 1.0</span></a>] or
[<a href="#xslt20"><span class="abbrev">XSLT 2.0</span></a>]
stylesheet to a document.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xslt</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">stylesheet</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">secondary</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">initial-mode</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">template-name</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">output-base-uri</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>If present, the value of the <tt class=
"option">initial-mode</tt> option <span class="rfc2119">must</span>
be a <tt class="type">QName</tt>.</p>
<p>If present, the value of the <tt class=
"option">template-name</tt> option <span class=
"rfc2119">must</span> be a <tt class="type">QName</tt>.</p>
<p>If present, the value of the <tt class=
"option">output-base-uri</tt> option <span class=
"rfc2119">must</span> be an <tt class="type">anyURI</tt>. If it is
relative, it is made absolute against the base URI of the element
on which it is specified (<a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> or <tt class=
"tag-element">p:xslt</tt> in the case of a <a href=
"#option-shortcut">syntactic shortcut</a> value).</p>
<p>If the step specifies a <tt class="option">version</tt>, then
that version of XSLT <span class="rfc2119">must</span> be used to
process the transformation. <a name="err.inline.C0038" id=
"err.inline.C0038"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0038"><code class="errqname">err:XC0038</code></a>) if the
specified version of XSLT is not available. If the step does not
specify a version, the implementation may use any version it has
available and may use any means to determine what version to use,
including, but not limited to, examining the version of the
stylesheet.</p>
<p>The XSLT stylesheet provided on the <tt class=
"port">stylesheet</tt> port is applied to the document on the
<tt class="port">source</tt> port. Any parameters passed on the
<tt class="port">parameters</tt> port are used to define top-level
stylesheet parameters. The primary result document of the
transformation appears on the <tt class="port">result</tt> port.
All other result documents appear on the <tt class=
"port">secondary</tt> port. If XSLT 1.0 is used, an empty sequence
of documents <span class="rfc2119">must</span> appear on the
<tt class="port">secondary</tt> port.</p>
<p>If a sequence of documents is provided on the <tt class=
"port">source</tt> port, the first document is used as the primary
input document. The whole sequence is also the default collection.
If no documents are provided on the <tt class="port">source</tt>
port, the primary input document is undefined and the default
collection is empty. <a name="err.inline.C0039" id=
"err.inline.C0039"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0039"><code class="errqname">err:XC0039</code></a>) if a
sequence of documents (including an empty sequence) is provided to
an XSLT 1.0 step.</p>
<p>A dynamic error occurs if the XSLT processor signals a fatal
error. This includes the case where the transformation terminates
due to a <tt class="tag-element">xsl:message</tt> instruction with
a <tt class="tag-attribute">terminate</tt> attribute value of
<tt class="literal">yes</tt>”. <a name="impl-51" id=
"impl-51"></a>How XSLT message termination errors are reported to
the XProc processor is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p>The invocation of the transformation is controlled by the
<tt class="option">initial-mode</tt> and <tt class=
"option">template-name</tt> options that set the initial mode
and/or named template in the XSLT transformation where processing
begins. <a name="err.inline.C0056" id="err.inline.C0056"></a>It is
a <em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0056"><code class=
"errqname">err:XC0056</code></a>) if the specified initial mode or
named template cannot be applied to the specified stylesheet.</p>
<p>The <tt class="option">output-base-uri</tt> option sets the
context's output base URI per the XSLT 2.0 specification, otherwise
the base URI of the <tt class="port">result</tt> document is the
base URI of the first document in the <tt class="code">source</tt>
port's sequence. If the value of the <tt class=
"option">output-base-uri</tt> option is not absolute, it will be
resolved using the base URI of its <a href="#p.option"><tt class=
"tag-element">p:option</tt></a> element. An XSLT 1.0 step
<span class="rfc2119">should</span> use the value of the <tt class=
"option">output-base-uri</tt> as the base URI of its output, if the
option is specified.</p>
<p>If XSLT 2.0 is used, the outputs of this step <span class=
"rfc2119">may</span> include PSVI annotations.</p>
<p>The static and initial dynamic contexts of the XSLT processor
are the contexts defined in <a href="#step-xpath-context-10" title=
"Step XPath Context">Section&#160;2.6.1.2, “Step XPath Context”</a>
for an XSLT 1.0 processor and <a href="#step-xpath-context-20"
title="Step XPath Context">Section&#160;2.6.2.2, “Step XPath
Context”</a> for an XSLT 2.0 processor with the following
adjustments.</p>
<p>The dynamic context is augmented as follows:</p>
<div class="variablelist">
<dl>
<dt>Context item</dt>
<dd>
<p>The first document that appears on the <tt class=
"port">source</tt> port.</p>
</dd>
<dt>Variable values</dt>
<dd>
<p>Any parameters passed on the <tt class="port">parameters</tt>
port are available as variable bindings to the XSLT processor.</p>
</dd>
<dt>Function implementations</dt>
<dd>
<p>The function implementations provided by the XSLT processor.</p>
</dd>
<dt>Default collection</dt>
<dd>
<p>The sequence of documents provided on the <tt class=
"port">source</tt> port.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="section">
<h4><a name="std-optional" id="std-optional"></a>7.2&#160;Optional
Steps</h4>
<p>The following steps are optional. If they are supported by a
processor, they must conform to the semantics outlined here, but a
conformant processor is not required to support all (or any) of
these steps.</p>
<div class="section">
<h5><a name="c.exec" id="c.exec"></a>7.2.1&#160;p:exec</h5>
<p>The <tt class="tag-element">p:exec</tt> step runs an external
command passing the input that arrives on its <tt class=
"port">source</tt> port as standard input, reading <tt class=
"port">result</tt> from standard output, and <tt class=
"port">errors</tt> from standard error.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:exec</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">errors</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">exit-status</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">command</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">args</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cwd</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">source-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">result-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrap-result-lines</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">errors-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrap-error-lines</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">path-separator</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">failure-threshold</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">arg-separator</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'
'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The values of the <tt class="option">command</tt>, <tt class=
"option">args</tt>, <tt class="option">cwd</tt>, <tt class=
"option">path-separator</tt>, and <tt class=
"option">arg-separator</tt> options <span class=
"rfc2119">must</span> be strings.</p>
<p>The values of the <tt class="option">source-is-xml</tt>,
<tt class="option">result-is-xml</tt>, <tt class=
"option">errors-is-xml</tt>, and <tt class=
"option">fix-slashes</tt> options <span class="rfc2119">must</span>
be boolean.</p>
<p>The <tt class="tag-element">p:exec</tt> step executes the
command passed on <tt class="option">command</tt> with the
arguments passed on <tt class="option">args</tt>. The processor
does not interpolate the values of the <tt class=
"option">command</tt> or <tt class="option">args</tt> (for example,
expanding references to environment variables). <a name=
"err.inline.C0033" id="err.inline.C0033"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0033"><code class=
"errqname">err:XC0033</code></a>) if the command cannot be run.</p>
<p>If <tt class="option">cwd</tt> is specified, then the current
working directory is changed to the value of that option before
execution begins. <a name="err.inline.C0034" id=
"err.inline.C0034"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0034"><code class="errqname">err:XC0034</code></a>) if the
current working directory cannot be changed to the value of the
<tt class="option">cwd</tt> option. <a name="impl-52" id=
"impl-52"></a>If <tt class="option">cwd</tt> is not specified, the
current working directory is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>If the <tt class="option">path-separator</tt> option is
specified, every occurrence of the character identified as the
<tt class="option">path-separator</tt> character that occurs in the
<tt class="option">command</tt>, <tt class="option">args</tt>, or
<tt class="option">cwd</tt> will be replaced by the
platform-specific path separator character. <a name=
"err.inline.C0063" id="err.inline.C0063"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0063"><code class=
"errqname">err:XC0063</code></a>) if the <tt class=
"option">path-separator</tt> option is specified and is not exactly
one character long.</p>
<p>The value of the <tt class="option">args</tt> option is a
string. In order to support passing more than one argument to a
command, the <tt class="option">args</tt> string is broken into a
sequence of values. The <tt class="option">arg-separator</tt>
option specifies the character that is used to separate values; by
default it is a single space <a name="err.inline.C0066" id=
"err.inline.C0066"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0066"><code class="errqname">err:XC0066</code></a>) if the
<tt class="option">arg-separator</tt> option is specified and is
not exactly one character long.</p>
<p>The following examples of <tt class="tag-element">p:exec</tt>
are equivalent. The first uses the default <tt class=
"option">arg-separator</tt>:</p>
<div class="programlisting">
<pre>
&lt;p:exec command="someCommand" args="arg1 arg2 arg3"/&gt;
</pre></div>
<p>The second specifies an alternate separator:</p>
<div class="programlisting">
<pre>
&lt;p:exec command="someCommand" args="arg1,arg2,arg3"
        arg-separator=","/&gt;
</pre></div>
<p>If one of the arguments contains a space (e.g., a filename that
contains a space), then you must specify an alternate
separator.</p>
<p>The <tt class="port">source</tt> port is declared to accept a
sequence so that it can be empty. If no document appears on the
<tt class="port">source</tt> port, then the command receives
nothing on standard input. If a document does arrive on the
<tt class="port">source</tt> port, it will be passed to the command
as its standard input. <a name="err.inline.D0006.1" id=
"err.inline.D0006.1"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.D0006"><code class="errqname">err:XD0006</code></a>) if more
than one document appears on the <tt class="port">source</tt> port
of the <tt class="tag-element">p:exec</tt> step. If <tt class=
"option">source-is-xml</tt> is true, the serialization options are
used to convert the input into serialized XML which is passed to
the command, otherwise the XPath string-value of the document is
passed.</p>
<p>The standard output of the command is read and returned on
<tt class="port">result</tt>; the standard error output is read and
returned on <tt class="port">errors</tt>. In order to assure that
the result will be an XML document, each of the results will be
wrapped in a <a href="#cv.result"><tt class=
"tag-element">c:result</tt></a> element.</p>
<p>If <tt class="option">result-is-xml</tt> is true, the standard
output of the program is assumed to be XML and will be parsed as a
single document. If it is false, the output is assumed <em>not</em>
to be XML and will be returned as escaped text.</p>
<p id="cv.line">If <tt class="option">wrap-result-lines</tt> is
true, a <a href="#cv.line"><tt class="tag-element">c:line</tt></a>
element will be wrapped around each line of output.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:line&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:line&gt;</code></p>
<p><a name="err.inline.C0035" id="err.inline.C0035"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0035"><code class=
"errqname">err:XC0035</code></a>) to specify both <tt class=
"option">result-is-xml</tt> and <tt class=
"option">wrap-result-lines</tt>.</p>
<p>The same rules apply to the standard error output of the
program, with the <tt class="option">errors-is-xml</tt> and
<tt class="option">wrap-error-lines</tt> options, respectively.</p>
<p>If either of the results are XML, they <span class=
"rfc2119">must</span> be parsed with namespaces enabled and
validation turned off, just like <a href="#p.document"><tt class=
"tag-element">p:document</tt></a>.</p>
<p>The <tt class="port">exit-status</tt> port always returns a
single <a href="#cv.result"><tt class=
"tag-element">c:result</tt></a> element which contains the system
exit status that the process returned. <a name="impl-53" id=
"impl-53"></a>The specific exit status values returned by a process
invoked with <tt class="tag-element">p:exec</tt> are <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
<p>If a <tt class="option">failure-threshold</tt> value is
supplied, and the exit status is greater than that threshold, then
the <tt class="tag-element">p:exec</tt> step <span class=
"rfc2119">must</span> fail. <a name="err.inline.C0064" id=
"err.inline.C0064"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0064"><code class="errqname">err:XC0064</code></a>) if the
exit code from the command is greater than the specified <tt class=
"option">failure-threshold</tt> value. This failure, like any step
failure, can be captured with a <a href="#p.try"><tt class=
"tag-element">p:try</tt></a>.</p>
</div>
<div class="section">
<h5><a name="c.hash" id="c.hash"></a>7.2.2&#160;p:hash</h5>
<p>The <tt class="tag-element">p:hash</tt> step generates a hash,
or digital “fingerprint”, for some value and injects it into the
<tt class="port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:hash</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">value</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">algorithm</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">algorithm</tt> option must
be a QName. If it does not have a prefix, then it must be one of
the following values: “crc”, “md”, or “sha”.</p>
<p>If a <tt class="tag-attribute">version</tt> is not specified,
the default version is algorithm-defined. For “<tt class=
"literal">crc</tt>” it is 32, for “<tt class="literal">md</tt>” it
is 5, for “<tt class="literal">sha</tt>” it is 1.</p>
<p>A hash is constructed from the string specified in the
<tt class="option">value</tt> option using the specified algorithm
and version. Implementations <span class="rfc2119">must</span>
support [<a href="#bib.crc"><span class="abbrev">CRC32</span></a>],
[<a href="#rfc1321"><span class="abbrev">MD5</span></a>], and
[<a href="#bib.sha"><span class="abbrev">SHA1</span></a>] hashes.
<a name="impl-54" id="impl-54"></a>It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> what
other algorithms are supported. The resulting hash <span class=
"rfc2119">should</span> be returned as a string of hexadecimal
characters.</p>
<p>The value of the <tt class="option">match</tt> option must be an
XSLTMatchPattern.</p>
<p>The hash of the specified value is computed using the algorithm
and parameters specified. <a name="err.inline.C0036" id=
"err.inline.C0036"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0036"><code class="errqname">err:XC0036</code></a>) if the
requested hash algorithm is not one that the processor understands
or if the value or parameters are not appropriate for that
algorithm.</p>
<p>The matched nodes are specified with the match pattern in the
<tt class="option">match</tt> option. For each matching node, the
string value of the computed hash is used in the output (if more
than one node matches, the <em>same</em> hash value is used in each
match). Nodes that do not match are copied without change.</p>
<p>If the expression given in the <tt class="option">match</tt>
option matches an <em>attribute</em>, the hash is used as the new
value of the attribute in the output. If the attribute is named
<tt class="tag-attribute">xml:base</tt>”, the base URI of the
element <span class="rfc2119">must</span> also be amended
accordingly.</p>
<p>If the expression matches any other kind of node, the entire
node (and <em>not</em> just its contents) is replaced by the
hash.</p>
</div>
<div class="section">
<h5><a name="c.uuid" id="c.uuid"></a>7.2.3&#160;p:uuid</h5>
<p>The <tt class="tag-element">p:uuid</tt> step generates a
[<a href="#bib.uuid"><span class="abbrev">UUID</span></a>] and
injects it into the <tt class="port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:uuid</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option must be an
XSLTMatchPattern. The value of the <tt class="option">version</tt>
option must be an integer.</p>
<p>If the <tt class="option">version</tt> is specified, that
version of UUID must be computed. <a name="err.inline.C0060" id=
"err.inline.C0060"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0060"><code class="errqname">err:XC0060</code></a>) if the
processor does not support the specified <tt class=
"option">version</tt> of the UUID algorithm. <a name="impl-55" id=
"impl-55"></a>If the <tt class="option">version</tt> is not
specified, the version of UUID computed is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>Implementations <span class="rfc2119">must</span> support
version 4 UUIDs. <a name="impl-56" id="impl-56"></a>Support for
other versions of UUID, and the mechanism by which the necessary
inputs are made available for computing other versions, is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>The matched nodes are specified with the match pattern in the
<tt class="option">match</tt> option. For each matching node, the
generated UUID is used in the output (if more than one node
matches, the <em>same</em> UUID is used in each match). Nodes that
do not match are copied without change.</p>
<p>If the expression given in the <tt class="option">match</tt>
option matches an <em>attribute</em>, the UUID is used as the new
value of the attribute in the output. If the attribute is named
<tt class="tag-attribute">xml:base</tt>”, the base URI of the
element <span class="rfc2119">must</span> also be amended
accordingly.</p>
<p>If the expression matches any other kind of node, the entire
node (and <em>not</em> just its contents) is replaced by the
UUID.</p>
</div>
<div class="section">
<h5><a name="c.validate-with-relax-ng" id=
"c.validate-with-relax-ng"></a>7.2.4&#160;p:validate-with-relax-ng</h5>
<p>The <tt class="tag-element">p:validate-with-relax-ng</tt> step
applies [<a href="#iso19757-2"><span class="abbrev">RELAX
NG</span></a>] validation to the <tt class="port">source</tt>
document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-relax-ng</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-attribute-values</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-id-idref-warnings</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The values of the <tt class="option">dtd-attribute-values</tt>
and <tt class="option">dtd-id-idref-warnings</tt> options
<span class="rfc2119">must</span> be booleans.</p>
<p>If the root element of the schema is <a href=
"#p.data"><tt class="tag-element">c:data</tt></a> or has a
<tt class="tag-attribute">c:content-type</tt> attribute that
specifies a text content type or a media type that the
implementation recognizes, then the step <span class=
"rfc2119">should</span> treat the text node descendants of the
element as a [<a href="#relaxng-compact-syntax"><span class=
"abbrev">RELAX NG Compact Syntax</span></a>] document for
validation.</p>
<p>If the <tt class="option">dtd-attribute-values</tt> option is
<tt class="literal">true</tt>, then the attribute value defaulting
conventions of [<a href="#relaxng-dtd-compat"><span class=
"abbrev">RELAX NG DTD Compatibility</span></a>] are also
applied.</p>
<p>If the <tt class="option">dtd-id-idref-warnings</tt> option is
<tt class="literal">true</tt>, then the validator <span class=
"rfc2119">should</span> treat a schema that is incompatible with
the ID/IDREF/IDREFs feature of [<a href=
"#relaxng-dtd-compat"><span class="abbrev">RELAX NG DTD
Compatibility</span></a>] as if the document was invalid.</p>
<p><a name="err.inline.C0053" id="err.inline.C0053"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0053"><code class=
"errqname">err:XC0053</code></a>) if the <tt class=
"option">assert-valid</tt> option is <tt class="literal">true</tt>
and the input document is not valid.</p>
<p>The output from this step is a copy of the input, possibly
augmented by application of the [<a href=
"#relaxng-dtd-compat"><span class="abbrev">RELAX NG DTD
Compatibility</span></a>]. The output of this step <span class=
"rfc2119">may</span> include PSVI annotations.</p>
<p><a name="impl-57" id="impl-57"></a>Support for [<a href=
"#relaxng-dtd-compat"><span class="abbrev">RELAX NG DTD
Compatibility</span></a>] is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation defined</a></em>.</p>
</div>
<div class="section">
<h5><a name="c.validate-with-schematron" id=
"c.validate-with-schematron"></a>7.2.5&#160;p:validate-with-schematron</h5>
<p>The <tt class="tag-element">p:validate-with-schematron</tt> step
applies [<a href="#iso19757-3"><span class=
"abbrev">Schematron</span></a>] processing to the <tt class=
"port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-schematron</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">report</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">phase</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'#ALL'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p><a name="err.inline.C0054" id="err.inline.C0054"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0054"><code class=
"errqname">err:XC0054</code></a>) if the <tt class=
"option">assert-valid</tt> option is <tt class="literal">true</tt>
and any Schematron assertions fail.</p>
<p>The value of the <tt class="option">phase</tt> option identifies
the Schematron validation phase with which validation begins.</p>
<p>The <tt class="port">parameters</tt> port provides name/value
pairs which correspond to Schematron external variables.</p>
<p>The <tt class="port">result</tt> output from this step is a copy
of the input.</p>
<p>Schematron assertions and reports, if any, <span class=
"rfc2119">must</span> appear on the <tt class="port">report</tt>
port. The output <span class="rfc2119">should</span> be in
<em class="citetitle">Schematron Validation Report Language</em>
(SVRL).</p>
<p>The output of this step <span class="rfc2119">may</span> include
PSVI annotations.</p>
</div>
<div class="section">
<h5><a name="c.validate-with-xml-schema" id=
"c.validate-with-xml-schema"></a>7.2.6&#160;p:validate-with-xml-schema</h5>
<p>The <tt class="tag-element">p:validate-with-xml-schema</tt> step
applies [<a href="#xmlschema-1"><span class="abbrev">W3C XML
Schema: Part 1</span></a>] validity assessment to the <tt class=
"port">source</tt> input.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-xml-schema</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">use-location-hints</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">try-namespaces</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">mode</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'strict'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"strict"
| "lax"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p>The values of the <tt class="option">use-location-hints</tt>,
<tt class="option">try-namespaces</tt>, and <tt class=
"option">assert-valid</tt> options <span class=
"rfc2119">must</span> be boolean.</p>
<p>The value of the <tt class="option">mode</tt> option
<span class="rfc2119">must</span> be an NMTOKEN whose value is
either “<tt class="literal">strict</tt>” or “<tt class=
"literal">lax</tt>”.</p>
<p>Validation is performed against the set of schemas represented
by the documents on the <tt class="port">schema</tt> port. These
schemas must be used in preference to any schema locations provided
by schema location hints encountered during schema validation, that
is, schema locations supplied for <tt class="code">xs:import</tt>
or <tt class="code">xsi:schema-location</tt>, or determined by
schema-processor-defined namespace-based strategies, for the
namespaces covered by the documents available on the schemas
port.</p>
<p>If <tt class="code">xs:include</tt> elements occur within the
supplied schema documents, they are treated like any other <a href=
"#external-docs">external documents</a>. <a name="impl-58" id=
"impl-58"></a>It is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em> if the
documents supplied on the <tt class="port">schemas</tt> port are
considered when resolving <tt class="code">xs:include</tt> elements
in the schema documents provided.</p>
<p>The <tt class="option">use-location-hints</tt> and <tt class=
"option">try-namespaces</tt> options allow the pipeline author to
control how the schema processor should attempt to locate schema
documents necessary but not provided on the <tt class=
"port">schema</tt> port. Any schema documents provided on the
<tt class="port">schema</tt> port <span class="rfc2119">must</span>
be used in preference to schema documents located by other
means.</p>
<p>If the <tt class="option">use-location-hints</tt> option is
<tt class="literal">true</tt>”, the processor <span class=
"rfc2119">should</span> make use of schema location hints to locate
schema documents. If the option is “<tt class=
"literal">false</tt>”, the processor <span class=
"rfc2119">should</span> ignore any such hints.</p>
<p>If the <tt class="option">try-namespaces</tt> option is
<tt class="literal">true</tt>”, the processor <span class=
"rfc2119">should</span> attempt to dereference the namespace URI to
locate schema documents. If the option is “<tt class=
"literal">false</tt>”, the processor <span class="rfc2119">should
not</span> dereference namespace URIs.</p>
<p>The <tt class="option">mode</tt> option allow the pipeline
author to control how schema validation begins. The “<tt class=
"literal">strict</tt>” mode means that the document element must be
declared and schema-valid, otherwise it will be treated as invalid.
The “<tt class="literal">lax</tt>” mode means that the absence of a
declaration for the document element does not itself count as an
unsuccessful outcome of validation.</p>
<p><a name="err.inline.C0053.1" id="err.inline.C0053.1"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0053"><code class=
"errqname">err:XC0053</code></a>) if the <tt class=
"option">assert-valid</tt> option is <tt class="literal">true</tt>
and the input document is not valid. If the <tt class=
"option">assert-valid</tt> option is <tt class=
"literal">false</tt>, it is not an error for the document to be
invalid. In this case, if the implementation does not support the
PSVI, <tt class="tag-element">p:validate-with-xml-schema</tt> is
essentially just an “identity” step, but if the implementation
<em>does</em> support the PSVI, then the resulting document will
have additional type information (at least for the subtrees that
are valid).</p>
<p>When XML Schema validation assessment is performed, the
processor is invoked in the mode specified by the <tt class=
"option">mode</tt> option. <a name="err.inline.C0055" id=
"err.inline.C0055"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0055"><code class="errqname">err:XC0055</code></a>) if the
implementation does not support the specified mode.</p>
<p>The <tt class="port">result</tt> of the assessment is a document
with the Post-Schema-Validation-Infoset (PSVI) ([<a href=
"#xmlschema-1"><span class="abbrev">W3C XML Schema: Part
1</span></a>]) annotations, if the pipeline implementation supports
such annotations. If not, the input document is reproduced with any
defaulting of attributes and elements performed as specified by the
XML Schema recommendation.</p>
</div>
<div class="section">
<h5><a name="c.www-form-urldecode" id=
"c.www-form-urldecode"></a>7.2.7&#160;p:www-form-urldecode</h5>
<p>The <tt class="tag-element">p:www-form-urldecode</tt> step
decodes a <tt class="literal">x-www-form-urlencoded</tt> string
into a set of parameters.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:www-form-urldecode</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">value</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The <tt class="option">value</tt> option is interpreted as a
string of parameter values encoded using the <tt class=
"literal">x-www-form-urlencoded</tt> algorithm. It turns each such
encoded name/value pair into a parameter. The entire set of
parameters is written (as a <a href="#cv.param-set"><tt class=
"tag-element">c:param-set</tt></a>) on the <tt class=
"port">result</tt> output port.</p>
<p><a name="err.inline.C0037" id="err.inline.C0037"></a>It is a
<em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0037"><code class=
"errqname">err:XC0037</code></a>) if the <tt class=
"option">value</tt> provided is not a properly <tt class=
"literal">x-www-form-urlencoded</tt> value. <a name=
"err.inline.C0061" id="err.inline.C0061"></a>It is a <em class=
"glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em>&#160;(<a href="#err.C0061"><code class=
"errqname">err:XC0061</code></a>) if the name of any encoded
parameter name is not a valid <tt class="type">xs:NCName</tt>. In
other words, this step can only decode simple name/value pairs
where the names do not contain colons or any characters that cannot
be used in XML names.</p>
<p>The order of the <a href="#cv.param"><tt class=
"tag-element">c:param</tt></a> elements in the result is the same
as the order of the encoded parameters, reading from left to
right.</p>
<p>If any parameter name occurs more than once in the encoded
string, the resulting parameter set will contain a <a href=
"#cv.param"><tt class="tag-element">c:param</tt></a> for each
instance. However, only one of these will actually be used if the
parameter set is passed to another step on its <em class=
"glossterm"><a href="#dt-parameter-input-port">parameter input
port</a></em>.</p>
</div>
<div class="section">
<h5><a name="c.www-form-urlencode" id=
"c.www-form-urlencode"></a>7.2.8&#160;p:www-form-urlencode</h5>
<p>The <tt class="tag-element">p:www-form-urlencode</tt> step
encodes a set of parameter values as a <tt class=
"literal">x-www-form-urlencoded</tt> string and injects it into the
<tt class="port">source</tt> document.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:www-form-urlencode</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">match</tt> option must be an
XSLTMatchPattern.</p>
<p>The set of parameters is encoded as a single <tt class=
"literal">x-www-form-urlencoded</tt> string of name/value pairs.
When parameters are encoded into name/value pairs, <em>only</em>
the local name of each parameter is used. The namespace name is
ignored and no prefix or colon appears in the name.</p>
<p>The parameters are encoded in document order. That is, the first
parameter appears first in the resulting string, the second
parameter second, etc. reading from left to right.</p>
<p>The matched nodes are specified with the match pattern in the
<tt class="option">match</tt> option. For each matching node, the
encoded string is used in the output. Nodes that do not match are
copied without change.</p>
<p>If the expression given in the <tt class="option">match</tt>
option matches an <em>attribute</em>, the encoded string is used as
the new value of the attribute in the output. If the expression
matches any other kind of node, the entire node (and <em>not</em>
just its contents) is replaced by the encoded string.</p>
</div>
<div class="section">
<h5><a name="c.xquery" id="c.xquery"></a>7.2.9&#160;p:xquery</h5>
<p>The <tt class="tag-element">p:xquery</tt> step applies an
[<a href="#xquery10"><span class="abbrev">XQuery 1.0</span></a>]
query to the sequence of documents provided on the <tt class=
"port">source</tt> port.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xquery</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">query</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>If a sequence of documents is provided on the <tt class=
"port">source</tt> port, the first document is used as the initial
context item. The whole sequence is also the default collection. If
no documents are provided on the <tt class="port">source</tt> port,
the initial context item is undefined and the default collection is
empty.</p>
<p>The <tt class="port">query</tt> port must receive a single
document:</p>
<div class="itemizedlist">
<ul>
<li>
<p>If the document root element is <a href="#cv.query"><tt class=
"tag-element" id="cv.query">c:query</tt></a>, the text descendants
of this element are considered the query.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:query&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:query&gt;</code></p>
</li>
<li>
<p>If the document root element is in the XQueryX namespace, the
document is treated as an XQueryX-encoded query. <a name="impl-59"
id="impl-59"></a>Support for XQueryX is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</li>
<li>
<p>If the document root element is <a href="#p.data"><tt class=
"tag-element">c:data</tt></a> and either does not have a <tt class=
"tag-attribute">content-type</tt> attribute or has a <tt class=
"tag-attribute">content-type</tt> attribute that specifies a text
content type or a media type that the implementation recognizes,
then the text descendants of this element are considered the
query.</p>
</li>
<li>
<p>If the document root element is not <a href="#p.data"><tt class=
"tag-element">c:data</tt></a> but has a <tt class=
"tag-attribute">c:content-type</tt> attribute that specifies a text
content type or a media type that the implementation recognizes,
then the text descendants of this element are considered the
query.</p>
</li>
<li>
<p><a name="impl-60" id="impl-60"></a>Otherwise, the interpretation
of the query is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</li>
</ul>
</div>
<p>The result of the <tt class="tag-element">p:xquery</tt> step
must be a sequence of documents. <a name="err.inline.C0057" id=
"err.inline.C0057"></a>It is a <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic error</a></em>&#160;(<a href=
"#err.C0057"><code class="errqname">err:XC0057</code></a>) if the
sequence that results from evaluating the XQuery contains items
other than documents and elements. Any elements that appear in the
result sequence will be treated as documents with the element as
their document element.</p>
<p>For example:</p>
<div class="programlisting">
<pre>
&lt;c:query&gt;
declare namespace atom="http://www.w3.org/2005/Atom";
/atom:feed/atom:entry
&lt;/c:query&gt;
</pre></div>
<p>The output of this step <span class="rfc2119">may</span> include
PSVI annotations.</p>
<p>The static context of the XQuery processor is augmented in the
following way:</p>
<div class="variablelist">
<dl>
<dt>Statically known default collection type</dt>
<dd>
<p><tt class="literal">document()*</tt></p>
</dd>
<dt>Statically known namespaces:</dt>
<dd>
<p>Unchanged from the implementation defaults. No namespace
declarations in the XProc pipeline are automatically exposed in the
static context.</p>
</dd>
</dl>
</div>
<p>The dynamic context of the XQuery processor is augmented in the
following way:</p>
<div class="variablelist">
<dl>
<dt>Context item</dt>
<dd>
<p>The first document that appears on the <tt class=
"port">source</tt> port.</p>
</dd>
<dt>Context position</dt>
<dd>
<p><tt class="literal">1</tt></p>
</dd>
<dt>Context size</dt>
<dd>
<p><tt class="literal">1</tt></p>
</dd>
<dt>Variable values</dt>
<dd>
<p>Any parameters passed on the <tt class="port">parameters</tt>
port augment any implementation-defined variable bindings known to
the XQuery processor. The parameter values are passed to the XQuery
processor as values of type <tt class=
"type">xs:untypedAtomic</tt>.</p>
</dd>
<dt>Function implementations</dt>
<dd>
<p>The function implementations provided by the XQuery
processor.</p>
</dd>
<dt>Current dateTime</dt>
<dd>
<p><a name="impl-61" id="impl-61"></a>The point in time returned as
the current dateTime is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Implicit timezone</dt>
<dd>
<p><a name="impl-62" id="impl-62"></a>The implicit timezone is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
</dd>
<dt>Available documents</dt>
<dd>
<p><a name="impl-63" id="impl-63"></a>The set of available
documents (those that may be retrieved with a URI) is <em class=
"glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Available collections</dt>
<dd>
<p><a name="impl-64" id="impl-64"></a>The set of available
collections is <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>.</p>
</dd>
<dt>Default collection</dt>
<dd>
<p>The sequence of documents provided on the <tt class=
"port">source</tt> port.</p>
</dd>
</dl>
</div>
<div class="section">
<h6><a name="example-xquery" id=
"example-xquery"></a>7.2.9.1&#160;Example</h6>
<p>The following pipeline applies XInclude processing and schema
validation before using XQuery:</p>
<div class="example-wrapper" id="ex.c.xquery">
<div class="title">Example&#160;11.&#160;A Sample Pipeline
Document</div>
<div class="example">
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;

&lt;p:xinclude/&gt;

&lt;p:validate-with-xml-schema name="validate"&gt;
  &lt;p:input port="schema"&gt;
    &lt;p:document href="http://example.com/path/to/schema.xsd"/&gt;
  &lt;/p:input&gt;
&lt;/p:validate-with-xml-schema&gt;

&lt;p:xquery&gt;
   &lt;p:input port="query"&gt;
      &lt;p:data href="countp.xq" /&gt;
   &lt;/p:input&gt;
&lt;/p:xquery&gt;

&lt;/p:pipeline&gt;
</pre></div>
</div>
</div>
<p>Where <tt class="filename">countp.xq</tt> might contain:</p>
<div class="programlisting">
<pre>
&lt;count&gt;{count(.//p)}&lt;/count&gt;
</pre></div>
</div>
</div>
<div class="section">
<h5><a name="c.xsl-formatter" id=
"c.xsl-formatter"></a>7.2.10&#160;p:xsl-formatter</h5>
<p>The <tt class="tag-element">p:xsl-formatter</tt> step receives
an [<a href="#xsl11"><span class="abbrev">XSL 1.1</span></a>]
document and renders the content. The result of rendering is stored
to the URI provided via the <tt class="option">href</tt> option. A
reference to that result is produced on the output port.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xsl-formatter</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">content-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>The value of the <tt class="option">href</tt> option
<span class="rfc2119">must</span> be an <tt class=
"type">anyURI</tt>. If it is relative, it is made absolute against
the base URI of the element on which it is specified (<a href=
"#p.with-option"><tt class="tag-element">p:with-option</tt></a> or
<tt class="tag-element">p:xsl-formatter</tt> in the case of a
<a href="#option-shortcut">syntactic shortcut</a> value).</p>
<p>The content-type of the output is controlled by the <tt class=
"option">content-type</tt> option. This option specifies a media
type as defined by [<a href="#media-types"><span class=
"abbrev">IANA Media Types</span></a>]. The option may include media
type parameters as well (e.g. "application/someformat;
charset=UTF-8"). <a name="impl-65" id="impl-65"></a>The use of
media type parameters on the <tt class="option">content-type</tt>
option is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p><a name="impl-66" id="impl-66"></a>If the <tt class=
"option">content-type</tt> option is not specified, the output type
is <em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>. The
default <span class="rfc2119">should</span> be PDF.</p>
<p><a name="impl-67" id="impl-67"></a>A formatter may take any
number of optional rendering parameters via the step's parameters;
such parameters are defined by the XSL implementation used and are
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>The output of this step is a document containing a single
<a href="#cv.result"><tt class="tag-element">c:result</tt></a>
element whose content is the absolute URI of the document stored by
the step.</p>
</div>
</div>
<div class="section">
<h4><a name="serialization-options" id=
"serialization-options"></a>7.3&#160;Serialization Options</h4>
<p>Several steps in this step library require serialization options
to control the serialization of XML. These options are used to
control serialization as in the [<a href=
"#xml-serialization"><span class="abbrev">Serialization</span></a>]
specification.</p>
<p>The following options may be present on steps that perform
serialization:</p>
<div class="variablelist">
<dl>
<dt><tt class="option">byte-order-mark</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean. If it's not specified, the default varies by encoding: for
UTF-16 it's true, for all others, it's false.</p>
</dd>
<dt><tt class="option">cdata-section-elements</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
list of <tt class="type">QName</tt>s. They are interpreted as
elements name.</p>
</dd>
<dt><tt class="option">doctype-public</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
string. The public identifier of the doctype.</p>
</dd>
<dt><tt class="option">doctype-system</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be an
<tt class="type">anyURI</tt>. The system identifier of the doctype.
It need not be absolute, and is not resolved.</p>
</dd>
<dt><tt class="option">encoding</tt></dt>
<dd>
<p>A character set name. <a name="impl-68" id="impl-68"></a>If no
<tt class="option">encoding</tt> is specified, the encoding used is
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation defined</a></em>. If
the <tt class="option">method</tt> is “<tt class=
"literal">xml</tt>” or “<tt class="literal">xhtml</tt>”, the
implementation defined encoding <span class="rfc2119">must</span>
be either UTF-8 or UTF-16.</p>
</dd>
<dt><tt class="option">escape-uri-attributes</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean. It is ignored unless the specified method is “<tt class=
"literal">xhtml</tt>” or “<tt class="literal">html</tt>”.</p>
</dd>
<dt><tt class="option">include-content-type</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean. It is ignored unless the specified method is “<tt class=
"literal">xhtml</tt>” or “<tt class="literal">html</tt>”.</p>
</dd>
<dt><tt class="option">indent</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean.</p>
</dd>
<dt><tt class="option">media-type</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
string. It specifies the media type (MIME content type). If not
specified, the default varies according to the <tt class=
"option">method</tt>:</p>
<div class="variablelist">
<dl>
<dt><tt class="literal">xml</tt></dt>
<dd>
<p><tt class="literal">application/xml</tt></p>
</dd>
<dt><tt class="literal">html</tt></dt>
<dd>
<p><tt class="literal">text/html</tt></p>
</dd>
<dt><tt class="literal">xhtml</tt></dt>
<dd>
<p><tt class="literal">application/xhtml+xml</tt></p>
</dd>
<dt><tt class="literal">text</tt></dt>
<dd>
<p><tt class="literal">text/plain</tt></p>
</dd>
</dl>
</div>
<p><a name="impl-69" id="impl-69"></a>For methods other than
<tt class="literal">xml</tt>, <tt class="literal">html</tt>,
<tt class="literal">xhtml</tt>, and <tt class="literal">text</tt>;
the <tt class="option">media-type</tt> is <em class=
"glossterm"><a href="#dt-implementation-defined">implementation
defined</a></em>.</p>
</dd>
<dt><tt class="option">method</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
<tt class="type">QName</tt>. It specifies the serialization
method.</p>
</dd>
<dt><tt class="option">normalization-form</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be an
NMTOKEN, one of the enumerated values <tt class="code">NFC</tt>,
<tt class="code">NFD</tt>, <tt class="code">NFKC</tt>, <tt class=
"code">NFKD</tt>, <tt class="code">fully-normalized</tt>,
<tt class="code">none</tt> or an implementation-defined value.</p>
</dd>
<dt><tt class="option">omit-xml-declaration</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean.</p>
</dd>
<dt><tt class="option">standalone</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be an
NMTOKEN, one of the enumerated values <tt class="code">true</tt>,
<tt class="code">false</tt>, or <tt class="code">omit</tt>.</p>
</dd>
<dt><tt class="option">undeclare-prefixes</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
boolean.</p>
</dd>
<dt><tt class="option">version</tt></dt>
<dd>
<p>The value of this option <span class="rfc2119">must</span> be a
string.</p>
</dd>
</dl>
</div>
<p>In order to be consistent with the rest of this specification,
boolean values for the serialization parameters must use one of the
XML Schema lexical forms for boolean: "true", "false", "1", or "0".
This is different from the [<a href=
"#xml-serialization"><span class="abbrev">Serialization</span></a>]
specification which uses “yes” and “no”. No change in semantics is
implied by this different spelling.</p>
<p>The <tt class="option">method</tt> option controls the
serialization method used by this component with standard values of
'html', 'xml', 'xhtml', and 'text' but only the 'xml' value is
required to be supported. The interpretation of the remaining
options is as specified in [<a href=
"#xml-serialization"><span class=
"abbrev">Serialization</span></a>].</p>
<p><a name="impl-70" id="impl-70"></a>Implementations may support
other method values but their results are <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p>A minimally conforming implementation must support the
<tt class="code">xml</tt> output method with the following option
values:</p>
<div class="itemizedlist">
<ul>
<li>
<p>The <tt class="code">version</tt> must support the value
<tt class="code">1.0</tt>.</p>
</li>
<li>
<p>The <tt class="code">encoding</tt> must support the values
<tt class="code">UTF-8</tt>.</p>
</li>
<li>
<p>The <tt class="code">omit-xml-declaration</tt> must be
supported. If the value is not specified or has the value
<tt class="code">no</tt>, an XML declaration must be produced.</p>
</li>
</ul>
</div>
<p>All other option values may be ignored for the <tt class=
"code">xml</tt> output method.</p>
<p>If a processor chooses to implement an option for serialization,
it must conform to the semantics defined in the [<a href=
"#xml-serialization"><span class="abbrev">Serialization</span></a>]
specification.</p>
<div class="admonition">
<div class="admon-title">Note</div>
<p>The use-character-maps parameter in [<a href=
"#xml-serialization"><span class="abbrev">Serialization</span></a>]
specification has not been provided in the standard serialization
options provided by this specification.</p>
</div>
</div>
</div>
<div class="appendix">
<h2><a name="conformance" id=
"conformance"></a>A&#160;Conformance</h2>
<p>Conformant processors <span class="rfc2119">must</span>
implement all of the features described in this specification
except those that are explicitly identified as optional.</p>
<p>Some aspects of processor behavior are not completely specified;
those features are either <em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em> or
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>.</p>
<p><span class="termdef" id=
"dt-implementation-dependent">[Definition: An <em class=
"glossterm">implementation-dependent</em> feature is one where the
implementation has discretion in how it is performed.
Implementations are not required to document or explain how
<em class="glossterm"><a href=
"#dt-implementation-dependent">implementation-dependent</a></em>
features are performed.]</span></p>
<p><span class="termdef" id=
"dt-implementation-defined">[Definition: An <em class=
"glossterm">implementation-defined</em> feature is one where the
implementation has discretion in how it is performed. Conformant
implementations <span class="rfc2119">must</span> document how
<em class="glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>
features are performed.]</span></p>
<div class="section">
<h3><a name="implementation-defined" id=
"implementation-defined"></a>A.1&#160;Implementation-defined
features</h3>
<p>The following features are implementation-defined:</p>
<ol class="features">
<li>It is implementation-defined what additional step types, if
any, are provided. See <a href="#step-concept" title=
"Steps">Section&#160;2.1, “Steps”</a>.</li>
<li>How inputs are connected to XML documents outside the pipeline
is implementation-defined. See <a href="#input-output" title=
"Inputs and Outputs">Section&#160;2.2, “Inputs and
Outputs”</a>.</li>
<li>How pipeline outputs are connected to XML documents outside the
pipeline is implementation-defined. See <a href="#input-output"
title="Inputs and Outputs">Section&#160;2.2, “Inputs and
Outputs”</a>.</li>
<li>In Version 1.0 of XProc, how (or if) implementers provide local
resolution mechanisms and how (or if) they provide access to
intermediate results by URI is implementation-defined. See <a href=
"#external-docs" title="External Documents">Section&#160;2.2.1,
“External Documents”</a>.</li>
<li>Except for cases which are specifically called out in , the
extent to which namespace fixup, and other checks for outputs which
cannot be serialized, are performed on intermediate outputs is
implementation-defined. See <a href="#namespace-fixup" title=
"Namespace Fixup on Outputs">Section&#160;2.4.1, “Namespace Fixup
on Outputs”</a>.</li>
<li>If no version is specified on the step or among its ancestors,
then its XPath version is implementation-defined. See <a href=
"#xpath-context" title="XPaths in XProc">Section&#160;2.6, “XPaths
in XProc”</a>.</li>
<li>The version of Unicode supported is implementation-defined, but
it is recommended that the most recent version of Unicode be used.
See <a href="#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</li>
<li>The point in time returned as the current dateTime is
implementation-defined. See <a href="#xproc-xpath-context-20"
title="Processor XPath Context">Section&#160;2.6.2.1, “Processor
XPath Context”</a>.</li>
<li>The implicit timezone is implementation-defined. See <a href=
"#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</li>
<li>The implicit timezone is implementation-defined. See <a href=
"#step-xpath-context-20" title=
"Step XPath Context">Section&#160;2.6.2.2, “Step XPath
Context”</a>.</li>
<li>The exact format of the language string is
implementation-defined but should be consistent with the xml:lang
attribute. See <a href="#f.system-property" title=
"System Properties">Section&#160;2.7.1, “System
Properties”</a>.</li>
<li>It is implementation-defined if the processor supports any
other XPath extension functions. See <a href=
"#other-xpath-extension-functions" title=
"Other XPath Extension Functions">Section&#160;2.7.10, “Other XPath
Extension Functions”</a>.</li>
<li>Whether or not the pipeline processor supports passing PSVI
annotations between steps is implementation-defined. See <a href=
"#psvi-support" title="PSVIs in XProc">Section&#160;2.8, “PSVIs in
XProc”</a>.</li>
<li>The exact PSVI properties that are preserved when documents are
passed between steps is implementation-defined. See <a href=
"#psvi-support" title="PSVIs in XProc">Section&#160;2.8, “PSVIs in
XProc”</a>.</li>
<li>It is implementation-defined what PSVI properties, if any, are
produced by extension steps. See <a href="#psvi-support" title=
"PSVIs in XProc">Section&#160;2.8, “PSVIs in XProc”</a>.</li>
<li>How outside values are specified for pipeline options on the
pipeline initially invoked by the processor is
implementation-defined. See <a href="#options" title=
"Options">Section&#160;2.10, “Options”</a>.</li>
<li>How outside values are specified for pipeline parameters on the
pipeline initially invoked by the processor is
implementation-defined. See <a href="#parameters" title=
"Parameters">Section&#160;2.11, “Parameters”</a>.</li>
<li>Support for pipeline documents written in XML 1.1 and pipeline
inputs and outputs that use XML 1.1 is implementation-defined. See
<a href="#syntax" title="Syntax Overview">Section&#160;3, “Syntax
Overview”</a>.</li>
<li>The semantics of p:pipeinfo elements are
implementation-defined. See <a href="#annotations" title=
"Processor annotations">Section&#160;3.7, “Processor
annotations”</a>.</li>
<li>The set of URI schemes actually supported is
implementation-defined. See <a href="#common-errors" title=
"Common errors">Section&#160;3.11, “Common errors”</a>.</li>
<li>The presence of other compound steps is implementation-defined;
XProc provides no standard mechanism for defining them or
describing what they can contain. See <a href="#p.extension" title=
"Extension Steps">Section&#160;4.8, “Extension Steps”</a>.</li>
<li>If the href attribute is not specified, the location of the log
file or files is implementation-defined. See <a href="#p.log"
title="p:log">Section&#160;5.5, “p:log”</a>.</li>
<li>How each document or sequence of documents is represented in a
p:log is implementation-defined. See <a href="#p.log" title=
"p:log">Section&#160;5.5, “p:log”</a>.</li>
<li>The default value of any serialization options not specified on
a particular p:serialization element is implementation-defined. See
<a href="#p.serialization" title=
"p:serialization">Section&#160;5.6, “p:serialization”</a>.</li>
<li>When a declared step is evaluated directly by the XProc
processor (as opposed to occurring as an atomic step in some
container), how the input and output ports are connected to
documents is implementation-defined. See <a href="#p.declare-step"
title="p:declare-step">Section&#160;5.8, “p:declare-step”</a>.</li>
<li>The subpipeline may include declarations of additional steps
(e.g., other pipelines or other step types that are provided by a
particular implementation or in some implementation-defined way)
and import other pipelines. See <a href="#declare-pipelines" title=
"Declaring pipelines">Section&#160;5.8.2, “Declaring
pipelines”</a>.</li>
<li>Conformant processors must support directory paths whose scheme
is file. It is implementation-defined what other schemes are
supported by p:directory-list, and what the interpretation of
'directory', 'file' and 'contents' is for those schemes. See
<a href="#c.directory-list" title=
"p:directory-list">Section&#160;7.1.6, “p:directory-list”</a>.</li>
<li>Any file or directory determined to be special by the
p:directory-list step may be output using a c:other element but the
criteria for marking a file as special are implementation-defined.
See <a href="#c.directory-list" title=
"p:directory-list">Section&#160;7.1.6, “p:directory-list”</a>.</li>
<li>Any attributes other than name on c:file, c:directory, or
c:other are implementation-defined. See <a href="#c.directory-list"
title="p:directory-list">Section&#160;7.1.6,
“p:directory-list”</a>.</li>
<li>The interpretation of auth-method values on c:request other
than “Basic” or “Digest” is implementation-defined. See <a href=
"#cv.request" title="Specifying a request">Section&#160;7.1.10.1,
“Specifying a request”</a>.</li>
<li>An implementation may support encodings other than base64 but
these encodings and their names are implementation-defined. See
<a href="#c.request_body" title=
"Request Entity body conversion">Section&#160;7.1.10.2, “Request
Entity body conversion”</a>.</li>
<li>Pipeline authors that need to preserve cookies across several
p:http-request calls in the same pipeline or across multiple
invocations of the same or different pipelines will have to rely on
implementation-defined mechanisms. See <a href="#cookies" title=
"Cookies">Section&#160;7.1.10.3.2, “Cookies”</a>.</li>
<li>Behavior of p:unescape-markup for content-types other than
application/xml is implementation-defined. See <a href=
"#c.unescape-markup" title="p:unescape-markup">Section&#160;7.1.26,
“p:unescape-markup”</a>.</li>
<li>If cwd is not specified, the current working directory is
implementation-defined. See <a href="#c.exec" title=
"p:exec">Section&#160;7.2.1, “p:exec”</a>.</li>
<li>It is implementation-defined what other algorithms are
supported. See <a href="#c.hash" title="p:hash">Section&#160;7.2.2,
“p:hash”</a>.</li>
<li>If the version is not specified, the version of UUID computed
is implementation-defined. See <a href="#c.uuid" title=
"p:uuid">Section&#160;7.2.3, “p:uuid”</a>.</li>
<li>Support for other versions of UUID, and the mechanism by which
the necessary inputs are made available for computing other
versions, is implementation-defined. See <a href="#c.uuid" title=
"p:uuid">Section&#160;7.2.3, “p:uuid”</a>.</li>
<li>It is implementation-defined if the documents supplied on the
schemas port are considered when resolving xs:include elements in
the schema documents provided. See <a href=
"#c.validate-with-xml-schema" title=
"p:validate-with-xml-schema">Section&#160;7.2.6,
“p:validate-with-xml-schema”</a>.</li>
<li>Support for XQueryX is implementation-defined. See <a href=
"#c.xquery" title="p:xquery">Section&#160;7.2.9,
“p:xquery”</a>.</li>
<li>Otherwise, the interpretation of the query is
implementation-defined. See <a href="#c.xquery" title=
"p:xquery">Section&#160;7.2.9, “p:xquery”</a>.</li>
<li>The point in time returned as the current dateTime is
implementation-defined. See <a href="#c.xquery" title=
"p:xquery">Section&#160;7.2.9, “p:xquery”</a>.</li>
<li>The implicit timezone is implementation-defined. See <a href=
"#c.xquery" title="p:xquery">Section&#160;7.2.9,
“p:xquery”</a>.</li>
<li>The use of media type parameters on the content-type option is
implementation-defined. See <a href="#c.xsl-formatter" title=
"p:xsl-formatter">Section&#160;7.2.10, “p:xsl-formatter”</a>.</li>
<li>If the content-type option is not specified, the output type is
implementation-defined. See <a href="#c.xsl-formatter" title=
"p:xsl-formatter">Section&#160;7.2.10, “p:xsl-formatter”</a>.</li>
<li>A formatter may take any number of optional rendering
parameters via the step's parameters; such parameters are defined
by the XSL implementation used and are implementation-defined. See
<a href="#c.xsl-formatter" title=
"p:xsl-formatter">Section&#160;7.2.10, “p:xsl-formatter”</a>.</li>
<li>Implementations may support other method values but their
results are implementation-defined. See <a href=
"#serialization-options" title=
"Serialization Options">Section&#160;7.3, “Serialization
Options”</a>.</li>
<li>It is implementation-defined whether additional information
items and properties, particularly those made available in the
PSVI, are preserved between steps. See <a href=
"#infoset-conformance" title=
"Infoset Conformance">Section&#160;A.3, “Infoset
Conformance”</a>.</li>
</ol>
</div>
<div class="section">
<h3><a name="implementation-dependent" id=
"implementation-dependent"></a>A.2&#160;Implementation-dependent
features</h3>
<p>The following features are implementation-dependent:</p>
<ol class="features">
<li>The evaluation order of steps not connected to one another is
implementation-dependent See <a href="#pipeline-concepts" title=
"Pipeline Concepts">Section&#160;2, “Pipeline Concepts”</a>.</li>
<li>Outside of a try/catch, the disposition of error messages is
implementation-dependent See <a href="#input-output" title=
"Inputs and Outputs">Section&#160;2.2, “Inputs and
Outputs”</a>.</li>
<li>Resolving a URI locally may involve resolvers of various sorts
and possibly appeal to implementation-dependent mechanisms such as
catalog files. See <a href="#external-docs" title=
"External Documents">Section&#160;2.2.1, “External
Documents”</a>.</li>
<li>Whether (and when and how) or not the intermediate results that
pass between steps are ever written to a filesystem is
implementation-dependent. See <a href="#external-docs" title=
"External Documents">Section&#160;2.2.1, “External
Documents”</a>.</li>
<li>The results of computing the union of namespaces in the
presence of conflicting declarations for a particular prefix are
implementation-dependent. See <a href="#step-xpath-context-10"
title="Step XPath Context">Section&#160;2.6.1.2, “Step XPath
Context”</a>.</li>
<li>The set of available documents (those that may be retrieved
with a URI) is implementation-dependent. See <a href=
"#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</li>
<li>The set of available collections is implementation-dependent.
See <a href="#xproc-xpath-context-20" title=
"Processor XPath Context">Section&#160;2.6.2.1, “Processor XPath
Context”</a>.</li>
<li>The set of available documents (those that may be retrieved
with a URI) is implementation-dependent. See <a href=
"#step-xpath-context-20" title=
"Step XPath Context">Section&#160;2.6.2.2, “Step XPath
Context”</a>.</li>
<li>Which steps are forbidden, what privileges are needed to access
resources, and under what circumstances these security constraints
apply is implementation-dependent. See <a href=
"#security-considerations" title=
"Security Considerations">Section&#160;2.12, “Security
Considerations”</a>.</li>
<li>The value of the p:episode system property in a use-when
expression is implementation-dependent. See <a href="#use-when"
title="Conditional Element Exclusion">Section&#160;3.9,
“Conditional Element Exclusion”</a>.</li>
<li>The results of testing for steps not in the XProc namespace in
a use-when expression are implementation-dependent. See <a href=
"#use-when" title="Conditional Element Exclusion">Section&#160;3.9,
“Conditional Element Exclusion”</a>.</li>
<li>The ability of a step to read the p:log output of some former
step is implementation-dependent. See <a href="#p.log" title=
"p:log">Section&#160;5.5, “p:log”</a>.</li>
<li>Implementations may use extension attributes to provide
implementation-dependent information about a declared step. See
<a href="#declare-atomic-steps" title=
"Declaring atomic steps">Section&#160;5.8.1, “Declaring atomic
steps”</a>.</li>
<li>If no content type was specified or is associated with the
resource, the inferred content type is implementation-dependent.
See <a href="#p.data" title="p:data">Section&#160;5.14,
“p:data”</a>.</li>
<li>The interpretation of a multipart message inside another
multipart message is implementation-dependent. See <a href=
"#c.response_body" title=
"Converting Response Entity Bodies">Section&#160;7.1.10.4,
“Converting Response Entity Bodies”</a>.</li>
<li>If the IRI reference specified by the base-uri option on
p:make-absolute-uris is not valid, or if it is absent and the input
document has no base URI, the results are implementation-dependent.
See <a href="#c.make-absolute-uris" title=
"p:make-absolute-uris">Section&#160;7.1.15,
“p:make-absolute-uris”</a>.</li>
<li>The order in which c:param elements occur in the c:param-set is
implementation-dependent. See <a href="#c.parameters" title=
"p:parameters">Section&#160;7.1.18, “p:parameters”</a>.</li>
<li>How XSLT message termination errors are reported to the XProc
processor is implementation-dependent. See <a href="#c.xslt" title=
"p:xslt">Section&#160;7.1.31, “p:xslt”</a>.</li>
<li>The specific exit status values returned by a process invoked
with p:exec are implementation-dependent. See <a href="#c.exec"
title="p:exec">Section&#160;7.2.1, “p:exec”</a>.</li>
<li>The set of available documents (those that may be retrieved
with a URI) is implementation-dependent. See <a href="#c.xquery"
title="p:xquery">Section&#160;7.2.9, “p:xquery”</a>.</li>
<li>The set of available collections is implementation-dependent.
See <a href="#c.xquery" title="p:xquery">Section&#160;7.2.9,
“p:xquery”</a>.</li>
</ol>
</div>
<div class="section">
<h3><a name="infoset-conformance" id=
"infoset-conformance"></a>A.3&#160;Infoset Conformance</h3>
<p>This specification conforms to the XML Information Set [<a href=
"#xml-infoset-rec"><span class="abbrev">Infoset</span></a>]. The
information corresponding to the following information items and
properties must be available to the processor for the documents
that flow through the pipeline.</p>
<div class="itemizedlist">
<ul>
<li>
<p>The <tt class="literal">Document Information Item</tt> with
<tt class="literal">[base URI]</tt> and <tt class=
"literal">[children]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Element Information Items</tt> with
<tt class="literal">[base URI]</tt>, <tt class=
"literal">[children]</tt>, <tt class="literal">[attributes]</tt>,
<tt class="literal">[in-scope namespaces]</tt>, <tt class=
"literal">[prefix]</tt>, <tt class="literal">[local name]</tt>,
<tt class="literal">[namespace name]</tt>, <tt class=
"literal">[parent]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Attribute Information Items</tt> with
<tt class="literal">[namespace name]</tt>, <tt class=
"literal">[prefix]</tt>, <tt class="literal">[local name]</tt>,
<tt class="literal">[normalized value]</tt>, <tt class=
"literal">[attribute type]</tt>, and <tt class="literal">[owner
element]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Character Information Items</tt> with
<tt class="literal">[character code]</tt>, <tt class=
"literal">[parent]</tt>, and, optionally, <tt class=
"literal">[element content whitespace]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Processing Instruction Information
Items</tt> with <tt class="literal">[base URI]</tt>, <tt class=
"literal">[target]</tt>, <tt class="literal">[content]</tt> and
<tt class="literal">[parent]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Comment Information Items</tt> with
<tt class="literal">[content]</tt> and <tt class=
"literal">[parent]</tt> properties.</p>
</li>
<li>
<p><tt class="literal">Namespace Information Items</tt> with
<tt class="literal">[prefix]</tt> and <tt class=
"literal">[namespace name]</tt> properties.</p>
</li>
</ul>
</div>
<p><a name="impl-71" id="impl-71"></a>It is <em class=
"glossterm"><a href=
"#dt-implementation-defined">implementation-defined</a></em>
whether additional information items and properties, particularly
those made available in the PSVI, are preserved between steps.</p>
</div>
</div>
<div class="appendix">
<h2><a name="references" id="references"></a>B&#160;References</h2>
<div class="section">
<h3><a name="normative-references" id=
"normative-references"></a>B.1&#160;Normative References</h3>
<div class="bibliolist">
<div class="bibliomixed" id="use-cases">
<p>[<span class="abbrev">XProc Requirements</span>] <a href=
"http://www.w3.org/TR/xproc-requirements/"><span class=
"citetitle"><cite>XML Processing Model Requirements and Use
Cases</cite></span></a>. Alex Milowski, editor. W3C Working Draft
11 April 2006.</p>
</div>
<div class="bibliomixed" id="xml-infoset-rec">
<p>[<span class="abbrev">Infoset</span>] <a href=
"http://www.w3.org/TR/xml-infoset/"><span class=
"citetitle"><cite>XML Information Set (Second
Edition)</cite></span></a>. John Cowan, Richard Tobin, editors. W3C
Working Group Note 04 February 2004.</p>
</div>
<div class="bibliomixed" id="xml10">
<p>[<span class="abbrev">XML 1.0</span>] <a href=
"http://www.w3.org/TR/REC-xml/"><span class=
"citetitle"><cite>Extensible Markup Language (XML) 1.0 (Fifth
Edition)</cite></span></a>. Tim Bray, Jean Paoli, C. M.
Sperberg-McQueen, et. al. editors. W3C Recommendation 26 November
2008.</p>
</div>
<div class="bibliomixed" id="xmlns10">
<p>[<span class="abbrev">Namespaces 1.0</span>] <a href=
"http://www.w3.org/TR/REC-xml-names/"><span class=
"citetitle"><cite>Namespaces in XML 1.0 (Third
Edition)</cite></span></a>. Tim Bray, Dave Hollander, Andrew
Layman, et. al., editors. W3C Recommendation 8 December 2009.</p>
</div>
<div class="bibliomixed" id="xml11">
<p>[<span class="abbrev">XML 1.1</span>] <a href=
"http://www.w3.org/TR/xml11/"><span class=
"citetitle"><cite>Extensible Markup Language (XML) 1.1 (Second
Edition)</cite></span></a>. Tim Bray, Jean Paoli, C. M.
Sperberg-McQueen, et. al. editors. W3C Recommendation 16 August
2006.</p>
</div>
<div class="bibliomixed" id="xmlns11">
<p>[<span class="abbrev">Namespaces 1.1</span>] <a href=
"http://www.w3.org/TR/xml-names11/"><span class=
"citetitle"><cite>Namespaces in XML 1.1 (Second
Edition)</cite></span></a>. Tim Bray, Dave Hollander, Andrew
Layman, et. al., editors. W3C Recommendation 16 August 2006.</p>
</div>
<div class="bibliomixed" id="xpath">
<p>[<span class="abbrev">XPath 1.0</span>] <a href=
"http://www.w3.org/TR/xpath"><span class="citetitle"><cite>XML Path
Language (XPath) Version 1.0</cite></span></a>. James Clark and
Steve DeRose, editors. W3C Recommendation. 16 November 1999.</p>
</div>
<div class="bibliomixed" id="xslt10">
<p>[<span class="abbrev">XSLT 1.0</span>] <a href=
"http://www.w3.org/TR/xslt"><span class="citetitle"><cite>XSL
Transformations (XSLT) Version 1.0</cite></span></a>. James Clark,
editor. W3C Recommendation. 16 November 1999.</p>
</div>
<div class="bibliomixed" id="xpath2">
<p>[<span class="abbrev">XPath 2.0</span>] <a href=
"http://www.w3.org/TR/xpath20/"><span class="citetitle"><cite>XML
Path Language (XPath) 2.0</cite></span></a>. Anders Berglund, Scott
Boag, Don Chamberlin, et. al., editors. W3C Recommendation. 23
January 2007.</p>
</div>
<div class="bibliomixed" id="xpath-datamodel">
<p>[<span class="abbrev">XQuery 1.0 and XPath 2.0 Data Model
(XDM)</span>] <a href=
"http://www.w3.org/TR/xpath-datamodel/"><span class=
"citetitle"><cite>XQuery 1.0 and XPath 2.0 Data Model
(XDM)</cite></span></a>. Mary Fernández, Ashok Malhotra, Jonathan
Marsh, <em class="foreignphrase">et. al.</em>, editors. W3C
Recommendation. 23 January 2007.</p>
</div>
<div class="bibliomixed" id="xpath-functions">
<p>[<span class="abbrev">XPath 2.0 Functions and Operators</span>]
<a href="http://www.w3.org/TR/xpath-functions/"><span class=
"citetitle"><cite>XQuery 1.0 and XPath 2.0 Functions and
Operators</cite></span></a>. Ashok Malhotra, Jim Melton, and Norman
Walsh, editors. W3C Recommendation. 23 January 2007.</p>
</div>
<div class="bibliomixed" id="xslt20">
<p>[<span class="abbrev">XSLT 2.0</span>] <a href=
"http://www.w3.org/TR/xslt20/"><span class="citetitle"><cite>XSL
Transformations (XSLT) Version 2.0</cite></span></a>. Michael Kay,
editor. W3C Recommendation. 23 January 2007.</p>
</div>
<div class="bibliomixed" id="xsl11">
<p>[<span class="abbrev">XSL 1.1</span>] <a href=
"http://www.w3.org/TR/xsl/"><span class=
"citetitle"><cite>Extensible Stylesheet Language (XSL) Version
1.1</cite></span></a>. Anders Berglund, editor. W3C Recommendation.
5 December 2006.</p>
</div>
<div class="bibliomixed" id="xquery10">
<p>[<span class="abbrev">XQuery 1.0</span>] <a href=
"http://www.w3.org/TR/xquery/"><span class="citetitle"><cite>XQuery
1.0: An XML Query Language</cite></span></a>. Scott Boag, Don
Chamberlin, Mary Fernández, et. al., editors. W3C Recommendation.
23 January 2007.</p>
</div>
<div class="bibliomixed" id="iso19757-2">
<p>[<span class="abbrev">RELAX NG</span>] ISO/IEC JTC 1/SC 34.
<a href=
"http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=52348">
<span class="citetitle"><cite>ISO/IEC 19757-2:2008(E) Document
Schema Definition Language (DSDL) -- Part 2: Regular-grammar-based
validation -- RELAX NG</cite></span></a> 2008.</p>
</div>
<div class="bibliomixed" id="relaxng-compact-syntax">
<p>[<span class="abbrev">RELAX NG Compact Syntax</span>] ISO/IEC
JTC 1/SC 34. <span class="citetitle"><cite>ISO/IEC 19757-2:2003/Amd
1:2006 Document Schema Definition Languages (DSDL) — Part 2:
Grammar-based validation — RELAX NG AMENDMENT 1 Compact
Syntax</cite></span> 2006.</p>
</div>
<div class="bibliomixed" id="relaxng-dtd-compat">
<p>[<span class="abbrev">RELAX NG DTD Compatibility</span>]
<span class="citetitle"><cite>RELAX NG DTD
Compatibility</cite></span>. OASIS Committee Specification. 3
December 2001.</p>
</div>
<div class="bibliomixed" id="iso19757-3">
<p>[<span class="abbrev">Schematron</span>] ISO/IEC JTC 1/SC 34.
<span class="citetitle"><cite>ISO/IEC 19757-3:2006(E) Document
Schema Definition Languages (DSDL) — Part 3: Rule-based validation
— Schematron</cite></span> 2006.</p>
</div>
<div class="bibliomixed" id="xmlschema-1">
<p>[<span class="abbrev">W3C XML Schema: Part 1</span>] <a href=
"http://www.w3.org/TR/xmlschema-1/"><span class=
"citetitle"><cite>XML Schema Part 1: Structures Second
Edition</cite></span></a>. Henry S. Thompson, David Beech, Murray
Maloney, et. al., editors. World Wide Web Consortium, 28 October
2004.</p>
</div>
<div class="bibliomixed" id="xmlschema-2">
<p>[<span class="abbrev">W3C XML Schema: Part 2</span>] <a href=
"http://www.w3.org/TR/xmlschema-2/"><span class=
"citetitle"><cite>XML Schema Part 2: Datatypes Second
Edition</cite></span></a>. Paul V. Biron and Ashok Malhotra,
editors. World Wide Web Consortium, 28 October 2004.</p>
</div>
<div class="bibliomixed" id="xml-id">
<p>[<span class="abbrev">xml:id</span>] <a href=
"http://www.w3.org/TR/xml-id/"><span class="citetitle"><cite>xml:id
Version 1.0</cite></span></a>. Jonathan Marsh, Daniel Veillard, and
Norman Walsh, editors. W3C Recommendation. 9 September 2005.</p>
</div>
<div class="bibliomixed" id="xinclude">
<p>[<span class="abbrev">XInclude</span>] <a href=
"http://www.w3.org/TR/xinclude/"><span class="citetitle"><cite>XML
Inclusions (XInclude) Version 1.0 (Second
Edition)</cite></span></a>. Jonathan Marsh, David Orchard, and
Daniel Veillard, editors. W3C Recommendation. 15 November 2006.</p>
</div>
<div class="bibliomixed" id="xml-base">
<p>[<span class="abbrev">XML Base</span>] <a href=
"http://www.w3.org/TR/xmlbase/"><span class="citetitle"><cite>XML
Base (Second Edition)</cite></span></a>. Jonathan Marsh and Richard
Tobin, editors. W3C Recommendation. 28 January 2009.</p>
</div>
<div class="bibliomixed" id="xptr-framework">
<p>[<span class="abbrev">XPointer Framework</span>] <a href=
"http://www.w3.org/TR/xptr-framework/"><span class=
"citetitle"><cite>XPointer Framework</cite></span></a>. Paul
Grosso, Eve Maler, Jonathan Marsh, et. al., editors. W3C
Recommendation. 25 March 2003.</p>
</div>
<div class="bibliomixed" id="xptr-element">
<p>[<span class="abbrev">XPointer element() Scheme</span>] <a href=
"http://www.w3.org/TR/xptr-element/"><span class=
"citetitle"><cite>XPointer element() Scheme</cite></span></a>. Paul
Grosso, Eve Maler, Jonathan Marsh, et. al., editors. W3C
Recommendation. 25 March 2003.</p>
</div>
<div class="bibliomixed" id="xml-serialization">
<p>[<span class="abbrev">Serialization</span>] <a href=
"http://www.w3.org/TR/xslt-xquery-serialization/"><span class=
"citetitle"><cite>XSLT 2.0 and XQuery 1.0
Serialization</cite></span></a>. Scott Boag, Michael Kay, Joanne
Tong, Norman Walsh, and Henry Zongaro, editors. W3C Recommendation.
23 January 2007.</p>
</div>
<div class="bibliomixed" id="rfc1321">
<p>[<span class="abbrev">MD5</span>] <a href=
"http://www.ietf.org/rfc/rfc1321.txt"><span class=
"citetitle"><cite>RFC 1321: The MD5 Message-Digest
Algorithm</cite></span></a>. R. Rivest. Network Working Group,
IETF, April 1992.</p>
</div>
<div class="bibliomixed" id="rfc1521">
<p>[<span class="abbrev">RFC 1521</span>] <a href=
"http://www.ietf.org/rfc/rfc1521.txt"><span class=
"citetitle"><cite>RFC 1521: MIME (Multipurpose Internet Mail
Extensions) Part One: Mechanisms for Specifying and Describing the
Format of Internet Message Bodies</cite></span></a>. N. Borenstein,
N. Freed, editors. Internet Engineering Task Force. September,
1993.</p>
</div>
<div class="bibliomixed" id="rfc2119">
<p>[<span class="abbrev">RFC 2119</span>] <a href=
"http://www.ietf.org/rfc/rfc2119.txt"><span class=
"citetitle"><cite>Key words for use in RFCs to Indicate Requirement
Levels</cite></span></a>. S. Bradner. Network Working Group, IETF,
Mar 1997.</p>
</div>
<div class="bibliomixed" id="rfc2396">
<p>[<span class="abbrev">RFC 2396</span>] <a href=
"http://www.ietf.org/rfc/rfc2396.txt"><span class=
"citetitle"><cite>Uniform Resource Identifiers (URI): Generic
Syntax</cite></span></a>. T. Berners-Lee, R. Fielding, and L.
Masinter. Network Working Group, IETF, Aug 1998.</p>
</div>
<div class="bibliomixed" id="rfc2616">
<p>[<span class="abbrev">RFC 2616</span>] <a href=
"http://www.ietf.org/rfc/rfc2616.txt"><span class=
"citetitle"><cite>RFC 2616: Hypertext Transfer Protocol —
HTTP/1.1</cite></span></a>. R. Fielding, J. Gettys, J. Mogul, et.
al., editors. Internet Engineering Task Force. June, 1999.</p>
</div>
<div class="bibliomixed" id="rfc2617">
<p>[<span class="abbrev">RFC 2617</span>] <a href=
"http://www.ietf.org/rfc/rfc2617.txt"><span class=
"citetitle"><cite>RFC 2617: HTTP Authentication: Basic and Digest
Access Authentication</cite></span></a>. J. Franks, P.
Hallam-Baker, J. Hostetler, S. Lawrence, P. Leach, A. Luotonen, L.
Stewart. June, 1999 .</p>
</div>
<div class="bibliomixed" id="rfc3023">
<p>[<span class="abbrev">RFC 3023</span>] <a href=
"http://www.ietf.org/rfc/rfc3023.txt"><span class=
"citetitle"><cite>RFC 3023: XML Media Types</cite></span></a>. M.
Murata, S. St. Laurent, and D. Kohn, editors. Internet Engineering
Task Force. January, 2001.</p>
</div>
<div class="bibliomixed" id="rfc3548">
<p>[<span class="abbrev">RFC 3548</span>] <a href=
"http://www.ietf.org/rfc/rfc3548.txt"><span class=
"citetitle"><cite>RFC 3548: The Base16, Base32, and Base64 Data
Encodings</cite></span></a>. S. Josefsson, Editor. Internet
Engineering Task Force. July, 2003.</p>
</div>
<div class="bibliomixed" id="rfc3986">
<p>[<span class="abbrev">RFC 3986</span>] <a href=
"http://www.ietf.org/rfc/rfc3986.txt"><span class=
"citetitle"><cite>RFC 3986: Uniform Resource Identifier (URI):
General Syntax</cite></span></a>. T. Berners-Lee, R. Fielding, and
L. Masinter, editors. Internet Engineering Task Force. January,
2005.</p>
</div>
<div class="bibliomixed" id="rfc3987">
<p>[<span class="abbrev">RFC 3987</span>] <a href=
"http://www.ietf.org/rfc/rfc3987.txt"><span class=
"citetitle"><cite>RFC 3987: Internationalized Resource Identifiers
(IRIs)</cite></span></a>. M. Duerst and M. Suignard, editors.
Internet Engineering Task Force. January, 2005.</p>
</div>
<div class="bibliomixed" id="unicodetr17">
<p>[<span class="abbrev">Unicode TR#17</span>] <a href=
"http://unicode.org/reports/tr17/"><span class=
"citetitle"><cite>Unicode Technical Report #17: Character Encoding
Model</cite></span></a>. Ken Whistler, Mark Davis, and Asmus
Freytag, authors. The Unicode Consortium. 11 November 2008.</p>
</div>
<div class="bibliomixed" id="media-types">
<p>[<span class="abbrev">IANA Media Types</span>] <a href=
"http://www.iana.org/assignments/media-types/"><span class=
"citetitle"><cite>IANA MIME Media Types</cite></span></a>. Internet
Engineering Task Force.</p>
</div>
<div class="bibliomixed" id="tidy">
<p>[<span class="abbrev">HTML Tidy</span>] <a href=
"http://tidy.sourceforge.net/"><span class="citetitle"><cite>HTML
Tidy Library Project</cite></span></a>. SourceForge project.</p>
</div>
<div class="bibliomixed" id="tagsoup">
<p>[<span class="abbrev">TagSoup</span>] <a href=
"http://ccil.org/~cowan/XML/tagsoup/"><span class=
"citetitle"><cite>TagSoup - Just Keep On
Truckin'</cite></span></a>. John Cowan.</p>
</div>
<div class="bibliomixed" id="bib.uuid">
<p>[<span class="abbrev">UUID</span>] <a href=
"http://www.itu.int/ITU-T/studygroups/com17/oid.html"><span class=
"citetitle"><cite>ITU X.667: Information technology - Open Systems
Interconnection - Procedures for the operation of OSI Registration
Authorities: Generation and registration of Universally Unique
Identifiers (UUIDs) and their use as ASN.1 Object Identifier
components</cite></span></a>. 2004.</p>
</div>
<div class="bibliomixed" id="bib.sha">
<p>[<span class="abbrev">SHA1</span>] <a href=
"http://www.itl.nist.gov/fipspubs/fip180-1.htm"><span class=
"citetitle"><cite>Federal Information Processing Standards
Publication 180-1: Secure Hash Standard</cite></span></a>.
1995.</p>
</div>
</div>
</div>
<div class="section">
<h3><a name="informative-references" id=
"informative-references"></a>B.2&#160;Informative References</h3>
<div class="bibliolist">
<div class="bibliomixed" id="rfc4122">
<p>[<span class="abbrev">RFC 4122</span>] <a href=
"http://www.ietf.org/rfc/rfc4122.txt"><span class=
"citetitle"><cite>RFC 4122: A Universally Unique IDentifier (UUID)
URN Namespace</cite></span></a>. P. Leach and M. Mealling, editors.
Internet Engineering Task Force. July, 2005.</p>
</div>
<div class="bibliomixed" id="bib.crc">
<p>[<span class="abbrev">CRC32</span>] “32-Bit Cyclic Redundancy
Codes for Internet Applications”, <span class="citetitle"><cite>The
International Conference on Dependable Systems and Networks:
459</cite></span>. <span class=
"biblioid">10.1109/DSN.2002.1028931</span>. P. Koopman. June
2002.</p>
</div>
</div>
</div>
</div>
<div class="appendix">
<h2><a name="glossary" id="glossary"></a>C&#160;Glossary</h2>
<div class="glosslist">
<dl>
<dt><em class="glossterm"><a href=
"#dt-Namespaces-in-XML">Namespaces in XML</a></em></dt>
<dd>
<p>Unless otherwise noted, the term <em class=
"firstterm">Namespaces in XML</em> refers equally to [<a href=
"#xmlns10"><span class="abbrev">Namespaces 1.0</span></a>] and
[<a href="#xmlns11"><span class="abbrev">Namespaces
1.1</span></a>].</p>
</dd>
<dt><em class="glossterm"><a href="#dt-XML">XML</a></em></dt>
<dd>
<p>XProc is intended to work equally well with [<a href=
"#xml10"><span class="abbrev">XML 1.0</span></a>] and [<a href=
"#xml11"><span class="abbrev">XML 1.1</span></a>]. Unless otherwise
noted, the term “<em class="firstterm">XML</em>” refers equally to
both versions.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-ancestors">ancestors</a></em></dt>
<dd>
<p>The <em class="firstterm">ancestors</em> of a step, if it has
any, are its <em class="glossterm"><a href=
"#dt-container">container</a></em> and the ancestors of its
container.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-atomic-step">atomic
step</a></em></dt>
<dd>
<p>An <em class="firstterm">atomic step</em> is a step that
performs a unit of XML processing, such as XInclude or
transformation, and has no internal <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-bag-merger">bag-merger</a></em></dt>
<dd>
<p>The <em class="firstterm">bag-merger</em> of two or more bags
(where a bag is an unordered list or, equivalently, something like
a set except that it may contain duplicates) is a bag constructed
by starting with an empty bag and adding each member of each of the
input bags in turn to it. It follows that the cardinality of the
result is the sum of the cardinality of all the input bags.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-by-source">by
source</a></em></dt>
<dd>
<p>A document is specified <em class="firstterm">by source</em> if
it references a specific port on another step.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-by-URI">by URI</a></em></dt>
<dd>
<p>A document is specified <em class="firstterm">by URI</em> if it
is referenced with a URI.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-compound-step">compound
step</a></em></dt>
<dd>
<p>A <em class="firstterm">compound step</em> is a step that
contains a <em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-connection">connection</a></em></dt>
<dd>
<p>A <em class="firstterm">connection</em> associates an input or
output port with some data source.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-contained-steps">contained
steps</a></em></dt>
<dd>
<p>The steps that occur directly within, or within non-step
wrappers directly within, a step are called that step's <em class=
"firstterm">contained steps</em>. In other words, “container” and
“contained steps” are inverse relationships.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-container">container</a></em></dt>
<dd>
<p>A compound step or multi-container step is a <em class=
"firstterm">container</em> for the steps directly within it or
within non-step wrappers directly within it.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-declared-inputs">declared
inputs</a></em></dt>
<dd>
<p>The input ports declared on a step are its <em class=
"firstterm">declared inputs</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-declared-options">declared
options</a></em></dt>
<dd>
<p>The options declared on a step are its <em class=
"firstterm">declared options</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-declared-outputs">declared
outputs</a></em></dt>
<dd>
<p>The output ports declared on a step are its <em class=
"firstterm">declared outputs</em>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-default-readable-port">default readable port</a></em></dt>
<dd>
<p>The <em class="firstterm">default readable port</em>, which may
be undefined, is a specific step name/port name pair from the set
of readable ports.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-dynamic-error">dynamic
error</a></em></dt>
<dd>
<p>A <em class="firstterm">dynamic error</em> is one which occurs
while a pipeline is being evaluated.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-empty-environment">empty
environment</a></em></dt>
<dd>
<p>The <em class="firstterm">empty environment</em> contains no
readable ports, an undefined default readable port and no in-scope
bindings.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-empty-sequence">empty
sequence</a></em></dt>
<dd>
<p>An <em class="firstterm">empty sequence</em> of documents is
specified with the <a href="#p.empty"><tt class=
"tag-element">p:empty</tt></a> element.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-environment">environment</a></em></dt>
<dd>
<p>The <em class="firstterm">environment</em> is a
context-dependent collection of information available within
subpipelines.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-extension-attribute">extension attribute</a></em></dt>
<dd>
<p>An element from the XProc namespace <span class=
"rfc2119">may</span> have any attribute not from the XProc
namespace, provided that the expanded-QName of the attribute has a
non-null namespace URI. Such an attribute is called an <em class=
"firstterm">extension attribute</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-in-scope-bindings">in-scope
bindings</a></em></dt>
<dd>
<p>The <em class="firstterm">in-scope bindings</em> are a set of
name-value pairs, based on <em class="glossterm"><a href=
"#dt-option">option</a></em> and <em class="glossterm"><a href=
"#dt-variable">variable</a></em> bindings.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-inherited-environment">inherited environment</a></em></dt>
<dd>
<p>The <em class="firstterm">inherited environment</em> of a
<em class="glossterm"><a href="#dt-contained-steps">contained
step</a></em> is an environment that is the same as the environment
of its <em class="glossterm"><a href=
"#dt-container">container</a></em> with the <a href=
"#dt-standard-modifications">standard modifications</a>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-inline-document">inline
document</a></em></dt>
<dd>
<p>An <em class="firstterm">inline document</em> is specified
directly in the body of the element to which it connects.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-last-step">last
step</a></em></dt>
<dd>
<p>The <em class="firstterm">last step</em> in a subpipeline is its
last step in document order.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-matches">matches</a></em></dt>
<dd>
<p>A step <em class="firstterm">matches</em> its signature if and
only if it specifies an input for each declared input, it specifies
no inputs that are not declared, it specifies an option for each
option that is declared to be required, and it specifies no options
that are not declared.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-multi-container-step">multi-container step</a></em></dt>
<dd>
<p>A <em class="firstterm">multi-container step</em> is a step that
contains several alternate <em class="glossterm"><a href=
"#dt-subpipeline">subpipelines</a></em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-namespace-fixup">namespace
fixup</a></em></dt>
<dd>
<p>To produce a serializable <em class="glossterm"><a href=
"#dt-XML">XML</a></em> document, the XProc processor must sometimes
add additional namespace nodes, perhaps even renaming prefixes, to
satisfy the constraints of <em class="glossterm"><a href=
"#dt-Namespaces-in-XML">Namespaces in XML</a></em>. This process is
referred to as <em class="firstterm">namespace fixup</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-option">option</a></em></dt>
<dd>
<p>An <em class="firstterm">option</em> is a name/value pair where
the name is an <a href=
"http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded name</a>
and the value <span class="rfc2119">must</span> be a string or
<tt class="type">xs:untypedAtomic</tt>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-parameter">parameter</a></em></dt>
<dd>
<p>A <em class="firstterm">parameter</em> is a name/value pair
where the name is an <a href=
"http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded name</a>
and the value <span class="rfc2119">must</span> be a string or
<tt class="type">xs:untypedAtomic</tt>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-parameter-input-port">parameter input port</a></em></dt>
<dd>
<p>A <em class="firstterm">parameter input port</em> is a
distinguished kind of input port which accepts (only) dynamically
constructed parameter name/value pairs.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-pipeline">pipeline</a></em></dt>
<dd>
<p>A <em class="firstterm">pipeline</em> is a set of connected
steps, with outputs of one step flowing into inputs of another.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-primary-parameter-input-port">primary parameter input
port</a></em></dt>
<dd>
<p>If a step has a parameter input port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
parameter input port and that port is <em>not</em> explicitly
marked “<tt class="code">primary='false'</tt>”, then that parameter
input port is the <em class="firstterm">primary parameter input
port</em> of the step.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-primary-input-port">primary
input port</a></em></dt>
<dd>
<p>If a step has a document input port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
document input port and that port is <em>not</em> explicitly marked
<tt class="code">primary='false'</tt>”, then that input port is
the <em class="firstterm">primary input port</em> of the step.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-primary-output-port">primary
output port</a></em></dt>
<dd>
<p>If a step has a document output port which is explicitly marked
<tt class="code">primary='true'</tt>”, or if it has exactly one
document output port and that port is <em>not</em> explicitly
marked “<tt class="code">primary='false'</tt>”, then that output
port is the <em class="firstterm">primary output port</em> of the
step.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-readable-ports">readable
ports</a></em></dt>
<dd>
<p>The <em class="firstterm">readable ports</em> are a set of step
name/port name pairs.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-signature">signature</a></em></dt>
<dd>
<p>The <em class="firstterm">signature</em> of a step is the set of
inputs, outputs, and options that it is declared to accept.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-specified-options">specified
options</a></em></dt>
<dd>
<p>The options on a step which have specified values, either
because a <a href="#p.with-option"><tt class=
"tag-element">p:with-option</tt></a> element specifies a value or
because the declaration included a default value, are its
<em class="firstterm">specified options</em>.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-static-error">static
error</a></em></dt>
<dd>
<p>A <em class="firstterm">static error</em> is one which can be
detected before pipeline evaluation is even attempted.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-step">step</a></em></dt>
<dd>
<p>A <em class="firstterm">step</em> is the basic computational
unit of a pipeline.</p>
</dd>
<dt><em class="glossterm"><a href="#dt-step-type-exports">step type
exports</a></em></dt>
<dd>
<p>The <em class="firstterm">step type exports</em> of an XProc
element, against the background of a set of URIs of resources
already visited (call this set <em>Visited</em>), are defined by
cases.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-subpipeline">subpipeline</a></em></dt>
<dd>
<p>Sibling steps (and the connections between them) form a
<em class="firstterm">subpipeline</em>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-variable">variable</a></em></dt>
<dd>
<p>A <em class="firstterm">variable</em> is a name/value pair where
the name is an <a href=
"http://www.w3.org/TR/REC-xml-names/#dt-expname">expanded name</a>
and the value <span class="rfc2119">must</span> be a string or
<tt class="type">xs:untypedAtomic</tt>.</p>
</dd>
<dt><em class="glossterm"><a href=
"#dt-visible">visible</a></em></dt>
<dd>
<p>If two names are in the same scope, we say that they are
<em class="firstterm">visible</em> to each other.</p>
</dd>
</dl>
</div>
</div>
<div class="appendix">
<h2><a name="language-summary" id=
"language-summary"></a>D&#160;Pipeline Language Summary</h2>
<p>This appendix summarizes the XProc pipeline language. Machine
readable descriptions of this language are available in <a href=
"schemas/xproc.rng">RELAX NG</a> (and the RELAX NG <a href=
"schemas/xproc.rnc">compact syntax</a>), <a href=
"schemas/xproc.xsd">W3C XML Schema</a>, and <a href=
"schemas/xproc.dtd">DTD</a> syntaxes.</p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipeline<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.option">p:option</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.serialization">p:serialization</a>)*,<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.pipeline">p:pipeline</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.import">p:import</a>)*,<br />
&#160;&#160;&#160;&#160;<var>subpipeline</var><br />
&lt;/p:pipeline&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:for-each<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.iteration-source">p:iteration-source</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*),<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:for-each&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:viewport<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;<strong>match</strong> =
<var>XSLTMatchPattern</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.viewport-source">p:viewport-source</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.output">p:output</a>? &amp;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>?),<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:viewport&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:choose<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.xpath-context">p:xpath-context</a>?,<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.variable">p:variable</a>*,<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.when">p:when</a>*,<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.otherwise">p:otherwise</a>?)<br />
&lt;/p:choose&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:xpath-context&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)<br />
&lt;/p:xpath-context&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:when<br />
&#160;&#160;<strong>test</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.xpath-context">p:xpath-context</a>?,<br />
&#160;&#160;&#160;&#160;&#160;(<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:when&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:otherwise&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:otherwise&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:group<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:group&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:try<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href=
"#p.variable">p:variable</a>*,<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.group">p:group</a>,<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.catch">p:catch</a>)<br />
&lt;/p:try&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:catch<br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.output">p:output</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.log">p:log</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)<br />
&lt;/p:catch&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;<var>p:atomic-step</var><br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-option">p:with-option</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-param">p:with-param</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a>)*<br />
&lt;/<var>p:atomic-step</var>&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;<var>pfx:atomic-step</var><br />
&#160;&#160;name? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-option">p:with-option</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.with-param">p:with-param</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a>)*<br />
&lt;/<var>pfx:atomic-step</var>&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var><br />
&#160;&#160;kind? = "document"<br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:input<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var><br />
&#160;&#160;<strong>kind</strong> = "parameter"&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a>)+)?<br />
&lt;/p:input&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:iteration-source<br />
&#160;&#160;select? = <var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:iteration-source&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:viewport-source&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)?<br />
&lt;/p:viewport-source&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:output<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:output<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;sequence? = <var>boolean</var><br />
&#160;&#160;primary? = <var>boolean</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;(<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.data">p:data</a>)+)?<br />
&lt;/p:output&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:log<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;href? = <var>anyURI</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:serialization<br />
&#160;&#160;<strong>port</strong> = <var>NCName</var><br />
&#160;&#160;byte-order-mark? = <var>boolean</var><br />
&#160;&#160;cdata-section-elements? = <var>NMTOKENS</var><br />
&#160;&#160;doctype-public? = <var>string</var><br />
&#160;&#160;doctype-system? = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var><br />
&#160;&#160;escape-uri-attributes? = <var>boolean</var><br />
&#160;&#160;include-content-type? = <var>boolean</var><br />
&#160;&#160;indent? = <var>boolean</var><br />
&#160;&#160;media-type? = <var>string</var><br />
&#160;&#160;method? = <var>QName</var><br />
&#160;&#160;normalization-form? =
<var>NFC|NFD|NFKC|NFKD|fully-normalized|none|xs:NMTOKEN</var><br />
&#160;&#160;omit-xml-declaration? = <var>boolean</var><br />
&#160;&#160;standalone? = <var>true|false|omit</var><br />
&#160;&#160;undeclare-prefixes? = <var>boolean</var><br />
&#160;&#160;version? = <var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:variable<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:variable&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;required? = <var>boolean</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;required? = <var>boolean</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:with-option<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:with-option&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:with-param<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;<strong>select</strong> =
<var>XPathExpression</var><br />
&#160;&#160;port? = <var>NCName</var>&gt;<br />
&#160;&#160;&#160;&#160;((<a href="#p.empty">p:empty</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.pipe">p:pipe</a>
|<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.document">p:document</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.inline">p:inline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href="#p.data">p:data</a>)?
&amp;<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.namespaces">p:namespaces</a>*)<br />
&lt;/p:with-param&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:namespaces<br />
&#160;&#160;binding? = <var>QName</var><br />
&#160;&#160;element? = <var>XPathExpression</var><br />
&#160;&#160;except-prefixes? = <var>prefix
list</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:declare-step<br />
&#160;&#160;name? = <var>NCName</var><br />
&#160;&#160;type? = <var>QName</var><br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.input">p:input</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.output">p:output</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.option">p:option</a>
|<br />
&#160;&#160;&#160;&#160;&#160;<a href="#p.log">p:log</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.serialization">p:serialization</a>)*,<br />
&#160;&#160;&#160;&#160;((<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.pipeline">p:pipeline</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#p.import">p:import</a>)*,<br />
&#160;&#160;&#160;&#160;&#160;<var>subpipeline</var>)?<br />
&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:library<br />
&#160;&#160;psvi-required? = <var>boolean</var><br />
&#160;&#160;xpath-version? = <var>string</var><br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix list</var><br />
&#160;&#160;version? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#p.import">p:import</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.declare-step">p:declare-step</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#p.pipeline">p:pipeline</a>)*<br />
&lt;/p:library&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:import<br />
&#160;&#160;<strong>href</strong> =
<var>anyURI</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipe<br />
&#160;&#160;<strong>step</strong> = <var>NCName</var><br />
&#160;&#160;<strong>port</strong> =
<var>NCName</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:inline<br />
&#160;&#160;exclude-inline-prefixes? = <var>prefix
list</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>anyElement</var><br />
&lt;/p:inline&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:document<br />
&#160;&#160;<strong>href</strong> =
<var>anyURI</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:data<br />
&#160;&#160;<strong>href</strong> = <var>anyURI</var><br />
&#160;&#160;wrapper? = <var>QName</var><br />
&#160;&#160;wrapper-prefix? = <var>string</var><br />
&#160;&#160;wrapper-namespace? = <var>string</var><br />
&#160;&#160;content-type? = <var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:empty&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:documentation&gt;<br />
&#160;&#160;&#160;&#160;<var>any-well-formed-content</var>*<br />
&lt;/p:documentation&gt;</code></p>
<p class="element-syntax element-syntax-language-construct">
<code>&lt;p:pipeinfo&gt;<br />
&#160;&#160;&#160;&#160;<var>any-well-formed-content</var>*<br />
&lt;/p:pipeinfo&gt;</code></p>
<p>The core steps are also summarized here.</p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:add-attribute</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-name</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-value</code><code>"</code>
<code class="attr required-attr">required</code><code>="</code><code class="value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:add-xml-base</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">all</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">relative</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:compare</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">alternate</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fail-if-not-equal</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:count</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">limit</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">0</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:delete</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:directory-list</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">path</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-filter</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">RegularExpression</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">exclude-filter</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">RegularExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:error</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">code-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:escape-markup</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:filter</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">select</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:http-request</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:identity</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:insert</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">insertion</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'/*'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">position</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"first-child"
| "last-child" | "before" | "after"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:label-elements</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml:id'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">attribute-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">label</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'concat("_",$p:index)'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'*'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">replace</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:load</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-validate</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:make-absolute-uris</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">base-uri</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:namespace-rename</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">from</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">to</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">apply-to</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'all'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"all"
| "elements" | "attributes"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:pack</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">alternate</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:parameters</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:rename</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-name</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">new-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:replace</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">replacement</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:set-attributes</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">attributes</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:sink</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:split-sequence</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">matched</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">not-matched</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">initial-only</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">test</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:store</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:string-replace</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">replace</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:unescape-markup</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">content-type</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'application/xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">charset</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:unwrap</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:wrap</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">group-adjacent</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:wrap-sequence</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-prefix</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NCName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrapper-namespace</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">group-adjacent</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XPathExpression</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xinclude</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fixup-xml-base</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">fixup-xml-lang</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-rqd">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xslt</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">stylesheet</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">secondary</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">initial-mode</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">template-name</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">output-base-uri</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>As are the optional steps.</p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:exec</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">errors</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">exit-status</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">command</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">args</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cwd</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">source-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">result-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrap-result-lines</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">errors-is-xml</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">wrap-error-lines</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">path-separator</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">failure-threshold</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">arg-separator</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'
'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">byte-order-mark</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">cdata-section-elements</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">''</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">ListOfQNames</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-public</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">doctype-system</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">encoding</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">escape-uri-attributes</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">include-content-type</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">indent</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">media-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">method</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'xml'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">normalization-form</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'none'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">NormalizationForm</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">omit-xml-declaration</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">standalone</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'omit'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"true"
| "false" | "omit"</span><code class=
"comment">&#160;--&gt;</code></span><br />
&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">undeclare-prefixes</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'1.0'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:hash</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">value</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">algorithm</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">QName</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:uuid</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">version</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">integer</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-relax-ng</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-attribute-values</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">dtd-id-idref-warnings</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-schematron</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">report</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">phase</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'#ALL'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:validate-with-xml-schema</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">schema</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">use-location-hints</code><code>"</code>
<code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">try-namespaces</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'false'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">assert-valid</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'true'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">boolean</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">mode</code><code>"</code> <code class=
"attr select-attr">select</code><code>="</code><code class=
"value select-value">'strict'</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">"strict"
| "lax"</span><code class=
"comment">&#160;--&gt;</code></span><br />
<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:www-form-urldecode</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">value</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:www-form-urlencode</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">match</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">XSLTMatchPattern</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xquery</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">true</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">query</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr sequence-attr">sequence</code><code>="</code><code class=
"value sequence-value">true</code><code>"</code><code>/&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p class="element-syntax element-syntax-declare-step-opt">
<span class="decl"><code>&lt;p:declare-step</code> <code class=
"attr type-attr">type</code><code>="</code><code class=
"value type-value">p:xsl-formatter</code><code>"</code><code>&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">source</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:input</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">parameters</code><code>"</code> <code class=
"attr kind-attr">kind</code><code>="</code><code class=
"value kind-value">parameter</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"input"><code>&lt;p:output</code> <code class=
"attr port-attr">port</code><code>="</code><code class=
"value port-value">result</code><code>"</code> <code class=
"attr primary-attr">primary</code><code>="</code><code class=
"value primary-value">false</code><code>"</code><code>/&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-req"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">href</code><code>"</code> <code class=
"attr required-attr">required</code><code>="</code><code class=
"value required-value">true</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">anyURI</span><code class="comment">&#160;--&gt;</code></span><br />

&#160;&#160;&#160;&#160;&#160;<span class=
"opt-opt"><code>&lt;p:option</code> <code class=
"attr name-attr">name</code><code>="</code><code class=
"value name-value">content-type</code><code>"</code><code>/&gt;</code><code>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</code><code class="comment">&lt;!--&#160;</code><span class="opt-type">string</span><code class="comment">&#160;--&gt;</code></span><br />

<code>&lt;/p:declare-step&gt;</code></p>
<p>And the step vocabulary elements.</p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:param<br />
&#160;&#160;<strong>name</strong> = <var>QName</var><br />
&#160;&#160;namespace? = <var>anyURI</var><br />
&#160;&#160;<strong>value</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:param-set&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.param">c:param</a>*<br />
&lt;/c:param-set&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:data<br />
&#160;&#160;content-type? = <var>string</var><br />
&#160;&#160;charset? = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:data&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:result&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:result&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:directory<br />
&#160;&#160;<strong>name</strong> = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.file">c:file</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.directory">c:directory</a> |<br />
&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.other">c:other</a>)*<br />
&lt;/c:directory&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:file<br />
&#160;&#160;<strong>name</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:other<br />
&#160;&#160;<strong>name</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:request<br />
&#160;&#160;<strong>method</strong> = <var>NCName</var><br />
&#160;&#160;href? = <var>anyURI</var><br />
&#160;&#160;detailed? = <var>boolean</var><br />
&#160;&#160;status-only? = <var>boolean</var><br />
&#160;&#160;username? = <var>string</var><br />
&#160;&#160;password? = <var>string</var><br />
&#160;&#160;auth-method? = <var>string</var><br />
&#160;&#160;send-authorization? = <var>boolean</var><br />
&#160;&#160;override-content-type? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.header">c:header</a>*,<br />
&#160;&#160;&#160;&#160;&#160;(<a href=
"#cv.multipart">c:multipart</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.body">c:body</a>)?)<br />
&lt;/c:request&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:header<br />
&#160;&#160;<strong>name</strong> = <var>string</var><br />
&#160;&#160;<strong>value</strong> =
<var>string</var>&#160;/&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:multipart<br />
&#160;&#160;<strong>content-type</strong> = <var>string</var><br />
&#160;&#160;<strong>boundary</strong> = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<a href="#cv.body">c:body</a>+<br />
&lt;/c:multipart&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:body<br />
&#160;&#160;<strong>content-type</strong> = <var>string</var><br />
&#160;&#160;encoding? = <var>string</var><br />
&#160;&#160;id? = <var>string</var><br />
&#160;&#160;description? = <var>string</var><br />
&#160;&#160;disposition? = <var>string</var>&gt;<br />
&#160;&#160;&#160;&#160;<var>anyElement</var>*<br />
&lt;/c:body&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:response<br />
&#160;&#160;status? = <var>integer</var>&gt;<br />
&#160;&#160;&#160;&#160;(<a href="#cv.header">c:header</a>*,<br />
&#160;&#160;&#160;&#160;&#160;(<a href=
"#cv.multipart">c:multipart</a> |<br />
&#160;&#160;&#160;&#160;&#160;&#160;<a href=
"#cv.body">c:body</a>)?)<br />
&lt;/c:response&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:line&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:line&gt;</code></p>
<p class="element-syntax element-syntax-step-vocabulary">
<code>&lt;c:query&gt;<br />
&#160;&#160;&#160;&#160;<var>string</var><br />
&lt;/c:query&gt;</code></p>
</div>
<div class="appendix">
<h2><a name="errors-list" id="errors-list"></a>E&#160;List of Error
Codes</h2>
<p>The following error codes are defined by this specification.</p>
<div class="section">
<h3><a name="app.static-errors" id=
"app.static-errors"></a>E.1&#160;Static Errors</h3>
<p>The following <em class="glossterm"><a href=
"#dt-static-error">static errors</a></em> are defined:</p>
<div id="static-error-summary">
<h5>Static Errors</h5>
<dl class="errs">
<dt><a name="err.S0001" id="err.S0001"></a><code class=
"errqname">err:XS0001</code></dt>
<dd>
<p>It is a static error if there are any loops in the connections
between steps: no step can be connected to itself nor can there be
any sequence of connections through other steps that leads back to
itself.</p>
<p>See: <a href="#err.inline.S0001">Connections</a></p>
</dd>
<dt><a name="err.S0002" id="err.S0002"></a><code class=
"errqname">err:XS0002</code></dt>
<dd>
<p>All steps in the same scope must have unique names: it is a
static error if two steps with the same name appear in the same
scope.</p>
<p>See: <a href="#err.inline.S0002">Scoping of Names</a></p>
</dd>
<dt><a name="err.S0003" id="err.S0003"></a><code class=
"errqname">err:XS0003</code></dt>
<dd>
<p>It is a static error if any declared input is not connected.</p>
<p>See: <a href="#err.inline.S0003">Inputs and Outputs</a></p>
</dd>
<dt><a name="err.S0004" id="err.S0004"></a><code class=
"errqname">err:XS0004</code></dt>
<dd>
<p>It is a static error if an option or variable declaration
duplicates the name of any other option or variable in the same
environment.</p>
<p>See: <a href="#err.inline.S0004">Scoping of Names</a>, <a href=
"#err.inline.S0004.1">p:option</a>, <a href=
"#err.inline.S0004.2">p:with-option</a></p>
</dd>
<dt><a name="err.S0005" id="err.S0005"></a><code class=
"errqname">err:XS0005</code></dt>
<dd>
<p>It is a static error if the primary output port of any step is
not connected.</p>
<p>See: <a href="#err.inline.S0005">Inputs and Outputs</a></p>
</dd>
<dt><a name="err.S0006" id="err.S0006"></a><code class=
"errqname">err:XS0006</code></dt>
<dd>
<p>It is a static error if the primary output port has no explicit
connection and the last step in the subpipeline does not have a
primary output port.</p>
<p>See: <a href="#err.inline.S0006">p:for-each</a>, <a href=
"#err.inline.S0006.1">p:viewport</a>, <a href=
"#err.inline.S0006.2">Declaring pipelines</a></p>
</dd>
<dt><a name="err.S0007" id="err.S0007"></a><code class=
"errqname">err:XS0007</code></dt>
<dd>
<p>It is a static error if two subpipelines in a p:choose declare
different outputs.</p>
<p>See: <a href="#err.inline.S0007">p:choose</a></p>
</dd>
<dt><a name="err.S0008" id="err.S0008"></a><code class=
"errqname">err:XS0008</code></dt>
<dd>
<p>It is a static error if any element in the XProc namespace has
attributes not defined by this specification unless they are
extension attributes.</p>
<p>See: <a href="#err.inline.S0008">Common errors</a></p>
</dd>
<dt><a name="err.S0009" id="err.S0009"></a><code class=
"errqname">err:XS0009</code></dt>
<dd>
<p>It is a static error if the p:group and p:catch subpipelines
declare different outputs.</p>
<p>See: <a href="#err.inline.S0009">p:try</a></p>
</dd>
<dt><a name="err.S0010" id="err.S0010"></a><code class=
"errqname">err:XS0010</code></dt>
<dd>
<p>It is a static error if a pipeline contains a step whose
specified inputs, outputs, and options do not match the signature
for steps of that type.</p>
<p>See: <a href="#err.inline.S0010">Extension Steps</a></p>
</dd>
<dt><a name="err.S0011" id="err.S0011"></a><code class=
"errqname">err:XS0011</code></dt>
<dd>
<p>It is a static error to identify two ports with the same name on
the same step.</p>
<p>See: <a href="#err.inline.S0011">Document Inputs</a>, <a href=
"#err.inline.S0011.1">Parameter Inputs</a>, <a href=
"#err.inline.S0011.2">p:output</a></p>
</dd>
<dt><a name="err.S0014" id="err.S0014"></a><code class=
"errqname">err:XS0014</code></dt>
<dd>
<p>It is a static error to identify more than one output port as
primary.</p>
<p>See: <a href="#err.inline.S0014">p:output</a></p>
</dd>
<dt><a name="err.S0015" id="err.S0015"></a><code class=
"errqname">err:XS0015</code></dt>
<dd>
<p>It is a static error if a compound step has no contained
steps.</p>
<p>See: <a href="#err.inline.S0015">Common errors</a></p>
</dd>
<dt><a name="err.S0017" id="err.S0017"></a><code class=
"errqname">err:XS0017</code></dt>
<dd>
<p>It is a static error to specify that an option is both required
and has a default value.</p>
<p>See: <a href="#err.inline.S0017">p:option</a></p>
</dd>
<dt><a name="err.S0018" id="err.S0018"></a><code class=
"errqname">err:XS0018</code></dt>
<dd>
<p>If an option is required, it is a static error to invoke the
step without specifying a value for that option.</p>
<p>See: <a href="#err.inline.S0018">p:option</a></p>
</dd>
<dt><a name="err.S0019" id="err.S0019"></a><code class=
"errqname">err:XS0019</code></dt>
<dd>
<p>it is a static error for a variable's document connection to
refer to the output port of any step in the surrounding container's
contained steps</p>
<p>See: <a href="#err.inline.S0019">p:variable</a></p>
</dd>
<dt><a name="err.S0020" id="err.S0020"></a><code class=
"errqname">err:XS0020</code></dt>
<dd>
<p>It is a static error if the binding attribute on p:namespaces is
specified and its value is not the name of an in-scope binding.</p>
<p>See: <a href="#err.inline.S0020">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.S0022" id="err.S0022"></a><code class=
"errqname">err:XS0022</code></dt>
<dd>
<p>In all cases except the p:output of a compound step, it is a
static error if the port identified by a p:pipe is not in the
readable ports of the step that contains the p:pipe.</p>
<p>See: <a href="#err.inline.S0022">p:pipe</a></p>
</dd>
<dt><a name="err.S0024" id="err.S0024"></a><code class=
"errqname">err:XS0024</code></dt>
<dd>
<p>It is a static error if the content of the p:inline element does
not consist of exactly one element, optionally preceded and/or
followed by any number of processing instructions, comments or
whitespace characters.</p>
<p>See: <a href="#err.inline.S0024">p:inline</a></p>
</dd>
<dt><a name="err.S0025" id="err.S0025"></a><code class=
"errqname">err:XS0025</code></dt>
<dd>
<p>It is a static error if the expanded-QName value of the type
attribute is in no namespace or in the XProc namespace.</p>
<p>See: <a href="#err.inline.S0025">p:declare-step</a></p>
</dd>
<dt><a name="err.S0026" id="err.S0026"></a><code class=
"errqname">err:XS0026</code></dt>
<dd>
<p>It is a static error if the port specified on the p:log is not
the name of an output port on the step in which it appears or if
more than one p:log element is applied to the same port.</p>
<p>See: <a href="#err.inline.S0026">p:log</a></p>
</dd>
<dt><a name="err.S0027" id="err.S0027"></a><code class=
"errqname">err:XS0027</code></dt>
<dd>
<p>It is a static error if an option is specified with both the
shortcut form and the long form.</p>
<p>See: <a href="#err.inline.S0027">Syntactic Shortcut for Option
Values</a></p>
</dd>
<dt><a name="err.S0028" id="err.S0028"></a><code class=
"errqname">err:XS0028</code></dt>
<dd>
<p>It is a static error to declare an option or variable in the
XProc namespace.</p>
<p>See: <a href="#err.inline.S0028">p:variable</a>, <a href=
"#err.inline.S0028.1">p:option</a></p>
</dd>
<dt><a name="err.S0029" id="err.S0029"></a><code class=
"errqname">err:XS0029</code></dt>
<dd>
<p>It is a static error to specify a connection for a p:output
inside a p:declare-step for an atomic step.</p>
<p>See: <a href="#err.inline.S0029">p:output</a></p>
</dd>
<dt><a name="err.S0030" id="err.S0030"></a><code class=
"errqname">err:XS0030</code></dt>
<dd>
<p>It is a static error to specify that more than one input port is
the primary.</p>
<p>See: <a href="#err.inline.S0030">Document Inputs</a>, <a href=
"#err.inline.S0030.1">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0031" id="err.S0031"></a><code class=
"errqname">err:XS0031</code></dt>
<dd>
<p>It is a static error to use an option on an atomic step that is
not declared on steps of that type.</p>
<p>See: <a href="#err.inline.S0031">Syntactic Shortcut for Option
Values</a>, <a href="#err.inline.S0031.1">p:with-option</a></p>
</dd>
<dt><a name="err.S0032" id="err.S0032"></a><code class=
"errqname">err:XS0032</code></dt>
<dd>
<p>It is a static error if no connection is provided and the
default readable port is undefined.</p>
<p>See: <a href="#err.inline.S0032">Document Inputs</a></p>
</dd>
<dt><a name="err.S0033" id="err.S0033"></a><code class=
"errqname">err:XS0033</code></dt>
<dd>
<p>It is a static error to specify any kind of input other than
“document” or “parameter”.</p>
<p>See: <a href="#err.inline.S0033">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0034" id="err.S0034"></a><code class=
"errqname">err:XS0034</code></dt>
<dd>
<p>It is a static error if the specified port is not a parameter
input port or if no port is specified and the step does not have a
primary parameter input port.</p>
<p>See: <a href="#err.inline.S0034">p:with-param</a></p>
</dd>
<dt><a name="err.S0035" id="err.S0035"></a><code class=
"errqname">err:XS0035</code></dt>
<dd>
<p>It is a static error if the declaration of a parameter input
port contains a connection; parameter input port declarations must
be empty.</p>
<p>See: <a href="#err.inline.S0035">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0036" id="err.S0036"></a><code class=
"errqname">err:XS0036</code></dt>
<dd>
<p>All the step types in a pipeline or library must have unique
names: it is a static error if any step type name is built-in
and/or declared or defined more than once in the same scope.</p>
<p>See: <a href="#err.inline.S0036">Scoping of Names</a>, <a href=
"#err.inline.S0036.1">Handling Circular and Re-entrant Library
Imports (Non-Normative)</a>, <a href="#err.inline.S0036.2">Handling
Circular and Re-entrant Library Imports (Non-Normative)</a>,
<a href="#err.inline.S0036.3">Handling Circular and Re-entrant
Library Imports (Non-Normative)</a></p>
</dd>
<dt><a name="err.S0037" id="err.S0037"></a><code class=
"errqname">err:XS0037</code></dt>
<dd>
<p>It is a static error if any step directly contains text nodes
that do not consist entirely of whitespace.</p>
<p>See: <a href="#err.inline.S0037">Common errors</a></p>
</dd>
<dt><a name="err.S0038" id="err.S0038"></a><code class=
"errqname">err:XS0038</code></dt>
<dd>
<p>It is a static error if any required attribute is not
provided.</p>
<p>See: <a href="#err.inline.S0038">Common errors</a></p>
</dd>
<dt><a name="err.S0039" id="err.S0039"></a><code class=
"errqname">err:XS0039</code></dt>
<dd>
<p>It is a static error if the port specified on the
p:serialization is not the name of an output port on the pipeline
in which it appears or if more than one p:serialization element is
applied to the same port.</p>
<p>See: <a href="#err.inline.S0039">p:serialization</a></p>
</dd>
<dt><a name="err.S0040" id="err.S0040"></a><code class=
"errqname">err:XS0040</code></dt>
<dd>
<p>It is a static error to specify any value other than true.</p>
<p>See: <a href="#err.inline.S0040">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0041" id="err.S0041"></a><code class=
"errqname">err:XS0041</code></dt>
<dd>
<p>It is a static error to specify both binding and element on the
same p:namespaces element.</p>
<p>See: <a href="#err.inline.S0041">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.S0042" id="err.S0042"></a><code class=
"errqname">err:XS0042</code></dt>
<dd>
<p>It is a static error to attempt to provide a connection for an
input port on the declaration of an atomic step.</p>
<p>See: <a href="#err.inline.S0042">Document Inputs</a></p>
</dd>
<dt><a name="err.S0044" id="err.S0044"></a><code class=
"errqname">err:XS0044</code></dt>
<dd>
<p>It is a static error if any element in the XProc namespace or
any step has element children other than those specified for it by
this specification. In particular, the presence of atomic steps for
which there is no visible declaration may raise this error.</p>
<p>See: <a href="#err.inline.S0044">Common errors</a></p>
</dd>
<dt><a name="err.S0048" id="err.S0048"></a><code class=
"errqname">err:XS0048</code></dt>
<dd>
<p>It is a static error to use a declared step as a compound
step.</p>
<p>See: <a href="#err.inline.S0048">Extension Steps</a></p>
</dd>
<dt><a name="err.S0051" id="err.S0051"></a><code class=
"errqname">err:XS0051</code></dt>
<dd>
<p>It is a static error if the except-prefixes attribute on
p:namespaces does not contain a list of tokens or if any of those
tokens is not a prefix bound to a namespace in the in-scope
namespaces of the p:namespaces element.</p>
<p>See: <a href="#err.inline.S0051">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.S0052" id="err.S0052"></a><code class=
"errqname">err:XS0052</code></dt>
<dd>
<p>It is a static error if the URI of a p:import cannot be
retrieved or if, once retrieved, it does not point to a p:library,
p:declare-step, or p:pipeline.</p>
<p>See: <a href="#err.inline.S0052">p:import</a></p>
</dd>
<dt><a name="err.S0053" id="err.S0053"></a><code class=
"errqname">err:XS0053</code></dt>
<dd>
<p>It is a static error to import a single pipeline if that
pipeline does not have a type.</p>
<p>See: <a href="#err.inline.S0053">p:import</a></p>
</dd>
<dt><a name="err.S0055" id="err.S0055"></a><code class=
"errqname">err:XS0055</code></dt>
<dd>
<p>It is a static error if a primary parameter input port is
unconnected and the pipeline that contains the step has no primary
parameter input port unless at least one explicit p:with-param is
provided for that port.</p>
<p>See: <a href="#err.inline.S0055">Parameter Inputs</a></p>
</dd>
<dt><a name="err.S0057" id="err.S0057"></a><code class=
"errqname">err:XS0057</code></dt>
<dd>
<p>It is a static error if the exclude-inline-prefixes attribute
does not contain a list of tokens or if any of those tokens (except
#all or #default) is not a prefix bound to a namespace in the
in-scope namespaces of the element on which it occurs.</p>
<p>See: <a href="#err.inline.S0057">p:inline</a></p>
</dd>
<dt><a name="err.S0058" id="err.S0058"></a><code class=
"errqname">err:XS0058</code></dt>
<dd>
<p>It is a static error if the value #default is used within the
exclude-inline-prefixes attribute and there is no default namespace
in scope.</p>
<p>See: <a href="#err.inline.S0058">p:inline</a></p>
</dd>
<dt><a name="err.S0059" id="err.S0059"></a><code class=
"errqname">err:XS0059</code></dt>
<dd>
<p>It is a static error if the pipeline element is not p:pipeline,
p:declare-step, or p:library.</p>
<p>See: <a href="#err.inline.S0059">Common errors</a></p>
</dd>
<dt><a name="err.S0060" id="err.S0060"></a><code class=
"errqname">err:XS0060</code></dt>
<dd>
<p>It is a static error if the processor encounters an explicit
request for a previous version of the language and it is unable to
process the pipeline using those semantics.</p>
<p>See: <a href="#err.inline.S0060">Backwards-compatible
Mode</a></p>
</dd>
<dt><a name="err.S0061" id="err.S0061"></a><code class=
"errqname">err:XS0061</code></dt>
<dd>
<p>It is a static error if a use-when expression refers to the
context or attempts to refer to any documents or collections.</p>
<p>See: <a href="#err.inline.S0061">Conditional Element
Exclusion</a></p>
</dd>
<dt><a name="err.S0062" id="err.S0062"></a><code class=
"errqname">err:XS0062</code></dt>
<dd>
<p>It is a static error if a required version attribute is not
present.</p>
<p>See: <a href="#err.inline.S0062">Versioning
Considerations</a></p>
</dd>
<dt><a name="err.S0063" id="err.S0063"></a><code class=
"errqname">err:XS0063</code></dt>
<dd>
<p>It is a static error if the value of the version attribute is
not a xs:decimal.</p>
<p>See: <a href="#err.inline.S0063">Versioning
Considerations</a></p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h3><a name="app.dynamic-errors" id=
"app.dynamic-errors"></a>E.2&#160;Dynamic Errors</h3>
<p>The following <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic errors</a></em> are defined:</p>
<div id="dynamic-error-summary">
<h5>Dynamic Errors</h5>
<dl class="errs">
<dt><a name="err.D0001" id="err.D0001"></a><code class=
"errqname">err:XD0001</code></dt>
<dd>
<p>It is a dynamic error if a non-XML resource is produced on a
step output or arrives on a step input.</p>
<p>See: <a href="#err.inline.D0001">Inputs and Outputs</a></p>
</dd>
<dt><a name="err.D0003" id="err.D0003"></a><code class=
"errqname">err:XD0003</code></dt>
<dd>
<p>It is a dynamic error if the viewport source does not provide
exactly one document.</p>
<p>See: <a href="#err.inline.D0003">p:viewport</a>, <a href=
"#err.inline.D0003.1">p:viewport-source</a></p>
</dd>
<dt><a name="err.D0004" id="err.D0004"></a><code class=
"errqname">err:XD0004</code></dt>
<dd>
<p>It is a dynamic error if no subpipeline is selected by the
p:choose and no default is provided.</p>
<p>See: <a href="#err.inline.D0004">p:choose</a></p>
</dd>
<dt><a name="err.D0005" id="err.D0005"></a><code class=
"errqname">err:XD0005</code></dt>
<dd>
<p>It is a dynamic error if more than one document appears on the
connection for the xpath-context.</p>
<p>See: <a href="#err.inline.D0005">p:xpath-context</a></p>
</dd>
<dt><a name="err.D0006" id="err.D0006"></a><code class=
"errqname">err:XD0006</code></dt>
<dd>
<p>If sequence is not specified, or has the value false, then it is
a dynamic error unless exactly one document appears on the declared
port.</p>
<p>See: <a href="#err.inline.D0006">Document Inputs</a>, <a href=
"#err.inline.D0006.1">p:exec</a></p>
</dd>
<dt><a name="err.D0007" id="err.D0007"></a><code class=
"errqname">err:XD0007</code></dt>
<dd>
<p>If sequence is not specified on p:output, or has the value
false, then it is a dynamic error if the step does not produce
exactly one document on the declared port.</p>
<p>See: <a href="#err.inline.D0007">p:output</a></p>
</dd>
<dt><a name="err.D0008" id="err.D0008"></a><code class=
"errqname">err:XD0008</code></dt>
<dd>
<p>It is a dynamic error if a document sequence appears where a
document to be used as the context node is expected.</p>
<p>See: <a href="#err.inline.D0008">Processor XPath Context</a>,
<a href="#err.inline.D0008.1">Processor XPath Context</a>, <a href=
"#err.inline.D0008.2">p:variable</a>, <a href=
"#err.inline.D0008.3">p:with-option</a>, <a href=
"#err.inline.D0008.4">p:with-param</a></p>
</dd>
<dt><a name="err.D0009" id="err.D0009"></a><code class=
"errqname">err:XD0009</code></dt>
<dd>
<p>It is a dynamic error if the element attribute on p:namespaces
is specified and it does not identify a single element node.</p>
<p>See: <a href="#err.inline.D0009">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.D0010" id="err.D0010"></a><code class=
"errqname">err:XD0010</code></dt>
<dd>
<p>It is a dynamic error if the match expression on p:viewport does
not match an element or document.</p>
<p>See: <a href="#err.inline.D0010">p:viewport</a></p>
</dd>
<dt><a name="err.D0011" id="err.D0011"></a><code class=
"errqname">err:XD0011</code></dt>
<dd>
<p>It is a dynamic error if the resource referenced by a p:document
element does not exist, cannot be accessed, or is not a well-formed
XML document.</p>
<p>See: <a href="#err.inline.D0011">p:document</a></p>
</dd>
<dt><a name="err.D0012" id="err.D0012"></a><code class=
"errqname">err:XD0012</code></dt>
<dd>
<p>It is a dynamic error if any attempt is made to dereference a
URI where the scheme of the URI reference is not supported.</p>
<p>See: <a href="#err.inline.D0012">Common errors</a></p>
</dd>
<dt><a name="err.D0013" id="err.D0013"></a><code class=
"errqname">err:XD0013</code></dt>
<dd>
<p>It is a dynamic error if the specified namespace bindings are
inconsistent; that is, if the same prefix is bound to two different
namespace names.</p>
<p>See: <a href="#err.inline.D0013">Namespaces on variables,
options, and parameters</a></p>
</dd>
<dt><a name="err.D0014" id="err.D0014"></a><code class=
"errqname">err:XD0014</code></dt>
<dd>
<p>It is a dynamic error for any unqualified attribute names other
than “name”, “namespace”, or “value” to appear on a c:param
element.</p>
<p>See: <a href="#err.inline.D0014">The c:param element</a>,
<a href="#err.inline.D0014.1">The c:param-set element</a></p>
</dd>
<dt><a name="err.D0015" id="err.D0015"></a><code class=
"errqname">err:XD0015</code></dt>
<dd>
<p>It is a dynamic error if the specified QName cannot be resolved
with the in-scope namespace declarations.</p>
<p>See: <a href="#err.inline.D0015">System Properties</a></p>
</dd>
<dt><a name="err.D0016" id="err.D0016"></a><code class=
"errqname">err:XD0016</code></dt>
<dd>
<p>It is a dynamic error if the select expression on a p:input
returns atomic values or anything other than element or document
nodes (or an empty sequence).</p>
<p>See: <a href="#err.inline.D0016">Document Inputs</a></p>
</dd>
<dt><a name="err.D0017" id="err.D0017"></a><code class=
"errqname">err:XD0017</code></dt>
<dd>
<p>It is a dynamic error if the running pipeline attempts to invoke
a step which the processor does not know how to perform.</p>
<p>See: <a href="#err.inline.D0017">Extension Steps</a></p>
</dd>
<dt><a name="err.D0018" id="err.D0018"></a><code class=
"errqname">err:XD0018</code></dt>
<dd>
<p>It is a dynamic error if the parameter list contains any
elements other than c:param.</p>
<p>See: <a href="#err.inline.D0018">The c:param-set element</a></p>
</dd>
<dt><a name="err.D0019" id="err.D0019"></a><code class=
"errqname">err:XD0019</code></dt>
<dd>
<p>It is a dynamic error if any option value does not satisfy the
type required for that option.</p>
<p>See: <a href="#err.inline.D0019">Common errors</a></p>
</dd>
<dt><a name="err.D0020" id="err.D0020"></a><code class=
"errqname">err:XD0020</code></dt>
<dd>
<p>It is a dynamic error if the combination of serialization
options specified or defaulted is not allowed.</p>
<p>See: <a href="#err.inline.D0020">p:serialization</a></p>
</dd>
<dt><a name="err.D0021" id="err.D0021"></a><code class=
"errqname">err:XD0021</code></dt>
<dd>
<p>It is a dynamic error for a pipeline to attempt to access a
resource for which it has insufficient privileges or perform a step
which is forbidden.</p>
<p>See: <a href="#err.inline.D0021">Security Considerations</a></p>
</dd>
<dt><a name="err.D0022" id="err.D0022"></a><code class=
"errqname">err:XD0022</code></dt>
<dd>
<p>It is a dynamic error if a processor that does not support PSVI
annotations attempts to invoke a step which asserts that they are
required.</p>
<p>See: <a href="#err.inline.D0022">PSVIs in XProc</a></p>
</dd>
<dt><a name="err.D0023" id="err.D0023"></a><code class=
"errqname">err:XD0023</code></dt>
<dd>
<p>It is a dynamic error if an XPath expression is encountered
which cannot be evaluated (because it is syntactically incorrect,
contains references to unbound variables or unknown functions, or
for any other reason).</p>
<p>See: <a href="#err.inline.D0023">XPaths in XProc</a></p>
</dd>
<dt><a name="err.D0024" id="err.D0024"></a><code class=
"errqname">err:XD0024</code></dt>
<dd>
<p>It is a dynamic error if a 2.0 processor encounters an XPath 1.0
expression and it does not support XPath 1.0 compatibility
mode.</p>
<p>See: <a href="#err.inline.D0024">XPaths in XProc</a></p>
</dd>
<dt><a name="err.D0025" id="err.D0025"></a><code class=
"errqname">err:XD0025</code></dt>
<dd>
<p>It is a dynamic error if the namespace attribute is specified,
the name contains a colon, and the specified namespace is not the
same as the in-scope namespace binding for the specified
prefix.</p>
<p>See: <a href="#err.inline.D0025">The c:param element</a></p>
</dd>
<dt><a name="err.D0026" id="err.D0026"></a><code class=
"errqname">err:XD0026</code></dt>
<dd>
<p>It is a dynamic error if the select expression makes reference
to the context node, size, or position when the context item is
undefined.</p>
<p>See: <a href="#err.inline.D0026">p:variable</a>, <a href=
"#err.inline.D0026.1">p:option</a>, <a href=
"#err.inline.D0026.2">p:with-option</a>, <a href=
"#err.inline.D0026.3">p:with-param</a></p>
</dd>
<dt><a name="err.D0027" id="err.D0027"></a><code class=
"errqname">err:XD0027</code></dt>
<dd>
<p>It is a dynamic error if the processor encounters an
xpath-version that it does not support.</p>
<p>See: <a href="#err.inline.D0027">XPaths in XProc</a></p>
</dd>
<dt><a name="err.D0028" id="err.D0028"></a><code class=
"errqname">err:XD0028</code></dt>
<dd>
<p>It is a dynamic error if any attribute value does not satisfy
the type required for that attribute.</p>
<p>See: <a href="#err.inline.D0028">Common errors</a></p>
</dd>
<dt><a name="err.D0029" id="err.D0029"></a><code class=
"errqname">err:XD0029</code></dt>
<dd>
<p>It is a dynamic error if the document referenced by a p:data
element does not exist, cannot be accessed, or cannot be encoded as
specified.</p>
<p>See: <a href="#err.inline.D0029">p:data</a></p>
</dd>
<dt><a name="err.D0030" id="err.D0030"></a><code class=
"errqname">err:XD0030</code></dt>
<dd>
<p>It is a dynamic error if a step is unable or incapable of
performing its function.</p>
<p>See: <a href="#err.inline.D0030">Common errors</a></p>
</dd>
<dt><a name="err.D0031" id="err.D0031"></a><code class=
"errqname">err:XD0031</code></dt>
<dd>
<p>It is a dynamic error to use the XProc namespace in the name of
a parameter.</p>
<p>See: <a href="#err.inline.D0031">p:with-param</a></p>
</dd>
<dt><a name="err.D0033" id="err.D0033"></a><code class=
"errqname">err:XD0033</code></dt>
<dd>
<p>It is a dynamic error if the name specified is not the name of
an in-scope option or variable.</p>
<p>See: <a href="#err.inline.D0033">Value Available</a></p>
</dd>
<dt><a name="err.D0034" id="err.D0034"></a><code class=
"errqname">err:XD0034</code></dt>
<dd>
<p>It is a dynamic error to specify a new namespace or prefix if
the lexical value of the specified name contains a colon (or if no
wrapper is explicitly specified).</p>
<p>See: <a href="#err.inline.D0034">p:data</a>, <a href=
"#err.inline.D0034.1">p:add-attribute</a>, <a href=
"#err.inline.D0034.2">p:error</a>, <a href=
"#err.inline.D0034.3">p:label-elements</a>, <a href=
"#err.inline.D0034.4">p:pack</a>, <a href=
"#err.inline.D0034.5">p:rename</a>, <a href=
"#err.inline.D0034.6">p:wrap</a>, <a href=
"#err.inline.D0034.7">p:wrap-sequence</a></p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h3><a name="app.step-errors" id=
"app.step-errors"></a>E.3&#160;Step Errors</h3>
<p>The following <em class="glossterm"><a href=
"#dt-dynamic-error">dynamic errors</a></em> can be raised by steps
in this specification:</p>
<div id="step-error-summary">
<h5>Step Errors</h5>
<dl class="errs">
<dt><a name="err.C0002" id="err.C0002"></a><code class=
"errqname">err:XC0002</code></dt>
<dd>
<p>It is a dynamic error if the value starts with the string
“--”.</p>
<p>See: <a href="#err.inline.C0002">Request Entity body
conversion</a></p>
</dd>
<dt><a name="err.C0003" id="err.C0003"></a><code class=
"errqname">err:XC0003</code></dt>
<dd>
<p>It is a dynamic error if a username or password is specified
without specifying an auth-method, if the requested auth-method
isn't supported, or the authentication challenge contains an
authentication method that isn't supported.</p>
<p>See: <a href="#err.inline.C0003">Specifying a request</a></p>
</dd>
<dt><a name="err.C0004" id="err.C0004"></a><code class=
"errqname">err:XC0004</code></dt>
<dd>
<p>It is a dynamic error if the status-only attribute has the value
true and the detailed attribute does not have the value true.</p>
<p>See: <a href="#err.inline.C0004">Specifying a request</a></p>
</dd>
<dt><a name="err.C0005" id="err.C0005"></a><code class=
"errqname">err:XC0005</code></dt>
<dd>
<p>It is a dynamic error if the request contains a c:body or
c:multipart but the method does not allow for an entity body being
sent with the request.</p>
<p>See: <a href="#err.inline.C0005">Specifying a request</a></p>
</dd>
<dt><a name="err.C0006" id="err.C0006"></a><code class=
"errqname">err:XC0006</code></dt>
<dd>
<p>It is a dynamic error if the method is not specified on a
c:request.</p>
<p>See: <a href="#err.inline.C0006">Specifying a request</a></p>
</dd>
<dt><a name="err.C0010" id="err.C0010"></a><code class=
"errqname">err:XC0010</code></dt>
<dd>
<p>It is a dynamic error if an encoding of base64 is specified and
the character set is not specified or if the specified character
set is not supported by the implementation.</p>
<p>See: <a href="#err.inline.C0010">p:unescape-markup</a></p>
</dd>
<dt><a name="err.C0012" id="err.C0012"></a><code class=
"errqname">err:XC0012</code></dt>
<dd>
<p>It is a dynamic error if the contents of the directory path are
not available to the step due to access restrictions in the
environment in which the pipeline is run.</p>
<p>See: <a href="#err.inline.C0012">p:directory-list</a></p>
</dd>
<dt><a name="err.C0013" id="err.C0013"></a><code class=
"errqname">err:XC0013</code></dt>
<dd>
<p>It is a dynamic error if the pattern matches a processing
instruction and the new name has a non-null namespace.</p>
<p>See: <a href="#err.inline.C0013">p:rename</a></p>
</dd>
<dt><a name="err.C0014" id="err.C0014"></a><code class=
"errqname">err:XC0014</code></dt>
<dd>
<p>It is a dynamic error if the XML namespace
(http://www.w3.org/XML/1998/namespace) or the XMLNS namespace
(http://www.w3.org/2000/xmlns/) is the value of either the from
option or the to option.</p>
<p>See: <a href="#err.inline.C0014">p:namespace-rename</a></p>
</dd>
<dt><a name="err.C0017" id="err.C0017"></a><code class=
"errqname">err:XC0017</code></dt>
<dd>
<p>It is a dynamic error if the absolute path does not identify a
directory.</p>
<p>See: <a href="#err.inline.C0017">p:directory-list</a></p>
</dd>
<dt><a name="err.C0019" id="err.C0019"></a><code class=
"errqname">err:XC0019</code></dt>
<dd>
<p>It is a dynamic error if the documents are not equal, and the
value of the fail-if-not-equal option is true.</p>
<p>See: <a href="#err.inline.C0019">p:compare</a></p>
</dd>
<dt><a name="err.C0020" id="err.C0020"></a><code class=
"errqname">err:XC0020</code></dt>
<dd>
<p>It is a dynamic error if the the user specifies a value or
values that are inconsistent with each other or with the
requirements of the step or protocol.</p>
<p>See: <a href="#err.inline.C0020">Specifying a request</a></p>
</dd>
<dt><a name="err.C0022" id="err.C0022"></a><code class=
"errqname">err:XC0022</code></dt>
<dd>
<p>it is a dynamic error if the content of the c:body element does
not consist of exactly one element, optionally preceded and/or
followed by any number of processing instructions, comments or
whitespace characters</p>
<p>See: <a href="#err.inline.C0022">Request Entity body
conversion</a></p>
</dd>
<dt><a name="err.C0023" id="err.C0023"></a><code class=
"errqname">err:XC0023</code></dt>
<dd>
<p>It is a dynamic error if a select expression or match pattern
returns a node type that is not allowed by the step.</p>
<p>See: <a href="#err.inline.C0023">Common errors</a>, <a href=
"#err.inline.C0023.1">p:add-attribute</a>, <a href=
"#err.inline.C0023.2">p:insert</a>, <a href=
"#err.inline.C0023.3">p:label-elements</a>, <a href=
"#err.inline.C0023.4">p:make-absolute-uris</a>, <a href=
"#err.inline.C0023.5">p:rename</a>, <a href=
"#err.inline.C0023.6">p:replace</a>, <a href=
"#err.inline.C0023.7">p:set-attributes</a>, <a href=
"#err.inline.C0023.8">p:unwrap</a>, <a href=
"#err.inline.C0023.9">p:wrap</a></p>
</dd>
<dt><a name="err.C0025" id="err.C0025"></a><code class=
"errqname">err:XC0025</code></dt>
<dd>
<p>It is a dynamic error if the match pattern matches anything
other than an element node and the value of the position option is
“first-child” or “last-child”.</p>
<p>See: <a href="#err.inline.C0025">p:insert</a></p>
</dd>
<dt><a name="err.C0027" id="err.C0027"></a><code class=
"errqname">err:XC0027</code></dt>
<dd>
<p>It is a dynamic error if the document is not valid or the step
doesn't support DTD validation.</p>
<p>See: <a href="#err.inline.C0027">p:load</a></p>
</dd>
<dt><a name="err.C0028" id="err.C0028"></a><code class=
"errqname">err:XC0028</code></dt>
<dd>
<p>it is a dynamic error if the content of the c:body element does
not consist entirely of characters</p>
<p>See: <a href="#err.inline.C0028">Request Entity body
conversion</a></p>
</dd>
<dt><a name="err.C0029" id="err.C0029"></a><code class=
"errqname">err:XC0029</code></dt>
<dd>
<p>It is a dynamic error if an XInclude error occurs during
processing.</p>
<p>See: <a href="#err.inline.C0029">p:xinclude</a></p>
</dd>
<dt><a name="err.C0030" id="err.C0030"></a><code class=
"errqname">err:XC0030</code></dt>
<dd>
<p>It is a dynamic error if the override-content-type value cannot
be used (e.g. text/plain to override image/png).</p>
<p>See: <a href="#err.inline.C0030">Managing the response</a></p>
</dd>
<dt><a name="err.C0033" id="err.C0033"></a><code class=
"errqname">err:XC0033</code></dt>
<dd>
<p>It is a dynamic error if the command cannot be run.</p>
<p>See: <a href="#err.inline.C0033">p:exec</a></p>
</dd>
<dt><a name="err.C0034" id="err.C0034"></a><code class=
"errqname">err:XC0034</code></dt>
<dd>
<p>It is a dynamic error if the current working directory cannot be
changed to the value of the cwd option.</p>
<p>See: <a href="#err.inline.C0034">p:exec</a></p>
</dd>
<dt><a name="err.C0035" id="err.C0035"></a><code class=
"errqname">err:XC0035</code></dt>
<dd>
<p>It is a dynamic error to specify both result-is-xml and
wrap-result-lines.</p>
<p>See: <a href="#err.inline.C0035">p:exec</a></p>
</dd>
<dt><a name="err.C0036" id="err.C0036"></a><code class=
"errqname">err:XC0036</code></dt>
<dd>
<p>It is a dynamic error if the requested hash algorithm is not one
that the processor understands or if the value or parameters are
not appropriate for that algorithm.</p>
<p>See: <a href="#err.inline.C0036">p:hash</a></p>
</dd>
<dt><a name="err.C0037" id="err.C0037"></a><code class=
"errqname">err:XC0037</code></dt>
<dd>
<p>It is a dynamic error if the value provided is not a properly
x-www-form-urlencoded value.</p>
<p>See: <a href="#err.inline.C0037">p:www-form-urldecode</a></p>
</dd>
<dt><a name="err.C0038" id="err.C0038"></a><code class=
"errqname">err:XC0038</code></dt>
<dd>
<p>It is a dynamic error if the specified version of XSLT is not
available.</p>
<p>See: <a href="#err.inline.C0038">p:xslt</a></p>
</dd>
<dt><a name="err.C0039" id="err.C0039"></a><code class=
"errqname">err:XC0039</code></dt>
<dd>
<p>It is a dynamic error if a sequence of documents (including an
empty sequence) is provided to an XSLT 1.0 step.</p>
<p>See: <a href="#err.inline.C0039">p:xslt</a></p>
</dd>
<dt><a name="err.C0040" id="err.C0040"></a><code class=
"errqname">err:XC0040</code></dt>
<dd>
<p>It is a dynamic error if the document element of the document
that arrives on the source port is not c:request.</p>
<p>See: <a href="#err.inline.C0040">p:http-request</a></p>
</dd>
<dt><a name="err.C0050" id="err.C0050"></a><code class=
"errqname">err:XC0050</code></dt>
<dd>
<p>It is a dynamic error if the URI scheme is not supported or the
step cannot store to the specified location.</p>
<p>See: <a href="#err.inline.C0050">p:store</a></p>
</dd>
<dt><a name="err.C0051" id="err.C0051"></a><code class=
"errqname">err:XC0051</code></dt>
<dd>
<p>It is a dynamic error if the content-type specified is not
supported by the implementation.</p>
<p>See: <a href="#err.inline.C0051">p:unescape-markup</a></p>
</dd>
<dt><a name="err.C0052" id="err.C0052"></a><code class=
"errqname">err:XC0052</code></dt>
<dd>
<p>It is a dynamic error if the encoding specified is not supported
by the implementation.</p>
<p>See: <a href="#err.inline.C0052">Request Entity body
conversion</a>, <a href=
"#err.inline.C0052.1">p:unescape-markup</a></p>
</dd>
<dt><a name="err.C0053" id="err.C0053"></a><code class=
"errqname">err:XC0053</code></dt>
<dd>
<p>It is a dynamic error if the assert-valid option is true and the
input document is not valid.</p>
<p>See: <a href="#err.inline.C0053">p:validate-with-relax-ng</a>,
<a href="#err.inline.C0053.1">p:validate-with-xml-schema</a></p>
</dd>
<dt><a name="err.C0054" id="err.C0054"></a><code class=
"errqname">err:XC0054</code></dt>
<dd>
<p>It is a dynamic error if the assert-valid option is true and any
Schematron assertions fail.</p>
<p>See: <a href=
"#err.inline.C0054">p:validate-with-schematron</a></p>
</dd>
<dt><a name="err.C0055" id="err.C0055"></a><code class=
"errqname">err:XC0055</code></dt>
<dd>
<p>It is a dynamic error if the implementation does not support the
specified mode.</p>
<p>See: <a href=
"#err.inline.C0055">p:validate-with-xml-schema</a></p>
</dd>
<dt><a name="err.C0056" id="err.C0056"></a><code class=
"errqname">err:XC0056</code></dt>
<dd>
<p>It is a dynamic error if the specified initial mode or named
template cannot be applied to the specified stylesheet.</p>
<p>See: <a href="#err.inline.C0056">p:xslt</a></p>
</dd>
<dt><a name="err.C0057" id="err.C0057"></a><code class=
"errqname">err:XC0057</code></dt>
<dd>
<p>It is a dynamic error if the sequence that results from
evaluating the XQuery contains items other than documents and
elements.</p>
<p>See: <a href="#err.inline.C0057">p:xquery</a></p>
</dd>
<dt><a name="err.C0058" id="err.C0058"></a><code class=
"errqname">err:XC0058</code></dt>
<dd>
<p>It is a dynamic error if the all and relative options are both
true.</p>
<p>See: <a href="#err.inline.C0058">p:add-xml-base</a></p>
</dd>
<dt><a name="err.C0059" id="err.C0059"></a><code class=
"errqname">err:XC0059</code></dt>
<dd>
<p>It is a dynamic error if the QName value in the attribute-name
option uses the prefix “xmlns” or any other prefix that resolves to
the namespace name “http://www.w3.org/2000/xmlns/”.</p>
<p>See: <a href="#err.inline.C0059">p:add-attribute</a></p>
</dd>
<dt><a name="err.C0060" id="err.C0060"></a><code class=
"errqname">err:XC0060</code></dt>
<dd>
<p>It is a dynamic error if the processor does not support the
specified version of the UUID algorithm.</p>
<p>See: <a href="#err.inline.C0060">p:uuid</a></p>
</dd>
<dt><a name="err.C0061" id="err.C0061"></a><code class=
"errqname">err:XC0061</code></dt>
<dd>
<p>It is a dynamic error if the name of any encoded parameter name
is not a valid xs:NCName.</p>
<p>See: <a href="#err.inline.C0061">p:www-form-urldecode</a></p>
</dd>
<dt><a name="err.C0062" id="err.C0062"></a><code class=
"errqname">err:XC0062</code></dt>
<dd>
<p>It is a dynamic error if the match option matches a namespace
node.</p>
<p>See: <a href="#err.inline.C0062">p:delete</a></p>
</dd>
<dt><a name="err.C0063" id="err.C0063"></a><code class=
"errqname">err:XC0063</code></dt>
<dd>
<p>It is a dynamic error if the path-separator option is specified
and is not exactly one character long.</p>
<p>See: <a href="#err.inline.C0063">p:exec</a></p>
</dd>
<dt><a name="err.C0064" id="err.C0064"></a><code class=
"errqname">err:XC0064</code></dt>
<dd>
<p>It is a dynamic error if the exit code from the command is
greater than the specified failure-threshold value.</p>
<p>See: <a href="#err.inline.C0064">p:exec</a></p>
</dd>
<dt><a name="err.C0066" id="err.C0066"></a><code class=
"errqname">err:XC0066</code></dt>
<dd>
<p>It is a dynamic error if the arg-separator option is specified
and is not exactly one character long.</p>
<p>See: <a href="#err.inline.C0066">p:exec</a></p>
</dd>
</dl>
</div>
</div>
</div>
<div class="appendix">
<h2><a name="namespace-fixup-guidance" id=
"namespace-fixup-guidance"></a>F&#160;Guidance on Namespace Fixup
(Non-Normative)</h2>
<p>An XProc processor may find it necessary to add missing
namespace declarations to ensure that a document can be serialized.
While this process is implementation defined, the purpose of this
appendix is to provide guidance as to what an implementation might
do to either prevent such situations or fix them as before
serialization.</p>
<p>When a namespace binding is generated, the prefix associated
with the QName of the element or attribute in question should be
used. From an Infoset perspective, this is accomplished by setting
the <tt class="code">[prefix]</tt> on the element or attribute.
Then when an implementation needs to add a namespace binding, it
can reuse that prefix if possible. If reusing the prefix is not
possible, the implementation must generate a new prefix that is
unique to the in-scope namespace of the element or owner element of
the attribute.</p>
<p>An implementation can avoid namespace fixup by making sure that
the standard step library does not output documents that require
fixup. The following list contains suggestions as to how to
accomplish this within the steps:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>Any step that outputs an element in the step vocabulary
namespace <tt class="uri">http://www.w3.org/ns/xproc-step</tt> must
ensure that namespace is declared. An implementation should
generate a namespace binding using the prefix “<tt class=
"literal">c</tt>”.</p>
</li>
<li>
<p>When attributes are added by <a href=
"#c.add-attribute">p:add-attribute</a> or <a href=
"#c.set-attributes">p:set-attributes</a>, the step must ensure the
namespace of the attributes added are declared. If the prefix used
by the QName is not in the in-scope namespaces of the element on
which the attribute was added, the step must add a namespace
declaration of the prefix to the in-scope namespaces. If the prefix
is amongst the in-scope namespace and is not bound to the same
namespace name, a new prefix and namespace binding must be added.
When a new prefix is generated, the prefix associated with the
attribute should be changed to reflect that generated prefix
value.</p>
</li>
<li>
<p>When an element is renamed by <a href="#c.rename">p:rename</a>,
the step must ensure the namespace of the element is declared. If
the prefix used by the QName is not in the in-scope namespaces of
the element being renamed, the step must add a namespace
declaration of the prefix to the in-scope namespaces. If the prefix
is amongst the in-scope namespace and is not bound to the same
namespace name, a new prefix and namespace binding must be added.
When a new prefix is generated, the prefix associated with the
element should be changed to reflect that generated prefix
value.</p>
<p>If the element does not have a namespace name and there is a
default namespace, the default namespace must be undeclared. For
each of the child elements, the original default namespace
declaration must be preserved by adding a default namespace
declaration unless the child element has a different default
namespace.</p>
</li>
<li>
<p>When an attribute is renamed by <a href=
"#c.rename">p:rename</a>, the step must ensure the namespace of the
renamed attribute is declared. If the prefix used by the QName is
not in the in-scope namespaces of the element on which the
attribute was added, the step must add a namespace declaration of
the prefix to the in-scope namespaces. If the prefix is amongst the
in-scope namespace and is not bound to the same namespace name, a
new prefix and namespace binding must be added. When a new prefix
is generated, the prefix associated with the attribute should be
changed to reflect that generated prefix value.</p>
</li>
<li>
<p>When an element wraps content via <a href="#c.wrap">p:wrap</a>,
there may be in-scope namespaces coming from ancestor elements of
the new wrapper element. The step must ensure the namespace of the
element is declared properly. By default, the wrapper element will
inherit the in-scope namespaces of the parent element if one
exists. As such, there may be a existing namespace declaration or
default namespace.</p>
<p>If the prefix used by the QName is not in the in-scope
namespaces of the wrapper element, the step must add a namespace
declaration of the prefix to the in-scope namespaces. If the prefix
is amongst the in-scope namespace and is not bound to the same
namespace name, a new prefix and namespace binding must be added.
When a new prefix is generated, the prefix associated with the
wrapper element should be changed to reflect that generated prefix
value.</p>
<p>If the element does not have a namespace name and there is a
default namespace, the default namespace must be undeclared. For
each of the child elements, the original default namespace
declaration must be preserved by adding a default namespace
declaration unless the child element has a different default
namespace.</p>
</li>
<li>
<p>When the wrapper element is added for <a href=
"#c.wrap-sequence">p:wrap-sequence</a> or <a href=
"#c.pack">p:pack</a>, the prefix used by the QName must be added to
the in-scope namespaces.</p>
</li>
<li>
<p>When a element is removed via <a href="#c.unwrap">p:unwrap</a>,
an in-scope namespaces that are declared on the element must be
copied to any child element except when the child element declares
the same prefix or declares a new default namespace.</p>
</li>
<li>
<p>In the output from <a href="#c.xslt">p:xslt</a>, if an element
was generated from the xsl:element or an attribute from
xsl:attribute, the step must guarantee that an namespace
declaration exists for the namespace name used. Depending on the
XSLT implementation, the namespace declaration for the namespace
name of the element or attribute may not be declared. It may also
be the case that the original prefix is available. If the original
prefix is available, the step should attempt to re-use that prefix.
Otherwise, it must generate a prefix for a namespace binding and
change the prefix associated the element or attribute.</p>
</li>
</ol>
</div>
</div>
<div class="appendix">
<h2><a name="handling-imports" id=
"handling-imports"></a>G&#160;Handling Circular and Re-entrant
Library Imports (Non-Normative)</h2>
<p>When handling imports, an implementation needs to be able to
detect the following situations, and distinguish them from cases
where multiple import chains produce genuinely conflicting step
definitions:</p>
<div class="orderedlist">
<ol style="list-style: decimal;">
<li>
<p>Circular imports: A imports B, B imports A.</p>
</li>
<li>
<p>Re-entrant imports: A imports B and C, B imports D, C imports
D.</p>
</li>
</ol>
</div>
<p>One way to achieve this is as follows:</p>
<p><span class="termdef" id="dt-step-type-exports">[Definition: The
<em class="glossterm">step type exports</em> of an XProc element,
against the background of a set of URIs of resources already
visited (call this set <em>Visited</em>), are defined by
cases.]</span></p>
<p>The <a href="#dt-step-type-exports">step type exports</a> of an
XProc element are as follows:</p>
<div class="variablelist">
<dl>
<dt>p:pipeline, p:declare-step</dt>
<dd>
<p>A singleton bag containing the <tt class="code">type</tt> of the
element</p>
</dd>
<dt>p:library</dt>
<dd>
<p>The <em class="glossterm"><a href=
"#dt-bag-merger">bag-merger</a></em> of the <em class=
"glossterm"><a href="#dt-step-type-exports">step type
exports</a></em> of all the element's children</p>
</dd>
<dt>p:import</dt>
<dd>
<p>Let <em>RU</em> be the actual resolved URI of the resource
identified by the <tt class="code">href</tt> of the element. If
<em>RU</em> is a member of <em>Visited</em>, then an empty bag,
otherwise update <em>Visited</em> by adding <em>RU</em> to it, and
return the <em class="glossterm"><a href=
"#dt-step-type-exports">step type exports</a></em> of the document
element of the retrieved representation</p>
</dd>
<dt>all other elements</dt>
<dd>
<p>An empty bag</p>
</dd>
</dl>
</div>
<p>The changes to <em>Visited</em> mandated by the <tt class=
"code">p:import</tt> case above are persistent, not scoped. That
is, not only the recursive processing of the imported resource but
also subsequent processing of siblings and ancestors must be
against the background of the updated value. In practice this means
either using a side-effected global variable, or not only passing
<em>Visited</em> as an argument to any recursive or iterative
processing, but also <em>returning</em> its updated value for
subsequent use, along with the bag of step types.</p>
<p>Given a pipeline library document with actual resolved URI
<em>DU</em>, <a name="err.inline.S0036.1" id=
"err.inline.S0036.1"></a>it is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0036"><code class="errqname">err:XS0036</code></a>) if the
<em class="glossterm"><a href="#dt-step-type-exports">step type
exports</a></em> of the document element of the retrieved
representation, against the background of a singleton set
containing <em>DU</em> as the initial <em>Visited</em> set,
contains any duplicates.</p>
<p>Given a top-level pipeline document with actual resolved URI
<em>DU</em>, <a name="err.inline.S0036.2" id=
"err.inline.S0036.2"></a>it is a <em class="glossterm"><a href=
"#dt-static-error">static error</a></em>&#160;(<a href=
"#err.S0036"><code class="errqname">err:XS0036</code></a>) if the
<em class="glossterm"><a href="#dt-bag-merger">bag-merger</a></em>
of the <em class="glossterm"><a href="#dt-step-type-exports">step
type exports</a></em> of the document element of the retrieved
representation with the <em class="glossterm"><a href=
"#dt-step-type-exports">step type exports</a></em> of its children,
against the background of a singleton set containing <em>DU</em> as
the initial <em>Visited</em> set, contains any duplicates.</p>
<p>Given a non-top-level <tt class="code">p:pipeline</tt> or
<tt class="code">p:declare-step</tt> element, <a name=
"err.inline.S0036.3" id="err.inline.S0036.3"></a>it is a <em class=
"glossterm"><a href="#dt-static-error">static
error</a></em>&#160;(<a href="#err.S0036"><code class=
"errqname">err:XS0036</code></a>) if the <em class=
"glossterm"><a href="#dt-bag-merger">bag-merger</a></em> of the
<em class="glossterm"><a href="#dt-step-type-exports">step type
exports</a></em> of its parent with the <em class=
"glossterm"><a href="#dt-step-type-exports">step type
exports</a></em> of its children, against the background of a copy
of the <em>Visited</em> set of its parent as the initial
<em>Visited</em> set, contains any duplicates.</p>
<p>The phrase "a copy of the <em>Visited</em> set" in the preceding
paragraph is meant to indicate that checking of non-top-level
<tt class="code">p:pipeline</tt> or <tt class=
"code">p:declare-step</tt> elements does <em>not</em> have a
persistent impact on the checking of its parent. The contrast is
that whereas changes to <em>Visited</em> pass both up <em>and</em>
down through <tt class="code">p:import</tt>, they pass only
<em>down</em> through <em>p:pipeline</em> and
<em>p:declare-step</em>.</p>
<p><span class="termdef" id="dt-bag-merger">[Definition: The
<em class="glossterm">bag-merger</em> of two or more bags (where a
bag is an unordered list or, equivalently, something like a set
except that it may contain duplicates) is a bag constructed by
starting with an empty bag and adding each member of each of the
input bags in turn to it. It follows that the cardinality of the
result is the sum of the cardinality of all the input
bags.]</span></p>
</div>
<div class="appendix">
<h2><a name="parallelism" id="parallelism"></a>H&#160;Sequential
steps, parallelism, and side-effects</h2>
<p>XProc imposes as few constraints on the order in which steps
must be evaluated as possible and almost no constraints on parallel
execution.</p>
<p>In the simple, and we believe overwhelmingly common case, inputs
flow into the pipeline, through the pipeline from one step to the
next, and results are produced at the end. The order of the steps
is constrained by the input/output connections between them.
Implementations are free to execute them in a purely sequential
fashion or in parallel, as they see fit. The results are the same
in either case.</p>
<p>This is not true for pipelines which rely on side effects, such
as the state of the filesystem or the state of the web. Consider
the following pipeline:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
            version="1.0"
            name="main"&gt;

  &lt;p:xslt name="generate-stylesheet"&gt;
    &lt;p:input port="source"&gt;
      &lt;p:document href="someURI"/&gt;
    &lt;/p:input&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:document href="someOtherURI"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;

  &lt;p:store name="save-xslt" href="gen-style.xsl"/&gt;

  &lt;p:xslt name="style"&gt;
    &lt;p:input port="source"&gt;
      &lt;p:pipe step="main" port="source"/&gt;
    &lt;/p:input&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:document href="gen-style.xsl"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>There's no guarantee that “style” step will execute after the
“save-xslt” step. In this case, the solution is straightforward.
Even if you need the saved stylesheet, you don't need to rely on it
in your pipeline:</p>
<div class="programlisting">
<pre>
&lt;p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
            version="1.0"
            name="main"&gt;

  &lt;p:xslt name="generate-stylesheet"&gt;
    &lt;p:input port="source"&gt;
      &lt;p:document href="someURI"/&gt;
    &lt;/p:input&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:document href="someOtherURI"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;

  &lt;p:store name="save-xslt" href="gen-style.xsl"/&gt;

  &lt;p:xslt name="style"&gt;
    &lt;p:input port="source"&gt;
      &lt;p:pipe step="main" port="source"/&gt;
    &lt;/p:input&gt;
    &lt;p:input port="stylesheet"&gt;
      &lt;p:pipe step="generate-stylesheet" port="result"/&gt;
    &lt;/p:input&gt;
  &lt;/p:xslt&gt;
&lt;/p:pipeline&gt;
</pre></div>
<p>Now the result is independent of the implementation
strategy.</p>
<p>Implementations are free to invent additional control structures
using <a href="#p.pipeinfo"><tt class=
"tag-element">p:pipeinfo</tt></a> and <a href=
"#extension-attributes">extension attributes</a> to provide greater
control over parallelism in their implementations.</p>
</div>
<div class="appendix">
<h2><a name="xproc-media-type" id="xproc-media-type"></a>I&#160;The
<tt class="code">application/xproc+xml</tt> media type</h2>
<p>This appendix registers a new MIME media type, “<span class=
"quote"><tt class="code">application/xproc+xml</tt></span>”.</p>
<div class="section">
<h3><a name="media-type-registration" id=
"media-type-registration"></a>I.1&#160;Registration of MIME media
type application/xproc+xml</h3>
<div class="variablelist">
<dl>
<dt>MIME media type name:</dt>
<dd>
<p><tt class="code">application</tt></p>
</dd>
<dt>MIME subtype name:</dt>
<dd>
<p><tt class="code">xproc+xml</tt></p>
</dd>
<dt>Required parameters:</dt>
<dd>
<p>None.</p>
</dd>
<dt>Optional parameters:</dt>
<dd>
<div class="variablelist">
<dl>
<dt><tt class="code">charset</tt></dt>
<dd>
<p>This parameter has identical semantics to the <tt class=
"code">charset</tt> parameter of the <tt class=
"code">application/xml</tt> media type as specified in [<a href=
"#rfc3023"><span class="abbrev">RFC 3023</span></a>] or its
successors.</p>
</dd>
</dl>
</div>
</dd>
<dt>Encoding considerations:</dt>
<dd>
<p>By virtue of XProc content being XML, it has the same
considerations when sent as “<span class="quote"><tt class=
"code">application/xproc+xml</tt></span>” as does XML. See
[<a href="#rfc3023"><span class="abbrev">RFC 3023</span></a>],
Section 3.2.</p>
</dd>
<dt>Security considerations:</dt>
<dd>
<p>Several XProc elements may refer to arbitrary URIs. In this
case, the security issues of [<a href="#rfc2396"><span class=
"abbrev">RFC 2396</span></a>], section 7, should be considered.</p>
<p>In addition, because of the extensibility features of XProc, it
is possible that “application/xproc+xml” may describe content that
has security implications beyond those described here. However,
only in the case where the processor recognizes and processes the
additional content, or where further processing of that content is
dispatched to other processors, would security issues potentially
arise. And in that case, they would fall outside the domain of this
registration document.</p>
</dd>
<dt>Interoperability considerations:</dt>
<dd>
<p>This specification describes processing semantics that dictate
behavior that must be followed when dealing with, among other
things, unrecognized elements.</p>
<p>Because XProc is extensible, conformant "application/xproc+xml"
processors can expect that content received is well-formed XML, but
it cannot be guaranteed that the content is valid XProc or that the
processor will recognize all of the elements and attributes in the
document.</p>
</dd>
<dt>Published specification:</dt>
<dd>
<p>This media type registration is for XProc documents as described
by this specification which is located at <a href=
"http://www.w3.org/TR/xproc">http://www.w3.org/TR/xproc</a>.</p>
</dd>
<dt>Applications which use this media type:</dt>
<dd>
<p>There is no experimental, vendor specific, or personal tree
predecessor to “<span class="quote"><tt class=
"code">application/xproc+xml</tt></span>”, reflecting the fact that
no applications currently recognize it. This new type is being
registered in order to allow for the deployment of XProc on the
World Wide Web, as a first class XML application.</p>
</dd>
<dt>Additional information:</dt>
<dd>
<div class="variablelist">
<dl>
<dt>Magic number(s):</dt>
<dd>
<p>There is no single initial octet sequence that is always present
in XProc documents.</p>
</dd>
<dt>File extension(s):</dt>
<dd>
<p>XProc documents are most often identified with the extension
<span class="quote"><tt class="filename">.xpl</tt></span>”.</p>
</dd>
<dt>Macintosh File Type Code(s):</dt>
<dd>
<p>TEXT</p>
</dd>
</dl>
</div>
</dd>
<dt>Person &amp; email address to contact for further
information:</dt>
<dd>
<p>Norman Walsh, <tt class="email">&lt;<a href=
"mailto:Norman.Walsh@MarkLogic.com">Norman.Walsh@MarkLogic.com</a>&gt;</tt>.</p>
</dd>
<dt>Intended usage:</dt>
<dd>
<p>COMMON</p>
</dd>
<dt>Author/Change controller:</dt>
<dd>
<p>The XProc specification is a work product of the World Wide Web
Consortium's XML Processing Model Working Group. The W3C has change
control over these specifications.</p>
</dd>
</dl>
</div>
</div>
<div class="section">
<h3><a name="fragid" id="fragid"></a>I.2&#160;Fragment
Identifiers</h3>
<p>For documents labeled as “<span class="quote"><tt class=
"code">application/xproc+xml</tt></span>”, the fragment identifier
notation is exactly that for “<span class="quote"><tt class=
"code">application/xml</tt></span>”, as specified in [<a href=
"#rfc3023"><span class="abbrev">RFC 3023</span></a>] or its
successors.</p>
</div>
</div>
</div>
</body>
</html>