index.html
52.5 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>XML Processing Model Requirements and Use Cases</title>
<style type="text/css">
/*<![CDATA[*/
code { font-family: monospace; }
div.constraint,
div.issue,
div.note,
div.notice { margin-left: 2em; }
ol.enumar { list-style-type: decimal; }
ol.enumla { list-style-type: lower-alpha; }
ol.enumlr { list-style-type: lower-roman; }
ol.enumua { list-style-type: upper-alpha; }
ol.enumur { list-style-type: upper-roman; }
div.exampleInner pre { margin-left: 1em;
margin-top: 0em; margin-bottom: 0em}
div.exampleOuter {border: 4px double gray;
margin: 0em; padding: 0em}
div.exampleInner { background-color: #d5dee3;
border-top-width: 4px;
border-top-style: double;
border-top-color: #d3d3d3;
border-bottom-width: 4px;
border-bottom-style: double;
border-bottom-color: #d3d3d3;
padding: 4px; margin: 0em }
div.exampleWrapper { margin: 4px }
div.exampleHeader { font-weight: bold;
margin: 4px}
table.requirements-to-use-cases {
font-size: 80%;
border-spacing: 0pt;
border: .1pt solid gray;
}
table.requirements-to-use-cases th {
text-align: left;
border: .1pt solid gray;
}
table.requirements-to-use-cases tr {
vertical-align: top;
}
table.requirements-to-use-cases td {
border: .1pt solid gray;
padding: 3pt;
}
table.requirements-to-use-cases a {
text-decoration: none;
}
div.div2 {
padding-left: 30pt;
margin-bottom: 20pt;
width: 95%;
}
div.div2 h3 {
margin-left: -30pt;
}
/*]]>*/
</style>
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-WD.css" />
</head>
<body>
<div class="head">
<p><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72" /></a></p>
<h1><a name="title" id="title"></a>XML Processing Model Requirements and Use Cases</h1>
<h2><a name="w3c-doctype" id="w3c-doctype"></a>W3C Working Draft 11 April 2006</h2>
<dl>
<dt>This version:</dt>
<dd><a href="http://www.w3.org/TR/2006/WD-xproc-requirements-20060411/">http://www.w3.org/TR/2006/WD-xproc-requirements-20060411/</a></dd>
<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/xproc-requirements/">http://www.w3.org/TR/xproc-requirements/</a></dd>
<dt>Editor:</dt>
<dd>Alex Milowski, Invited Expert <a href="mailto:alex@milowski.com"><alex@milowski.com></a></dd>
</dl>
<p>This document is also available in these non-normative formats: <a href="http://www.w3.org/TR/2006/WD-xproc-requirements-20060411/WD-xproc-requirements-20060411.xml">XML</a>.</p>
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2006 <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>
</div>
<hr />
<div>
<h2><a name="abstract" id="abstract"></a>Abstract</h2>
<p>This document contains requirements for the development of an XML Processing Model and Language, which are intended to describe and specify the processing relationships between XML resources.</p>
</div>
<div>
<h2><a name="status" id="status"></a>Status of this Document</h2>
<p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>
<p>This First Public Working Draft has been produced by the W3C <a href="http://www.w3.org/XML/Processing/">XML Processing Model Working Group</a> as part of the <a href="http://www.w3.org/XML/Activity">XML Activity</a>, following the procedures set out for the <a href="http://www.w3.org/2003/06/Process-20030618/">W3C Process</a>. The goals of the XML Processing Model Working Group are discussed in its <a href="http://www.w3.org/2005/10/xml-processing-model-wg-charter.html">charter</a>.</p>
<p>Comments on this document should be sent to the W3C mailing list <a href="mailto:public-xml-processing-model-comments@w3.org">public-xml-processing-model-comments@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-comments/">archive</a>).</p>
<p>Publication as a <a href="http://www.w3.org/2004/02/Process-20040205/tr.html#RecsWD">Working Draft</a> does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.</p>
<p>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>. The group does not expect this document to become a W3C Recommendation. This document is informative only. 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 class="toc">
<h2><a name="contents" id="contents"></a>Table of Contents</h2>
<p class="toc">1 <a href="#introduction">Introduction</a><br />
2 <a href="#terminology">Terminology</a><br />
3 <a href="#design-principles">Design Principles</a><br />
4 <a href="#requirements">Requirements</a><br />
    4.1 <a href="#req-standard-names">Standard Names for Component Inventory</a><br />
    4.2 <a href="#req-new-components-steps">Allow Defining New Components and Steps</a><br />
    4.3 <a href="#req-minimal-components">Minimal Component Support for Interoperability</a><br />
    4.4 <a href="#req-allow-composition">Allow Pipeline Composition</a><br />
    4.5 <a href="#req-iteration">Iteration of Documents and Elements</a><br />
    4.6 <a href="#req-conditional-processing">Conditional Processing of Inputs</a><br />
    4.7 <a href="#req-error-handling-fallback">Error Handling and Fall-back</a><br />
    4.8 <a href="#req-xdm">Support for the XPath 2.0 Data Model</a><br />
    4.9 <a href="#req-allow-optimization">Allow Optimization</a><br />
    4.10 <a href="#req-streaming-pipes">Streaming XML Pipelines</a><br />
5 <a href="#use-cases">Use cases</a><br />
    5.1 <a href="#use-case-apply-sequence">Apply a Sequence of Operations</a><br />
    5.2 <a href="#use-case-xinclude">XInclude Processing</a><br />
    5.3 <a href="#use-case-parse-validate-transform">Parse/Validate/Transform</a><br />
    5.4 <a href="#use-case-document-aggregation">Document Aggregation</a><br />
    5.5 <a href="#use-case-simple-command-line">Single-file Command-line Document Processing</a><br />
    5.6 <a href="#use-case-multiple-command-line">Multiple-file Command-line Document Generation</a><br />
    5.7 <a href="#use-case-extract-mathml">Extracting MathML</a><br />
    5.8 <a href="#use-case-style-browser">Style an XML Document in a Browser</a><br />
    5.9 <a href="#use-case-run-program">Run a Custom Program</a><br />
    5.10 <a href="#use-case-xinclude-dsig">XInclude and Sign</a><br />
    5.11 <a href="#use-case-make-absolute-urls">Make Absolute URLs</a><br />
    5.12 <a href="#use-case-simple-transform-service">A Simple Transformation Service</a><br />
    5.13 <a href="#use-case-handheld-service">Service Request/Response Handling on a Handheld</a><br />
    5.14 <a href="#use-case-web-service">Interact with Web Service (Tide Information)</a><br />
    5.15 <a href="#use-case-rss-descriptions">Parse and/or Serialize RSS descriptions</a><br />
    5.16 <a href="#use-case-collections">XQuery and XSLT 2.0 Collections</a><br />
    5.17 <a href="#use-case-ajax-server">An AJAX Server</a><br />
    5.18 <a href="#use-case-dynamic-xquery">Dynamic XQuery</a><br />
    5.19 <a href="#use-case-rw-non-xml">Read/Write Non-XML File</a><br />
    5.20 <a href="#use-case-update-insert-db">Update/Insert Document in Database</a><br />
    5.21 <a href="#use-case-content-depend">Content-Dependent Transformations</a><br />
    5.22 <a href="#use-case-config-depend">Configuration-Dependent Transformations</a><br />
    5.23 <a href="#use-case-xml-rpc">Response to XML-RPC Request</a><br />
    5.24 <a href="#use-case-import-ingestion">Database Import/Ingestion</a><br />
    5.25 <a href="#use-case-metadata">Metadata Retrieval</a><br />
    5.26 <a href="#use-case-non-xml-production">Non-XML Document Production</a><br />
    5.27 <a href="#use-case-computations">Integrate Computation Components (MathML)</a><br />
    5.28 <a href="#use-case-dsdl-validation">Document Schema Definition Languages (DSDL) - Part 10: Validation Management</a><br />
    5.29 <a href="#use-case-large-document-transform">Large-Document Subtree Iteration</a><br />
    5.30 <a href="#use-case-add-nav">Adding Navigation to an Arbitrarily Large Document</a><br />
    5.31 <a href="#use-case-fallback-choice">Fallback to Choice of XSLT Processor</a><br />
    5.32 <a href="#use-case-no-fallback-error">No Fallback for XQuery Causes Error</a><br /></p>
<h3><a name="appendices" id="appendices"></a>Appendices</h3>
<p class="toc">A <a href="#references">References</a><br />
B <a href="#contributors">Contributors</a><br /></p>
</div>
<hr />
<div class="body">
<div class="div1">
<h2><a name="introduction" id="introduction"></a>1 Introduction</h2>
<p>A large and growing set of specifications describe processes operating on XML documents. Many applications will depend on the use of more than one of these specifications. Considering how implementations of these specifications might interact raises many issues related to interoperability. This specification contains requirements on an XML Pipeline Language for the description of XML process interactions in order to address these issues. This specification is concerned with the conceptual model of XML
process interactions, the language for the description of these interactions, and the inputs and outputs of the overall process. This specification is not generally concerned with the implementations of actual XML processes participating in these interactions.</p>
</div>
<div class="div1">
<h2><a name="terminology" id="terminology"></a>2 Terminology</h2>
<dl>
<dt class="label">[<a name="infoset" id="infoset" title="XML Information Set">Definition</a>: XML Information Set or "Infoset"]</dt>
<dd>
<p>An XML Information Set or "Infoset" is the name we give to any implementation of a data model for XML which supports the vocabulary as defined by the XML Information Set recommendation <a href="#xml-infoset-rec">[xml-infoset-rec]</a>.</p>
</dd>
<dt class="label">[<a name="xml-pipeline" id="xml-pipeline" title="XML Pipeline">Definition</a>: XML Pipeline]</dt>
<dd>
<p>An XML Pipeline is a conceptualization of a flow of a configuration of steps and their parameters. The XML Pipeline defines a process in terms of order, dependencies, or iteration of steps over XML information sets.</p>
</dd>
<dt class="label">[<a name="spec-lang" id="spec-lang" title="Specification Language">Definition</a>: XML Pipeline Specification Document]</dt>
<dd>
<p>A pipeline specification document is an XML document that described an XML pipeline.</p>
</dd>
<dt class="label">[<a name="step" id="step" title="Step">Definition</a>: Step]</dt>
<dd>
<p>A step is a specification of how a component is used in a pipeline that includes inputs, outputs, and parameters.</p>
</dd>
<dt class="label">[<a name="component" id="component" title="Component">Definition</a>: Component]</dt>
<dd>
<p>A component is an particular XML technology (e.g. XInclude, XML Schema Validity Assessment, XSLT, XQuery, etc.).</p>
</dd>
<dt class="label">[<a name="input-document" id="input-document" title="Input Document">Definition</a>: Input Document]</dt>
<dd>
<p>An XML infoset that is an input to a XML Pipeline or Step.</p>
</dd>
<dt class="label">[<a name="output-document" id="output-document" title="Output Document">Definition</a>: Output Document]</dt>
<dd>
<p>The result of processing by an XML Pipeline or Step.</p>
</dd>
<dt class="label">[<a name="parameter" id="parameter" title="parameter">Definition</a>: Parameter]</dt>
<dd>
<p>A parameter is input to a Step or an XML Pipeline in addition to the Input and Output Document(s) that it may access. Parameters are most often simple, scalar values such as integers, booleans, and URIs, and they are most often named, but neither of these conditions is mandatory. That is, we do not (at this time) constrain the range of values a parameter may hold, nor do we (at this time) forbid a Step from accepting anonymous parameters.</p>
</dd>
<dt class="label">[<a name="pipeline-env" id="pipeline-env" title="Pipeline Environment">Definition</a>: XML Pipeline Environment]</dt>
<dd>
<p>The technology or platform environment in which the XML Pipeline is used (e.g. command-line, web servers, editors, browsers, embedded applications, etc.).</p>
</dd>
<dt class="label">[<a name="streaming" id="streaming" title="Streaming">Definition</a>: Streaming]</dt>
<dd>
<p>The ability to parse an XML document and pass infoitems between components without building a full document information set.</p>
</dd>
</dl>
</div>
<div class="div1">
<h2><a name="design-principles" id="design-principles"></a>3 Design Principles</h2>
<p>The design principles described in this document are requirements whose compliance with is an overall goal for the specification. It is not necessarily the case that a specific feature meets the requirement. Instead, it should be viewed that the whole set of specifications related to this requirements document meet that overall goal specified in the design principle.</p>
<dl>
<dt class="label">Technology Neutral</dt>
<dd>
<p>Applications should be free to implement XML processing using appropriate technologies such as SAX, DOM, or other infoset representations.</p>
</dd>
<dt class="label">Platform Neutral</dt>
<dd>
<p>Application computing platforms should not be limited to any particular class of platforms such as clients, servers, distributed computing infrastructures, etc. In addition, the resulting specifications should not be swayed by the specifics of use in those platform.</p>
</dd>
<dt class="label">Small and Simple</dt>
<dd>
<p>The language should be as small and simple as practical. It should be "small" in the sense that simple processing should be able to stated in a compact way and "simple" in the sense the specification of more complex processing steps do not require arduous specification steps in the <a title="Specification Language" href="#spec-lang">XML Pipeline Specification Document</a>.</p>
</dd>
<dt class="label">Infoset Processing</dt>
<dd>
<p>At a minimum, an XML document is represented and manipulated as an <a title="XML Information Set" href="#infoset">XML Information Set</a>. The use of supersets, augmented information sets, or data models that can be represented or conceptualized as information sets should be allowed, and in some instances, encouraged (e.g. for the XPath 2.0 Data Model).</p>
</dd>
<dt class="label">Straightforward Core Implementation</dt>
<dd>
<p>It should be relatively easy to implement a conforming implementation of the language but it should also be possible to build a sophisticated implementation that implements its own optimizations and integrates with other technologies.</p>
</dd>
<dt class="label">Address Practical Interoperability</dt>
<dd>
<p>An <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a> must be able to be exchanged between different software systems with a minimum expectation of the same result for the pipeline given that the <a title="Pipeline Environment" href="#pipeline-env">XML Pipeline Environment</a> is the same. A reasonable resolution to platform differences for binding or serialization of resulting infosets should be expected to be address by this specification or by re-use of existing specifications.</p>
</dd>
<dt class="label">Validation of XML Pipeline Documents by a Schema</dt>
<dd>
<p>The <a title="Specification Language" href="#spec-lang">XML Pipeline Specification Document</a> should be able to be validated by both W3C XML Schema and RelaxNG.</p>
</dd>
<dt class="label">Reuse and Support for Existing Specifications</dt>
<dd>
<p><a title="XML Pipeline" href="#xml-pipeline">XML Pipelines</a> need to support existing XML specifications and reuse common design patterns from within them. In addition, there must be support for the use of future specifications as much as possible.</p>
</dd>
<dt class="label">Arbitrary Components</dt>
<dd>
<p>The specification should allow use any component technology that can consume or produce <a title="XML Information Set" href="#infoset">XML Information Sets</a>.</p>
</dd>
<dt class="label">Control of Inputs and Outputs</dt>
<dd>
<p>An <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a> must allow control over specifying both the inputs and outputs of any process within the pipeline. This applies to the inputs and outputs of both the <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a> and its containing steps. It should also allow for the case where there might be multiple inputs and outputs.</p>
</dd>
<dt class="label">Control of Flow and Errors</dt>
<dd>
<p>An <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a> must allow control the explicit and implicit handling of the flow of documents between steps. When errors occur, these must be able to be handled explicitly to allow alternate courses of action within the <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a>.</p>
</dd>
</dl>
</div>
<div class="div1">
<h2><a name="requirements" id="requirements"></a>4 Requirements</h2>
<div class="div2">
<h3><a name="req-standard-names" id="req-standard-names"></a>4.1 Standard Names for Component Inventory [req-standard-names]</h3>
<p>The <a title="Specification Language" href="#spec-lang">XML Pipeline Specification Document</a> must have standard names for components that correspond, but not limited to, the following specifications <a href="#xml-core-wg">[xml-core-wg]</a>:</p>
<ul>
<li>
<p>XML Base</p>
</li>
<li>
<p>XInclude</p>
</li>
<li>
<p>XSLT 1.0/2.0</p>
</li>
<li>
<p>XSL FO</p>
</li>
<li>
<p>XML Schema</p>
</li>
<li>
<p>XQuery</p>
</li>
<li>
<p>RelaxNG</p>
</li>
</ul>
</div>
<div class="div2">
<h3><a name="req-new-components-steps" id="req-new-components-steps"></a>4.2 Allow Defining New Components and Steps [req-new-components-steps]</h3>
<p>An <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a> must allow applications to define and share new <a title="Step" href="#step">steps</a> that use new or existing <a title="Component" href="#component">components</a>. <a href="#xml-core-wg">[xml-core-wg]</a></p>
</div>
<div class="div2">
<h3><a name="req-minimal-components" id="req-minimal-components"></a>4.3 Minimal Component Support for Interoperability [req-minimal-components]</h3>
<p>There must be a minimal inventory of <a title="Component" href="#component">components</a> defined by the specification that are required to be supported to facilitate interoperability of <a title="XML Pipeline" href="#xml-pipeline">XML Pipelines</a>.</p>
</div>
<div class="div2">
<h3><a name="req-allow-composition" id="req-allow-composition"></a>4.4 Allow Pipeline Composition [req-allow-composition]</h3>
<p>Mechanisms for <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a> composition for re-use or re-purposing must be provided within the <a title="Specification Language" href="#spec-lang">XML Pipeline Specification Document</a>.</p>
</div>
<div class="div2">
<h3><a name="req-iteration" id="req-iteration"></a>4.5 Iteration of Documents and Elements [req-iteration]</h3>
<p><a title="XML Pipeline" href="#xml-pipeline">XML Pipelines</a> should allow iteration of a specific set of <a title="Step" href="#step">steps</a> over a collection of documents and or elements within a document.</p>
</div>
<div class="div2">
<h3><a name="req-conditional-processing" id="req-conditional-processing"></a>4.6 Conditional Processing of Inputs [req-conditional-processing]</h3>
<p>To allow run-time selection of <a title="Step" href="#step">steps</a>, <a title="XML Pipeline" href="#xml-pipeline">XML Pipelines</a> should provide mechanisms for conditional processing of documents or elements within documents based on expression evaluation. <a href="#xml-core-wg">[xml-core-wg]</a></p>
</div>
<div class="div2">
<h3><a name="req-error-handling-fallback" id="req-error-handling-fallback"></a>4.7 Error Handling and Fall-back [req-error-handling-fallback]</h3>
<p><a title="XML Pipeline" href="#xml-pipeline">XML Pipelines</a> must provide mechanisms for addressing error handling and fall-back behaviors. <a href="#xml-core-wg">[xml-core-wg]</a></p>
</div>
<div class="div2">
<h3><a name="req-xdm" id="req-xdm"></a>4.8 Support for the XPath 2.0 Data Model [req-xdm]</h3>
<p><a title="XML Pipeline" href="#xml-pipeline">XML Pipelines</a> must support the XPath 2.0 Data Model to allow support for XPath 2.0, XSLT 2.0, and XQuery as steps.</p>
<div class="note">
<p class="prefix"><b>Note:</b></p>
<p>At this point, there is no consensus in the working group that minimal conforming implementations are required to support the XPath 2.0 Data Model.</p>
</div>
</div>
<div class="div2">
<h3><a name="req-allow-optimization" id="req-allow-optimization"></a>4.9 Allow Optimization [req-allow-optimization]</h3>
<p>An <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a> should not inhibit a sophisticated implementation from performing parallel operations, lazy or greedy processing, and other optimizations. <a href="#xml-core-wg">[xml-core-wg]</a></p>
</div>
<div class="div2">
<h3><a name="req-streaming-pipes" id="req-streaming-pipes"></a>4.10 Streaming XML Pipelines [req-streaming-pipes]</h3>
<p>An <a title="XML Pipeline" href="#xml-pipeline">XML Pipeline</a> should allow for the existence of streaming pipelines in certain instances as an optional optimization. <a href="#xml-core-wg">[xml-core-wg]</a></p>
</div>
</div>
<div class="div1">
<h2><a name="use-cases" id="use-cases"></a>5 Use cases</h2>
<p>This section contains a set of use cases that support our requirements and will inform our design. While there is a want to address all the use cases listed in this document, in the end, the first version of those specifications may not solve all the following use cases. Those unsolved use cases may be address in future versions of those specifications.</p>
<p>To aid navigation, the requirements can be mapped to the use cases of this section as follows:</p>
<a name="requirements-to-use-cases" id="requirements-to-use-cases"></a>
<table class="requirements-to-use-cases" summary="Requirements and use cases">
<tbody>
<tr>
<th>Requirement</th>
<th>Use Cases</th>
</tr>
<tr>
<td><a href="#req-allow-optimization"><b>4.9 Allow Optimization</b></a></td>
<td><a href="#use-case-large-document-transform"><b>5.29 Large-Document Subtree Iteration</b></a>, <a href="#use-case-add-nav"><b>5.30 Adding Navigation to an Arbitrarily Large Document</b></a></td>
</tr>
<tr>
<td><a href="#req-streaming-pipes"><b>4.10 Streaming XML Pipelines</b></a></td>
<td><a href="#use-case-large-document-transform"><b>5.29 Large-Document Subtree Iteration</b></a>, <a href="#use-case-add-nav"><b>5.30 Adding Navigation to an Arbitrarily Large Document</b></a></td>
</tr>
<tr>
<td><a href="#req-new-components-steps"><b>4.2 Allow Defining New Components and Steps</b></a></td>
<td><a href="#use-case-run-program"><b>5.9 Run a Custom Program</b></a>, <a href="#use-case-computations"><b>5.27 Integrate Computation Components (MathML)</b></a></td>
</tr>
<tr>
<td><a href="#req-error-handling-fallback"><b>4.7 Error Handling and Fall-back</b></a></td>
<td><a href="#use-case-no-fallback-error"><b>5.32 No Fallback for XQuery Causes Error</b></a>, <a href="#use-case-fallback-choice"><b>5.31 Fallback to Choice of XSLT Processor</b></a></td>
</tr>
<tr>
<td><a href="#req-conditional-processing"><b>4.6 Conditional Processing of Inputs</b></a></td>
<td><a href="#use-case-content-depend"><b>5.21 Content-Dependent Transformations</b></a>, <a href="#use-case-add-nav"><b>5.30 Adding Navigation to an Arbitrarily Large Document</b></a></td>
</tr>
<tr>
<td><a href="#req-standard-names"><b>4.1 Standard Names for Component Inventory</b></a></td>
<td><a href="#use-case-parse-validate-transform"><b>5.3 Parse/Validate/Transform</b></a>, <a href="#use-case-xinclude"><b>5.2 XInclude Processing</b></a></td>
</tr>
<tr>
<td><a href="#req-minimal-components"><b>4.3 Minimal Component Support for Interoperability</b></a></td>
<td><a href="#use-case-parse-validate-transform"><b>5.3 Parse/Validate/Transform</b></a>, <a href="#use-case-xinclude"><b>5.2 XInclude Processing</b></a></td>
</tr>
<tr>
<td><a href="#req-allow-composition"><b>4.4 Allow Pipeline Composition</b></a></td>
<td><a href="#use-case-xml-rpc"><b>5.23 Response to XML-RPC Request</b></a>, <a href="#use-case-import-ingestion"><b>5.24 Database Import/Ingestion</b></a>, <a href="#use-case-rss-descriptions"><b>5.15 Parse and/or Serialize RSS descriptions</b></a></td>
</tr>
<tr>
<td><a href="#req-iteration"><b>4.5 Iteration of Documents and Elements</b></a></td>
<td><a href="#use-case-rss-descriptions"><b>5.15 Parse and/or Serialize RSS descriptions</b></a>, <a href="#use-case-multiple-command-line"><b>5.6 Multiple-file Command-line Document Generation</b></a>, <a href="#use-case-make-absolute-urls"><b>5.11 Make Absolute URLs</b></a>, <a href="#use-case-import-ingestion"><b>5.24 Database Import/Ingestion</b></a></td>
</tr>
<tr>
<td><a href="#req-xdm"><b>4.8 Support for the XPath 2.0 Data Model</b></a></td>
<td><a href="#use-case-collections"><b>5.16 XQuery and XSLT 2.0 Collections</b></a></td>
</tr>
</tbody>
</table>
<div class="note">
<p class="prefix"><b>Note:</b></p>
<p>The above table is known to be incomplete and will be completed in a later draft.</p>
</div>
<div class="div2">
<h3><a name="use-case-apply-sequence" id="use-case-apply-sequence"></a>5.1 Apply a Sequence of Operations [use-case-apply-sequence]</h3>
<p>Apply a sequence of operations such XInclude, validation, and transformation to a document, aborting if the result or an intermediate stage is not valid.</p>
<p>(source: <a href="#xml-core-wg">[xml-core-wg]</a>)</p>
</div>
<div class="div2">
<h3><a name="use-case-xinclude" id="use-case-xinclude"></a>5.2 XInclude Processing [use-case-xinclude]</h3>
<ol class="enumar">
<li>
<p>Retrieve a document containing XInclude instructions.</p>
</li>
<li>
<p>Locate documents to be included.</p>
</li>
<li>
<p>Perform XInclude inclusion.</p>
</li>
<li>
<p>Return a single XML document.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-parse-validate-transform" id="use-case-parse-validate-transform"></a>5.3 Parse/Validate/Transform [use-case-parse-validate-transform]</h3>
<ol class="enumar">
<li>
<p>Parse the XML.</p>
</li>
<li>
<p>Perform XInclude.</p>
</li>
<li>
<p>Validate with Relax NG, possibly aborting if not valid.</p>
</li>
<li>
<p>Validate with W3C XML Schema, possibly aborting if not valid.</p>
</li>
<li>
<p>Transform.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0012.html">(source: Norm Walsh)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-document-aggregation" id="use-case-document-aggregation"></a>5.4 Document Aggregation [use-case-document-aggregation]</h3>
<ol class="enumar">
<li>
<p>Locate a collection of documents to aggregate.</p>
</li>
<li>
<p>Perform aggregation under a new document element.</p>
</li>
<li>
<p>Return a single XML document.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-simple-command-line" id="use-case-simple-command-line"></a>5.5 Single-file Command-line Document Processing [use-case-simple-command-line]</h3>
<ol class="enumar">
<li>
<p>Read a DocBook document.</p>
</li>
<li>
<p>Validate the document.</p>
</li>
<li>
<p>Process it with XSLT.</p>
</li>
<li>
<p>Validate the resulting XHTML.</p>
</li>
<li>
<p>Save the HTML file using HTML serialization.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-multiple-command-line" id="use-case-multiple-command-line"></a>5.6 Multiple-file Command-line Document Generation [use-case-multiple-command-line]</h3>
<ol class="enumar">
<li>
<p>Read a list of source documents.</p>
</li>
<li>
<p>For each document in the list:</p>
<ol class="enumla">
<li>
<p>Read the document.</p>
</li>
<li>
<p>Perform a series of XSLT transformations.</p>
</li>
<li>
<p>Serialize each result.</p>
</li>
</ol>
</li>
<li>
<p>Alternatively, aggregate the resulting documents and serialize a single result.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-extract-mathml" id="use-case-extract-mathml"></a>5.7 Extracting MathML [use-case-extract-mathml]</h3>
<p>Extract MathML fragments from an XHTML document and render them as images. Employ an SVG renderer for SVG glyphs embedded in the MathML.</p>
<p>(source: <a href="#xml-core-wg">[xml-core-wg]</a>)</p>
</div>
<div class="div2">
<h3><a name="use-case-style-browser" id="use-case-style-browser"></a>5.8 Style an XML Document in a Browser [use-case-style-browser]</h3>
<p>Style an XML document in a browser with one of several different stylesheets without having multiple copies of the document containing different xml-stylesheet directives.</p>
<p>(source: <a href="#xml-core-wg">[xml-core-wg]</a>)</p>
</div>
<div class="div2">
<h3><a name="use-case-run-program" id="use-case-run-program"></a>5.9 Run a Custom Program [use-case-run-program]</h3>
<p>Run a program of your own, with some parameters, on an XML file and display the result in a browser.</p>
<p>(source: <a href="#xml-core-wg">[xml-core-wg]</a>)</p>
</div>
<div class="div2">
<h3><a name="use-case-xinclude-dsig" id="use-case-xinclude-dsig"></a>5.10 XInclude and Sign [use-case-xinclude-dsig]</h3>
<ol class="enumar">
<li>
<p>Process an XML document through XInclude.</p>
</li>
<li>
<p>Transform the result with XSLT using a fixed transformation.</p>
</li>
<li>
<p>Digitally sign the result with XML Signatures.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2006Feb/0062.html">(source: Henry Thompson)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-make-absolute-urls" id="use-case-make-absolute-urls"></a>5.11 Make Absolute URLs [use-case-make-absolute-urls]</h3>
<ol class="enumar">
<li>
<p>Process an XML document through XInclude.</p>
</li>
<li>
<p>Remove any xml:base attributes anywhere in the resulting document.</p>
</li>
<li>
<p>Schema validate the document with a fixed schema.</p>
</li>
<li>
<p>For all elements or attributes whose type is xs:anyURI, resolve the value against the base URI to create an absolute URI. Replace the value in the document with the resulting absolute URI.</p>
</li>
</ol>
<p>This example assumes preservation of infoset ([base URI]) and PSVI ([type definition]) properties from step to step. Also, there is no way to reorder these steps as the schema doesn't accept xml:base attributes but the expansion requires xs:anyURI typed values.</p>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2006Feb/0062.html">(source: Henry Thompson)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-simple-transform-service" id="use-case-simple-transform-service"></a>5.12 A Simple Transformation Service [use-case-simple-transform-service]</h3>
<ol class="enumar">
<li>
<p>Extract XML document (XForms instance) from an HTTP request body</p>
</li>
<li>
<p>Execute XSLT transformation on that document.</p>
</li>
<li>
<p>Call a persistence service with resulting document</p>
</li>
<li>
<p>Return the XML document from persistence service (new XForms instance) as the HTTP response body.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-handheld-service" id="use-case-handheld-service"></a>5.13 Service Request/Response Handling on a Handheld [use-case-handheld-service]</h3>
<p>Allow an application on a handheld device to construct a pipeline, send the pipeline and some data to the server, allow the server to process the pipeline and send the result back.</p>
<p>(source: <a href="#xml-core-wg">[xml-core-wg]</a>)</p>
</div>
<div class="div2">
<h3><a name="use-case-web-service" id="use-case-web-service"></a>5.14 Interact with Web Service (Tide Information) [use-case-web-service]</h3>
<ol class="enumar">
<li>
<p>Parse the incoming XML request.</p>
</li>
<li>
<p>Construct a URL to a REST-style web service at the NOAA (see <a href="http://tidesonline.nos.noaa.gov/geographic.html">website</a>).</p>
</li>
<li>
<p>Parse the resulting invalid HTML document with by translating and fixing the HTML to make it XHTML (e.g. use TagSoup or tidy).</p>
</li>
<li>
<p>Extract the tide information from a plain-text table of data from document by applying a regular expression and creating markup from the matches.</p>
</li>
<li>
<p>Use XQuery to select the high and low tides.</p>
</li>
<li>
<p>Formulate an XML response from that tide information.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0021.html">(source: Alex Milowski)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-rss-descriptions" id="use-case-rss-descriptions"></a>5.15 Parse and/or Serialize RSS descriptions [use-case-rss-descriptions]</h3>
<p>Parse descriptions:</p>
<ol class="enumar">
<li>
<p>Iterate over the RSS description elements and do the following:</p>
<ol class="enumla">
<li>
<p>Gather the text children of the 'description' element.</p>
</li>
<li>
<p>Parse the contents with a simulated document element in the XHTML namespace.</p>
</li>
<li>
<p>Send the resulting children as the children of the 'description element.</p>
</li>
</ol>
</li>
<li>
<p>Apply rest of pipeline steps.</p>
</li>
</ol>
<p>Serialize descriptions</p>
<ol class="enumar">
<li>
<p>Iterate over the RSS description elements and do the following:</p>
<ol class="enumla">
<li>
<p>Serialize the children elements.</p>
</li>
<li>
<p>Generate a new child as a text children containing the contents (escaped text).</p>
</li>
</ol>
</li>
<li>
<p>Apply rest of pipeline steps.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0021.html">(source: Alex Milowski)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-collections" id="use-case-collections"></a>5.16 XQuery and XSLT 2.0 Collections [use-case-collections]</h3>
<p>In XQuery and XSLT 2.0 there is the idea of an input and output collection and a pipeline must be able to consume or produce collections of documents both as inputs or outputs of steps as well as whole pipelines.</p>
<p>For example, for input collections:</p>
<ol class="enumar">
<li>
<p>Accept a collection of documents.</p>
</li>
<li>
<p>Apply a single XSLT 2.0 transformation that processes the collection and produces another collection.</p>
</li>
<li>
<p>Serialize the collection to files or URIs.</p>
</li>
</ol>
<p>For example, for output collections:</p>
<ol class="enumar">
<li>
<p>Accept a single document as input.</p>
</li>
<li>
<p>Apply an XQuery that produces a sequence of documents (a collection).</p>
</li>
<li>
<p>Serialize the collection to files or URIs.</p>
</li>
</ol>
</div>
<div class="div2">
<h3><a name="use-case-ajax-server" id="use-case-ajax-server"></a>5.17 An AJAX Server [use-case-ajax-server]</h3>
<ol class="enumar">
<li>
<p>Receive XML request with word to complete.</p>
</li>
<li>
<p>Call a sub-pipeline that retrieves list of completions for that word.</p>
</li>
<li>
<p>Format resulting document with XSLT.</p>
</li>
<li>
<p>Serialize response to XML.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-dynamic-xquery" id="use-case-dynamic-xquery"></a>5.18 Dynamic XQuery [use-case-dynamic-xquery]</h3>
<ol class="enumar">
<li>
<p>Dynamically create an XQuery query using XSLT, based on input XML document.</p>
</li>
<li>
<p>Execute the XQuery against a database.</p>
</li>
<li>
<p>Construct an XHTML result page using XSLT from the result of the query.</p>
</li>
<li>
<p>Serialize response to HTML.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-rw-non-xml" id="use-case-rw-non-xml"></a>5.19 Read/Write Non-XML File [use-case-rw-non-xml]</h3>
<ol class="enumar">
<li>
<p>Read a CSV file and convert it to XML.</p>
</li>
<li>
<p>Process the document with XSLT.</p>
</li>
<li>
<p>Convert the result to a CSV format using text serialization.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-update-insert-db" id="use-case-update-insert-db"></a>5.20 Update/Insert Document in Database [use-case-update-insert-db]</h3>
<ol class="enumar">
<li>
<p>Receive an XML document to save.</p>
</li>
<li>
<p>Check the database to see if the document exists.</p>
</li>
<li>
<p>If the document exists, update the document.</p>
</li>
<li>
<p>If the document does not exists, add the document.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-content-depend" id="use-case-content-depend"></a>5.21 Content-Dependent Transformations [use-case-content-depend]</h3>
<ol class="enumar">
<li>
<p>Receive an XML document to format.</p>
</li>
<li>
<p>If the document is XHTML, apply a theme via XSLT and serialize as HTML.</p>
</li>
<li>
<p>If the document is XSL-FO, apply an XSL FO processor to produce PDF.</p>
</li>
<li>
<p>Otherwise, serialize the document as XML.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-config-depend" id="use-case-config-depend"></a>5.22 Configuration-Dependent Transformations [use-case-config-depend]</h3>
<p>Mobile example:</p>
<ol class="enumar">
<li>
<p>Receive an XML document to format.</p>
</li>
<li>
<p>If the configuration is "desktop browser", apply desktop XSLT and serialize as HTML.</p>
</li>
<li>
<p>If the configuration is "mobile browser", apply mobile XSLT and serialize as XHTML.</p>
</li>
</ol>
<p>News feed example:</p>
<ol class="enumar">
<li>
<p>Receive an XML document in Atom format.</p>
</li>
<li>
<p>If the configuration is "RSS 1.0", apply "Atom to RSS 1.0" XSLT.</p>
</li>
<li>
<p>If the configuration is "RSS 2.0", apply "Atom to RSS 2.0" XSLT.</p>
</li>
<li>
<p>Serialize the document as XML.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-xml-rpc" id="use-case-xml-rpc"></a>5.23 Response to XML-RPC Request [use-case-xml-rpc]</h3>
<ol class="enumar">
<li>
<p>Receive an XML-RPC request.</p>
</li>
<li>
<p>Validate the XML-RPC request with a RelaxNG schema.</p>
</li>
<li>
<p>Dispatch to different sub-pipelines depending on the content of /methodCall/methodName.</p>
</li>
<li>
<p>Format the sub-pipeline response to XML-RPC format via XSLT.</p>
</li>
<li>
<p>Validate the XML-RPC response with an W3C XML Schema.</p>
</li>
<li>
<p>Return the XML-RPC response.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-import-ingestion" id="use-case-import-ingestion"></a>5.24 Database Import/Ingestion [use-case-import-ingestion]</h3>
<p>Import example:</p>
<ol class="enumar">
<li>
<p>Read a list of source documents.</p>
</li>
<li>
<p>For each document in the list:</p>
<ol class="enumla">
<li>
<p>Validate the document.</p>
</li>
<li>
<p>Call a sub-pipeline to insert content into a relational or XML database.</p>
</li>
</ol>
</li>
</ol>
<p>Ingestion example:</p>
<ol class="enumar">
<li>
<p>Receive a directory name.</p>
</li>
<li>
<p>Produce a list of files in the directory as an XML document.</p>
</li>
<li>
<p>For each element representing a file:</p>
<ol class="enumla">
<li>
<p>Create an iTQL query using XSLT.</p>
</li>
<li>
<p>Query the repository to check if the file has been uploaded.</p>
</li>
<li>
<p>Upload if necessary.</p>
</li>
<li>
<p>Inspect the file to check the metadata type.</p>
</li>
<li>
<p>Transform the document with XSLT.</p>
</li>
<li>
<p>Make a SOAP call to ingest the document.</p>
</li>
</ol>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-metadata" id="use-case-metadata"></a>5.25 Metadata Retrieval [use-case-metadata]</h3>
<ol class="enumar">
<li>
<p>Call a SOAP service with metadata format as a parameter.</p>
</li>
<li>
<p>Create an iTQL query with XSLT.</p>
</li>
<li>
<p>Query a repository for the XML document.</p>
</li>
<li>
<p>Load a list of XSLT transformations from a configuration.</p>
</li>
<li>
<p>Iteratively execute the XSLT transformations.</p>
</li>
<li>
<p>Serialize the result to XML.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0020.html">(source: Erik Bruchez)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-non-xml-production" id="use-case-non-xml-production"></a>5.26 Non-XML Document Production [use-case-non-xml-production]</h3>
<ol class="enumar">
<li>
<p>An non-XML document is fed into the process.</p>
</li>
<li>
<p>That input is converted into a well-formed XML document.</p>
</li>
<li>
<p>A table of contents is extracted.</p>
</li>
<li>
<p>Pagination is performed.</p>
</li>
<li>
<p>Each page is transformed into some output language.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0016.html">(source: Rui Lopes)</a></p>
<ol class="enumar">
<li>
<p>Read a non-XML document.</p>
</li>
<li>
<p>Transform.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0012.html">(source: Norm Walsh)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-computations" id="use-case-computations"></a>5.27 Integrate Computation Components (MathML) [use-case-computations]</h3>
<ol class="enumar">
<li>
<p>Select a MathML content element.</p>
</li>
<li>
<p>For that element, apply a computation (e.g. compute the kernel of a matrix).</p>
</li>
<li>
<p>Replace the input MathML with the output of the computation.</p>
</li>
</ol>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/0021.html">(source: Alex Milowski)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-dsdl-validation" id="use-case-dsdl-validation"></a>5.28 Document Schema Definition Languages (DSDL) - Part 10: Validation Management [use-case-dsdl-validation]</h3>
<p>This document provides a test scenario that will be used to create validation management scripts using a range of existing techniques, including those used for program compilation, etc.</p>
<p>The steps required to validate our sample document are:</p>
<ol class="enumar">
<li>
<p>Use ISO 19757-4 Namespace-based Validation Dispatching Language (NVDL) to split out the parts of the document that are encoded using HTML, SVG and MathML from the bulk of the document, whose tags are defined using a user-defined set of markup tags.</p>
</li>
<li>
<p>Validate the HTML elements and attributes using the HTML 4.0 DTD (W3C XML DTD).</p>
</li>
<li>
<p>Use a set of Schematron rules stored in check-metadata.xml to ensure that the metadata of the HTML elements defined using Dublin Core semantics conform to the information in the document about the document's title and subtitle, author, encoding type, etc.</p>
</li>
<li>
<p>Validate the SVG components of the file using the standard W3C schema provided in the SVG 1.2 specification.</p>
</li>
<li>
<p>Use the Schematron rules defined in SVG-subset.xml to ensure that the SVG file only uses those features of SVG that are valid for the particular SVG viewer available to the system.</p>
</li>
<li>
<p>Validate the MathML components using the latest version of the MathML schema (defined in RELAX-NG) to ensure that all maths fragments are valid. The schema will make use the datatype definitions in check-maths.xml to validate the contents of specific elements.</p>
</li>
<li>
<p>Use MathML-SVG.xslt to transform the MathML segments to displayable SVG and replace each MathML fragment with its SVG equivalent.</p>
</li>
<li>
<p>Use the ISO 19757-8 Document Schema Renaming Language (DSRL) definitions in convert-mynames.xml to convert the tags in the local nameset to the form that can be used to validate the remaining part of the document using docbook.dtd.</p>
</li>
<li>
<p>Use the IS0 19757-7 Character Repertoire Definition Language (CRDL) rules defined in mycharacter-checks.xml to validate that the correct character sets have been used for text identified as being Greek and Cyrillic.</p>
</li>
<li>
<p>Convert the Docbook tags to HTML so that they can be displayed in a web browser using the docbook-html.xslt transformation rules.</p>
</li>
</ol>
<p>Each validation script should allow the four streams produced by step 1 to be run in parallel without requiring the other validations to be carried out if there is an error in another stream. This means that steps 2 and 3 should be carried out in parallel to steps 4 and 5, and/or steps 6 and 7 and/or steps 8 and 9. After completion of step 10 the HTML (both streams), and SVG (both streams) should be recombined to produce a single stream that can fed to a web browser. The flow is illustrated in the
following diagram:</p>
<p><img src="dsdl.jpg" alt="DSDL use case graphic" /></p>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2005Dec/att-0007/Part10Reqs.htm">(source: Martin Bryan)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-large-document-transform" id="use-case-large-document-transform"></a>5.29 Large-Document Subtree Iteration [use-case-large-document-transform]</h3>
<p>Running XSLT on a very large document isn't typically practical. In these cases, it is often the case that a particular element, that may be repeated over-and-over again, needs to be transformed. Conceptually, a pipeline could limit the transformation to a subtree by:</p>
<ol class="enumar">
<li>
<p>Limiting the transform to a subtree of the document identified by an XPath.</p>
</li>
<li>
<p>For each subtree, cache the subtree and build a whole document with the identified element as the document element and then run a transform to replace that subtree in the original document.</p>
</li>
<li>
<p>For any non-matches, the document remains the same and "streams" around the transform.</p>
</li>
</ol>
<p>This allows the transform and the tree building to be limited to a small subtree and the rest of the process to stream. As such, an arbitrarily large document can be processed in a bounded amount of memory.</p>
<p><a href="http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2006Jan/0005.html">(source: Alex Milowski)</a></p>
</div>
<div class="div2">
<h3><a name="use-case-add-nav" id="use-case-add-nav"></a>5.30 Adding Navigation to an Arbitrarily Large Document [use-case-add-nav]</h3>
<p>For a particular website, every XHTML document needs to have navigation elements added to the document. The navigation is static text that surrounds the body of the document. This navigation is added by:</p>
<ol class="enumar">
<li>
<p>Matching the head and body elements using a XPath expression that can be streamed.</p>
</li>
<li>
<p>Inserting a stub for a transformation for including the style and surrounding navigation of the site.</p>
</li>
<li>
<p>For each of the stubs, transformations insert the markup using a subtree expansion that allows the rest of the document to stream.</p>
</li>
</ol>
<p>In the end, the pipeline allows arbitrarily large XHTML document to be processed with a near-constant cost.</p>
<p>(source: Alex Milowski)</p>
</div>
<div class="div2">
<h3><a name="use-case-fallback-choice" id="use-case-fallback-choice"></a>5.31 Fallback to Choice of XSLT Processor [use-case-fallback-choice]</h3>
<p>A step in a pipeline produces multiple output documents. In XSLT 2.0, this is a standard feature of all XSLT 2.0 processors. In XSLT 1.0, this is not standard.</p>
<p>A pipeline author wants to write a pipeline that, at compile-time, the implementation chooses XSLT 2.0 when possible and degrades to XSLT 1.0 when XSLT 2.0 is not supported. In the case of XSLT 1.0, the step will use XSLT extensions to support the multiple output documents--which again may fail. Fortunately, the XSLT 1.0 transformation can be written to test for this.</p>
<p>(source: Alex Milowski)</p>
</div>
<div class="div2">
<h3><a name="use-case-no-fallback-error" id="use-case-no-fallback-error"></a>5.32 No Fallback for XQuery Causes Error [use-case-no-fallback-error]</h3>
<p>As the final step in a pipeline, XQuery is required to be run. If the XQuery step is not available, the compilation of the pipeline needs to fail. Here the pipeline author has chosen that the pipeline must not run if XQuery is not available.</p>
<p>(source: Alex Milowski)</p>
</div>
</div>
</div>
<div class="back">
<div class="div1">
<h2><a name="references" id="references"></a>A References</h2>
<dl>
<dt class="label"><a name="xml-core-wg" id="xml-core-wg"></a>xml-core-wg</dt>
<dd><a href="http://www.w3.org/TR/proc-model-req/"><cite>XML Processing Model Requirements</cite></a>. Dmitry Lenkov, Norman Walsh, editors. W3C Working Group Note 05 April 2004 (See http://www.w3.org/TR/proc-model-req/.)</dd>
<dt class="label"><a name="xml-infoset-rec" id="xml-infoset-rec"></a>xml-infoset-rec</dt>
<dd><a href="http://www.w3.org/TR/xml-infoset/"><cite>XML Information Set (Second Edition)</cite></a> John Cowan, Richard Tobin, editors. W3C Working Group Note 04 February 2004 (See http://www.w3.org/TR/xml-infoset/.)</dd>
</dl>
</div>
<div class="div1">
<h2><a name="contributors" id="contributors"></a>B Contributors</h2>
<p>The following members of the XML Core Working Group contributed to this specification as part of their requirements document effort within that working group:</p>
<ul>
<li>
<p>Dmitry Lenkov, Oracle Corporation</p>
</li>
<li>
<p>Norman Walsh, Sun Microsystems, Inc</p>
</li>
</ul>
</div>
</div>
</body>
</html>