generated from usnistgov/opensource-repo
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtutorial-preview.html
3980 lines (3974 loc) · 271 KB
/
tutorial-preview.html
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xml; charset=UTF-8">
<title>TUTORIAL PREVIEW</title>
<style xml:space="preserve" type="text/css">
.toc { font-size: 70%; padding: 0.4em; outline: thin solid black; margin: 0.4em 0em; width: fit-content; counter-reset: lessonNo 0; font-family: sans-serif }
.toc * { margin: 0em; font-weight: normal }
.toc div { margin: 0.2em; margin-left: 1em; outline: thin solid grey; height: fit-content }
.toc .lesson { display: grid; grid-template-columns: 1fr repeat(3,3fr); counter-increment: lessonNo 1; padding: 0.8em }
.toc .lesson:nth-child(even) { background-color: lightsteelblue }
.toc div.lesson:before { content: attr(class) ' ' counter(lessonNo) ': ' attr(name); background-color: lavender; color: midnightblue; padding: 0.2em; font-family: sans-serif; display: inline-block; height: fit-content }
.toc .unit { clamp(12vw, 100%, 24vw) }
section section section { margin: 0.2em; margin-left: 1em; padding-left: 0.6em; border-left: medium solid grey }
table { width: 80vw; resize: horizontal; padding: 0.8em; background-color: whitesmoke; position: relative; border: thin solid grey; overflow: auto; display: inherit }
tr:nth-child(even) { background-color: gainsboro }
th { width: clamp(10em, auto, 40em) }
td { width: clamp(10em, auto, 40em); border-top: thin solid grey }
section.unit { width: clamp(45ch, 100%, 75ch); padding: 0.8em; outline: thin solid black; margin: 0.6em 0em }
section.unit h1:first-child { margin-top: 0em }
.observer { background-color: honeydew ; grid-column: 2 }
.maker { background-color: seashell ; grid-column: 3 }
.learner { background-color: aliceblue; grid-column: 4 }
span.wordcount { font-size: smaller; font-weight: bolder; font-style: italic; break-inside: avoid }
span.wordcount.over { color: darkred }
</style>
</head>
<body>
<h1>XProc in Action: an Immersive Introduction</h1>
<h3>version 1.0_draft PREVIEW December 20 2024</h3>
<div class="toc">
<div class="lesson"
id="toc-acquire"
name="acquire">
<div class="unit observer"
id="toc-acquire_101"
data-track="observer">
<h1>101: Project setup and installation<span class="wordcount okay"> (~1714)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Step One: Setup</h2>
<div>
<h3>Shortcut</h3>
</div>
</div>
<div>
<h2>Step Two: Confirm</h2>
</div>
<div>
<h2>Comments / review</h2>
<div>
<h3>When running from a command line</h3>
</div>
</div>
</div>
<div class="unit maker"
id="toc-acquire_102"
data-track="maker">
<h1>102: Examining the setup<span class="wordcount okay"> (~885)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Step One: Inspect the pipelines</h2>
</div>
<div>
<h2>Step Two: Modify the pipelines</h2>
</div>
<div>
<h2>For consideration</h2>
</div>
</div>
<div class="unit learner"
id="toc-acquire_599"
data-track="learner">
<h1>599: Meeting XProc<span class="wordcount okay"> (~698)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Some observations</h2>
</div>
<div>
<h2>Declarative markup in action</h2>
<div>
<h3>Standards for documents</h3>
</div>
</div>
</div>
</div>
<div class="lesson"
id="toc-walkthrough"
name="walkthrough">
<div class="unit observer"
id="toc-walkthrough_101"
data-track="observer">
<h1>101: Unpacking XProc 3.0<span class="wordcount over"> (~2752)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
<div>
<h3>For reference</h3>
</div>
</div>
<div>
<h2>A closer look</h2>
</div>
<div>
<h2>Survey</h2>
<div>
<h3>
<a href="../smoketest/TEST-XPROC3.xpl">TEST-XPROC3</a>
</h3>
</div>
<div>
<h3>
<a href="../smoketest/TEST-XSLT.xpl">TEST-XSLT</a>
</h3>
</div>
<div>
<h3>
<a href="../smoketest/TEST-SCHEMATRON.xpl">TEST-SCHEMATRON</a>
</h3>
</div>
<div>
<h3>
<a href="../smoketest/TEST-XSPEC.xpl">TEST-XSPEC</a>
</h3>
</div>
</div>
<div>
<h2>A not-so-simple pipeline</h2>
<div>
<h3>PRODUCE-PROJECTS-ELEMENTLIST</h3>
</div>
</div>
<div>
<h2>Respecting XML syntax, XPath and XProc</h2>
</div>
<div>
<h2>Learning more about XProc</h2>
</div>
</div>
<div class="unit maker"
id="toc-walkthrough_102"
data-track="maker">
<h1>102: XProc fundamentals<span class="wordcount okay"> (~1526)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Learning more about XProc</h2>
</div>
<div>
<h2>Details details!</h2>
<div>
<h3>TEST-XSPEC</h3>
</div>
<div>
<h3>PRODUCE-PROJECTS-ELEMENTLIST</h3>
</div>
</div>
<div>
<h2>Messing around</h2>
<div>
<h3>Disabling your code</h3>
</div>
</div>
<div>
<h2>Take note</h2>
<div>
<h3>Where are these downloads coming from?</h3>
</div>
<div>
<h3>Syntax tips</h3>
</div>
</div>
</div>
<div class="unit learner"
id="toc-walkthrough_219"
data-track="learner">
<h1>219: XProc, XML and XDM (the XML Data Model)<span class="wordcount over"> (~2214)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>XProc as XML</h2>
<div>
<h3>Survey of XProc elements</h3>
</div>
</div>
<div>
<h2>XML and the XML Data Model (XDM): context and rationale</h2>
</div>
<div>
<h2>Snapshot history: an XML time line</h2>
</div>
<div>
<h2>XPath</h2>
<div>
<h3>Documents and data</h3>
</div>
<div>
<h3>XPath illustrative examples</h3>
</div>
</div>
<div>
<h2>Exercise: Discussion board</h2>
</div>
</div>
<div class="unit observer"
id="toc-walkthrough_301"
data-track="observer">
<h1>301: Automated XProc<span class="wordcount okay"> (~954)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>XProc for quality testing</h2>
<div>
<h3>Pipelines useful for the developer:</h3>
</div>
<div>
<h3>Pipelines run under CI/CD</h3>
</div>
<div>
<h3>File set listings as step declarations</h3>
</div>
<div>
<h3>About the XProc House Rules</h3>
</div>
<div>
<h3>About XSpec testing in this repository</h3>
</div>
</div>
<div>
<h2>XProc running under continuous integration and development (CI/CD)</h2>
</div>
</div>
<div class="unit learner"
id="toc-walkthrough_401"
data-track="learner">
<h1>401: The XSLT Factor<span class="wordcount over"> (~2667)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
<div>
<h3>XSLT 1.0 and XPath 1.0</h3>
</div>
<div>
<h3>XSLT 2.0 and XQuery 1.0</h3>
</div>
<div>
<h3>XSLT 3.0, XQuery 3.0, XPath 3.1</h3>
</div>
</div>
<div>
<h2>XSLT: XSL (XML Stylesheet Language) Transformations</h2>
<div>
<h3>Reflecting on XSLT</h3>
</div>
<div>
<h3>Running XSLT without XProc</h3>
</div>
</div>
<div>
<h2>Using XSLT in XProc: avoiding annoyances</h2>
<div>
<h3>Namespaces in and for your XSLT</h3>
</div>
<div>
<h3>Text and attribute value syntax in embedded XSLT</h3>
</div>
</div>
<div>
<h2>Learning XSLT the safer way</h2>
</div>
<div>
<h2>XProc without XSLT?</h2>
</div>
<div>
<h2>XProc, XDM (the XML data model) and the standards stack</h2>
</div>
</div>
</div>
<div class="lesson"
id="toc-oscal-convert"
name="oscal-convert">
<div class="unit observer"
id="toc-oscal-convert_101"
data-track="observer">
<h1>101: Converting OSCAL – XML to JSON and JSON to XML<span class="wordcount over"> (~2170)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Pipeline rundown</h2>
<div>
<h3>
<a href="../projects/oscal-convert/GRAB-RESOURCES.xpl">GRAB-RESOURCES</a>
</h3>
</div>
<div>
<h3>
<a href="../projects/oscal-convert/BATCH_JSON-TO-XML.xpl">BATCH-JSON-TO-XML</a>
</h3>
</div>
<div>
<h3>
<a href="../projects/oscal-convert/BATCH_XML-TO-JSON.xpl">BATCH-XML-TO-JSON</a>
</h3>
</div>
<div>
<h3>
<a href="../projects/oscal-convert/CONVERT-OSCAL-XML-DATA.xpl">CONVERT-OSCAL-XML-DATA</a>
</h3>
</div>
<div>
<h3>
<a href="../projects/oscal-convert/CONVERT-OSCAL-XML-FOLDER.xpl">CONVERT-OSCAL-XML-FOLDER</a>
</h3>
</div>
</div>
<div>
<h2>Working concept: return trip</h2>
</div>
<div>
<h2>What is this XSLT?</h2>
</div>
<div>
<h2>What could possibly go wrong?</h2>
<div>
<h3>The playing field is the Internet</h3>
</div>
</div>
<div>
<h2>More catalogs needed!</h2>
</div>
</div>
<div class="unit maker"
id="toc-oscal-convert_102"
data-track="maker">
<h1>102: Hands on data conversions<span class="wordcount over"> (~3348)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Some breaking and making</h2>
</div>
<div>
<h2>Value templates in attributes and text: { XPath-expr }</h2>
</div>
<div>
<h2>Designating inputs</h2>
<div>
<h3>Lightening the <code>p:load</code>
</h3>
</div>
</div>
<div>
<h2>Warning: do you know where your source files are?</h2>
</div>
<div>
<h2>Probing error space – data conversions</h2>
<div>
<h3>Converting broken XML or JSON</h3>
</div>
<div>
<h3>Converting not-OSCAL</h3>
</div>
<div>
<h3>Converting broken OSCAL</h3>
</div>
</div>
<div>
<h2>XProc diagnostic how-to</h2>
<div>
<h3>Emitting runtime messages</h3>
</div>
<div>
<h3>Saving out interim results</h3>
</div>
</div>
<div>
<h2>Validate early and often</h2>
</div>
</div>
<div class="unit learner"
id="toc-oscal-convert_201"
data-track="learner">
<h1>201: Anatomy of an XProc pipeline<span class="wordcount over"> (~2779)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>XProc as XML (redux)</h2>
<div>
<h3>XProc at the top</h3>
</div>
<div>
<h3>Namespaces</h3>
</div>
<div>
<h3>@name and @type</h3>
</div>
</div>
<div>
<h2>Prologue and body</h2>
</div>
<div>
<h2>XProc steps</h2>
</div>
<div>
<h2>Atomic and compound steps</h2>
</div>
<div>
<h2>Namespaces and extension steps</h2>
</div>
<div>
<h2>Schema for XProc 3.0</h2>
</div>
</div>
<div class="unit maker"
id="toc-oscal-convert_350"
data-track="maker">
<h1>350: Namespaces in XML and XProc<span class="wordcount okay"> (~724)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>XML and namespaces</h2>
</div>
<div>
<h2>Namespace fixup and namespace cleanup steps</h2>
</div>
<div>
<h2>Namespace tips and tricks</h2>
<div>
<h3>Coining new namespaces</h3>
</div>
<div>
<h3>On-the-fly namespace declarations</h3>
</div>
<div>
<h3>Overloading prefixes</h3>
</div>
<div>
<h3>Matching with namespace wildcard</h3>
</div>
</div>
</div>
<div class="unit learner"
id="toc-oscal-convert_400"
data-track="learner">
<h1>400: Documents in XProc<span class="wordcount okay"> (~1750)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>What is an XProc document</h2>
</div>
<div>
<h2>A universe of content types</h2>
<div>
<h3>XML and XML-like content</h3>
</div>
<div>
<h3>JSON and other text-based formats</h3>
</div>
<div>
<h3>Binaries and what-have-you</h3>
</div>
</div>
</div>
<div class="unit maker"
id="toc-oscal-convert_401"
data-track="maker">
<h1>401: XProc, XML, JSON and content types<span class="wordcount okay"> (~274)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Exercise some options</h2>
</div>
</div>
</div>
<div class="lesson"
id="toc-courseware"
name="courseware">
<div class="unit observer"
id="toc-courseware_101"
data-track="observer">
<h1>Courseware 101: Producing this tutorial<span class="wordcount okay"> (~433)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Tutorial production pipelines</h2>
<div>
<h3>
<a href="../tutorial/PRODUCE-TUTORIAL-PREVIEW.xpl">PRODUCE-TUTORIAL-PREVIEW</a>
</h3>
</div>
<div>
<h3>
<a href="../tutorial/PRODUCE-TUTORIAL-MARKDOWN.xpl">PRODUCE-TUTORIAL-MARKDOWN</a>
</h3>
</div>
<div>
<h3>
<a href="../tutorial/PRODUCE-TUTORIAL-TOC.xpl">PRODUCE-TUTORIAL-TOC</a>
</h3>
</div>
<div>
<h3>
<a href="../tutorial/PRODUCE-PROJECTS-ELEMENTLIST.xpl">PRODUCE-PROJECTS-ELEMENTLIST</a>
</h3>
</div>
</div>
</div>
<div class="unit maker"
id="toc-courseware_219"
data-track="maker">
<h1>Courseware 219: Learn by Teaching<span class="wordcount okay"> (~754)</span>
</h1>
<div>
<h2>Goals</h2>
</div>
<div>
<h2>Prerequisites</h2>
</div>
<div>
<h2>Resources</h2>
</div>
<div>
<h2>Improve or enhance a lesson or lesson unit</h2>
<div>
<h3>Apply Schematron to your edits</h3>
</div>
</div>
<div>
<h2>Create a new set of lessons</h2>
</div>
<div>
<h2>Produce a new project and document it with a tutorial</h2>
</div>
</div>
</div>
</div>
<section class="lesson"
id="acquire"
name="acquire">
<section class="unit observer"
id="acquire_101"
data-track="observer">
<h1>101: Project setup and installation</h1>
<section>
<h2>Goals</h2>
<p>Set up and run an XProc 3.0 pipeline in an XProc 3.0 engine.</p>
<p>Get some results. See them in the console (message tracebacks), the file system (new files acquired or
produced), or both.</p>
<p>With a little practice, become comfortable running XProc pipelines.</p>
<p>After the first script to get the XProc engine, we use XProc for subsequent downloads. Finishing the setup
gets you started practicing with the pipelines.</p>
</section>
<section>
<h2>Prerequisites</h2>
<p>If you have not done so, scan the <a href="../tutorial/readme.md">tutorial readme file</a> for some helpful
background and ideas on how tutorial materials are arranged.</p>
<p>If ready to proceed, <b>you have a system with Java installed</b> offering a JVM (Java Virtual Machine)
available on the command line (a JRE or JDK), version 8 (and later).</p>
<p>
<b>Tip:</b> check your Java version from the console using <code>java --version</code>.</p>
<p>Also, <b>you have an Internet connection available</b> and the capability to download and save resources
(binaries and code libraries) for local use. (There are no runtime dependencies on connecting, but some
XProc pipelines make requests over <code>http/s</code>.)</p>
<p>
<b>You are comfortable entering commands on the command line</b> (i.e. terminal or console window). For
installation, you want a <code>bash</code> shell if available. On Windows, both WSL (Ubuntu) and Git Bash
have been found to work. If you cannot use <code>bash</code>, the setup can be done by hand (downloading and
unpacking a package from SourceForge).</p>
<p>After installation, subsequent work on Windows does not require <code>bash</code> unless you choose to use
it – a Windows <code>CMD</code> or Powershell can serve as your environment and the processor invoked with a
Windows <code>bat</code> file (as described in the documentation). Mac and Linux (and WSL) users can
continue to use <code>bash</code>.</p>
<p>If you have already performed the setup as described in <a href="../README.md">README</a> and <a href="../setup-notes.md">setup notes</a>, this lesson unit will be a breeze.</p>
<p>Prior knowledge of XProc, XSLT or XML is <i>not</i> a prerequisite (for this or any lesson unit). If you are
learning as we go – at any level – welcome and please seek us out for help and feedback.</p>
</section>
<section>
<h2>Resources</h2>
<p>The setup script is a <code>bash</code> script: <a href="../setup.sh">./setup.sh</a>, to be run with
no arguments. See <a href="../setup-notes.md">top-level documentation</a> if you can't use this script
or if you prefer to download and unzip the dependencies by hand.</p>
<p>For XProc runtime — to execute pipelines — use either of the scripts <a href="../xp3.sh">./xp3.sh</a>
(under <code>bash</code>) or <a href="../xp3.bat">./xp3.bat</a> (for Windows). These scripts are used
for all pipelines (basically, for everything) unless otherwise noted.</p>
<p>To perform the setup: first, you download an XProc engine; then you complete setup and testing by running
these pipelines. They are described in top-level <a href="../README.md">README</a> documentation and
the expected places.</p>
<ul>
<li>
<a href="../lib/GRAB-SAXON.xpl">lib/GRAB-SAXON.xpl</a>
</li>
<li>
<a href="../lib/GRAB-SCHXSLT.xpl">lib/GRAB-SCHXSLT.xpl</a>
</li>
<li>
<a href="../lib/GRAB-XSPEC.xpl">lib/GRAB-XSPEC.xpl</a>
</li>
<li>
<a href="../smoketest/TEST-XPROC3.xpl">smoketest/TEST-XPROC3.xpl</a>
</li>
<li>
<a href="../smoketest/TEST-XSLT.xpl">smoketest/TEST-XSLT.xpl</a>
</li>
<li>
<a href="../smoketest/TEST-SCHEMATRON.xpl">smoketest/TEST-SCHEMATRON.xpl</a>
</li>
<li>
<a href="../smoketest/TEST-XSPEC.xpl">smoketest/TEST-XSPEC.xpl</a>
</li>
</ul>
</section>
<section>
<h2>Step One: Setup</h2>
<p>Find setup instructions for the repository in the <a href="../README.md">Project README</a> and in the
linked <a href="../setup-notes.md">Setup Notes</a>.</p>
<p>After reading and reviewing these documents, perform the setup on your system as instructed. To do this you
can either fork or clone the repository in GitHub or simply download and decompress a zip of the <a href="../">current
distribution</a>.</p>
<p>After running the setup script, or performing the installation by hand, make sure you can run all the smoke
tests successfully.</p>
<p>As noted in the docs, if you happen already to have an XProc 3.0 processor, you do not need to download <a href="../">Morgana XProc III</a> here. At time of writing
(December 2024) this notably includes <a href="../">XML Calabash
3</a> (newly out in an alpha release). In any case, equipped with <i>any conformant XProc 3.0/3.1
implemenentation</i>. try skipping straight to the smoke tests. You can use a runtime script
<code>xp3.sh</code> or <code>xp3.bat</code> as a model for your own, and adjust.</p>
<section>
<h3>Shortcut</h3>
<p>If you want to run through the tutorial exercises but you are unsure of how deeply you will delve, you
can postpone two of the installations until later:</p>
<ul>
<li>You will need XSpec only when you want to run tests of stylesheets or queries using the <a href="../">XSpec</a> testing framework</li>
<li>You will need SchXSLT only when you want to run Schematron (or XSpec tests of Schematron)</li>
</ul>
<p>When you see tracebacks suggesting one of these is not supported, you can return to setup.</p>
<p>Since almost any pipeline will use XSLT and since we do use the latest version (XSLT 3.0 with XPath 3.1),
consider the Saxon installation an essential requirement.</p>
</section>
</section>
<section>
<h2>Step Two: Confirm</h2>
<p>The top-level README and setup notes also describe testing your installation. Do this next.</p>
<p>You know things are working in your XProc when two things are happening:</p>
<ul>
<li>On the console, notifications show up with reassuring messages announcing progress</li>
<li>When you expect files to be produced for you, they appear, or are updated, as expected</li>
</ul>
<p>Both of those will occur with this lesson. The files produced by downloading pipelines are written into the
project <code>lib</code> directory, as documented. Refresh or restore by deleting the downloaded files and
running the pipelines to acquire them again.</p>
<p>Note: you need a live Internet connection for your <code>http</code> requests to go through.</p>
<p>When you can run all the smoke tests without ugly tracebacks, this lesson is complete.</p>
</section>
<section>
<h2>Comments / review</h2>
<p>Within this project as a whole, and within its subprojects, everything is done with XProc 3.0. The aim is to
make it possible to do anything needed with XProc, regarded as a general-purpose 'scripting' solution for
the choreography of arbitrarily complex jobs, tasks and workflows. To support arbitrary complexity and
scalability together, it must be very simple. This simplicity, with the composability that goes with it, is
at the center of the argument for XProc.</p>
<p>You will see this simplicity at the level of <q>top-level</q>
<em>invocation</em> XProc pipelines designed to serve as entry points. If things are done right, these will
be fairly simple, well encapsulated <q>subroutines</q> in potentially elegant arrangements. They in turn may
call on libraries of XProc pipelines for well-defined tasks.</p>
<p>Effectively (and much more could be said about the processing stack, dependency management and so forth)
what this means is that XProc promises the user and the developer (in either or both roles) with focused and
concentrated points of control or points of adjustment. In the field – where software is deployed and used –
things almost never just <q>drop in</q>. User interfaces, APIs, dependencies and platform quirks: all these
constrain what users can do, and even developers are rarely as free as they would like to experiment and
explore.</p>
<p>What is offered here is therefore <i>both</i> an example of a deployment of a demonstration solution set
using an open-source tool (an XProc engine capable of running the pipelines we offer), doing things that are
actually or potential useful (with OSCAL data), <i>and</i> a set of pipelines that should in principle work
as well in any other tool or software deployment supporting XProc 3.0.</p>
<p>But to the extent this imposes a requirement for both abstract and testable conformance (or at any rate for
interoperability as a proxy for that), this project only works if things are actually simple enough to pick
up, use, learn and adapt. <code>xp3.sh</code> and <code>xp3.bat</code> represent attempts at making a simple
deployment, easy to emulate but better yet, improve.</p>
<p>Each of these scripts (on its execution platform) enables a user to run, without further configuration, the
<a href="../">Morgana XProcIIIse</a> processor on any
XProc 3.0 pipeline, assuming the appropriate platform for each (<code>bash</code> in the case of the shell
script, Windows batch command syntax for the <code>bat</code> file). Providing a similar script for XML
Calabash remains (with apologies to NDW) a <i>desideratum</i> for this project as we post this version of
the tutorial. Stay tuned!</p>
<p>In any case such a script itself must be <q>vanilla</q> and generic: it will simply invoke the processor
with the designated pipeline, and stand back. (Yes, runtime arguments and settings can be provided.) The
logic of operations is entirely encapsulated in the XProc pipeline designated. XProc 3.0 is both scalable
and flexible enough to open a wide range of possibilities for data processing, both XML-based and using
other formats such as JSON and plain text. It is the intent of this project not to explore and map this
space – which is vast – but to show off enough XProc and related logic (XSLT, XSpec) to show how this
exploration can be done. We are an outfitter at the beginning of what we hope will be many profitable
voyages to places we have never been.</p>
<section>
<h3>When running from a command line</h3>
<p>As simple examples, these scripts show only one way of running XProc. Keep in mind that even simple
scripts can be used in more than one way.</p>
<p>For example, a pipeline can be executed from the project root:</p>
<pre>$ ./xp3.sh smoketest/TEST-XPROC3.xpl</pre>
<p>Alternatively, a pipeline can be executed from its home directory, for example if currently in the
<code>smoketest</code> directory (note the path to the script):</p>
<pre>$ ../xp3.sh TEST-XPROC3.xpl</pre>
<p>This works the same ways on Windows, with adjustments:</p>
<pre>> ..\xp3 TEST-XPROC3.xpl </pre>
<p>(On Windows a <code>bat</code> file suffix marks it as executable and does not have to be given
explicitly when called.)</p>
<p>Windows users (and others to varying degrees) can set up <a href="../">a drag-and-drop based workflow</a> –
using your mouse or pointer, select an XProc pipeline file and drag it to a shortcut for the executable
(Windows batch file). A command window opens to show the operation of the pipeline. See the <a href="../tutorial/README.md">README</a> for more information.</p>
<p>It is important to try things out since any of these methods can be the basis of a workflow.</p>
<p>For the big picture, keep in mind that while the command line is useful for development and demonstration
– and however familiar XProc itself may become to the developer – to a great number of people it remains,
like XProc, obscure, cryptic and intimidating if not forbidding.</p>
<p>This is a pity because (among other reasons) the kind of layered system we will see and build here is not
endless or infinitely complex. Begin by making yourself comfortable at the command line. See how the
pieces fit together by working them.</p>
<p>Then too, if you have something better, by all means use it. XProc-based systems, when integrated into
tools or developer editors and environments, can look much nicer than tracebacks in a console window. The
elegance and power we are trying to cultivate are at a deeper level. First and last, the focus must be on
the data.</p>
</section>
</section>
</section>
<section class="unit maker"
id="acquire_102"
data-track="maker">
<h1>102: Examining the setup</h1>
<section>
<h2>Goals</h2>
<ul>
<li>Look at some pipeline organization and syntax on the inside</li>
<li>Success and failure invoking XProc pipelines: making friends with tracebacks</li>
</ul>
</section>
<section>
<h2>Prerequisites</h2>
<p>Please complete the repository setup and smoke tests as described in the <a href="../tutorial/source/acquire/acquire_101_src.html"
class="LessonUnit">101 lesson</a>. In this lesson, we will run these pipelines with adjustments, or
similar pipelines.</p>
<p>This discussion assumes basic knowledge of coding, the Internet (including retrieving resources via
<code>file</code> and <code>http</code> protocols), and web-based technologies including HTML.</p>
<p>XML knowledge is <i>not</i> assumed. This poses a special challenge since in addition to its XML-based
syntax, XProc uses the <a href="../">XML Data Model (XDM)</a> along with
<a href="../">XPath 3.1</a>, the query language for XML: together, a deep
topic. We make the assumption that if you already know XML, XPath, XSLT or XQuery, much will be familiar,
but you will be tolerant of some restatement for the sake of those who do not. (As we all start somewhere,
why not here.)</p>
<p>You will also need a programmer's plain text editor, XML/XSLT editor or IDE (integrated development
environment) for more interactive testing of the code.</p>
</section>
<section>
<h2>Resources</h2>
<p>Same as <a href="../tutorial/source/acquire/acquire_101_src.html"
class="LessonUnit">Setup 101</a>.</p>
</section>
<section>
<h2>Step One: Inspect the pipelines</h2>
<p>The two groupings of pipelines used in setup and testing can be considered separately.</p>
<p>The key to understanding both groups is to know that once the initial <a href="../setup.sh">Setup
script</a> is run, your processor or <q>engine</q> (such as Morgana) can be invoked directly, as paths
and scripts are already in place. In doing so – before extension libraries are in place – it can use only
basic XProc steps, but those are enough to start with.</p>
<p>Specifically, the pipelines can acquire resources from the Internet, save them locally, and perform
unarchiving (unzipping). Having been downloaded, each library provides software that the pipeline engine
(Morgana) can use to do more.</p>
<p>Accordingly, the first group of pipelines (in the <a href="../lib/readme.md">lib</a> directory has
a single purpose, namely (together and separately) to download software to augment Morgana's feature
set.</p>
<p>If not using the open-source Morgana distribution, you can skip to smoke tests below, and see how far you
get.</p>
<ul>
<li>
<a href="../lib/GRAB-SAXON.xpl">lib/GRAB-SAXON.xpl</a>
</li>
<li>
<a href="../lib/GRAB-SCHXSLT.xpl">lib/GRAB-SCHXSLT.xpl</a>
</li>
<li>
<a href="../lib/GRAB-XSPEC.xpl">lib/GRAB-XSPEC.xpl</a>
</li>
</ul>
<p>Pipelines in a second group work similarly in that each one exercises and tests capabilities provided by
software downloaded by a member of the first group.</p>
<ul>
<li>
<a href="../smoketest/TEST-XPROC3.xpl">smoketest/TEST-XPROC3.xpl</a> tests the execution runtime
(MorganaXProc-III or other engine)</li>
<li>
<a href="../smoketest/TEST-XSLT.xpl">smoketest/TEST-XSLT.xpl</a> tests Saxon</li>
<li>
<a href="../smoketest/TEST-SCHEMATRON.xpl">smoketest/TEST-SCHEMATRON.xpl</a> tests SchXSLT
(using <code>p:validate-with-schematron</code> step)</li>
<li>
<a href="../smoketest/TEST-XSPEC.xpl">smoketest/TEST-XSPEC.xpl</a> tests XSpec (using locally
defined steps)</li>
</ul>
<p>Take a look at these files. It may be helpful (for those getting used to it) to envision the XML syntax as a
set of nested frames with labels and connectors.</p>
<p>Try more than one way of looking at the XProc source code: in the Github repository, on your file system, in
a plain text editor, in an XML editor.</p>
</section>
<section>
<h2>Step Two: Modify the pipelines</h2>
<p>Use a text editor or software development application for this exercise.</p>
<p>If you have any concepts for improvements to the pipelines, or other resources that might be acquired this way, copy and modify one of the pipelines given to achieve those results.</p>
<p>Even if not: be sure to break the pipelines given – or copies under new names – in any of several ways. Then
run the modified pipelines, as a <i>safe way</i> to familiarize yourself with error messages:</p>
<ul>
<li>Break the XML syntax of a pipeline and try to run it</li>
<li>Leave XML syntax intact (well-formed), but break something in the XProc <ul>
<li>An element name, attribute or attribute setting</li>
<li>A namespace</li>
</ul>
</li>
<li>Try to retrieve something from a broken link</li>
</ul>
<p>Having introduced an error, reverse the damage. Make sure your pipelines are back in working order when this
exercise is complete.</p>
</section>
<section>
<h2>For consideration</h2>
<p>Developers coming to this technology need to consider who would use it, and whether it is useful mainly at
the back end, or also <q>on the shop floor</q>, directly in the hands of professionals who must work with
the data, bringing expertise in subject matter (such as, for OSCAL, systems security documentation) but not
in data processing as such.</p>
<p>Key to this question is not only whether attractive and capable user interfaces (or other mediators) can be
developed (this is a known problem) but more importantly whether the systems themselves are adaptable enough
so they can be deployed, used, refitted and maintained not just for repetitive generic tasks, but for
<i>particular</i>, <i>special</i> and <i>local</i> problems, especially those discoverable only at the
points where information is gathered and codified.</p>
<p>This larger fitting of solutions to problems is a responsibility for both SMEs (subject matter experts) and
software developers together, who must define problems to be solved before approaches to them can be
found.</p>
<p>The open questions are: who can use XProc pipelines; and how can they be made more useful? The questions
come up in an OSCAL context or any context where XML is demonstrably capable, or indeed anywhere we find the
necessity of handling data with digital tools has become inescapable.</p>
<p>In order to help answer this question, actual experience will be invaluable – part of our motive here.
Unless we can make the demonstration pipelines in this repository accessible, they cannot be reasoned about.
That accessibility requires not only open publication, but also use cases and user bases ready to take
advantage.</p>
<p>Having completed and tested the setup you are ready for work with XProc: proceed to the next lesson.</p>
</section>
</section>
<section class="unit learner"
id="acquire_599"
data-track="learner">
<h1>599: Meeting XProc</h1>
<section>
<h2>Goals</h2>
<p>Gain some more sense of context.</p>
<p>XProc is not a simple thing, with only one way in. The territory is vast, but it has also been well charted.
And here we have a pathway marked in front of us.</p>
</section>
<section>
<h2>Resources</h2>
<p>
<a href="../">A Declarative Markup Bibliography</a> is
available on line for future reference on this interesting topic.</p>
</section>
<section>
<h2>Some observations</h2>
<p>Because it is now centered on <em>pipelines</em> built out of combining capabilities of <em>steps</em>
(which may be black boxes), as much as on files and software packages, dependency management when using
XProc is different from other technologies including Java and NodeJS – how so?</p>
<p>MorganaXProc-III is implemented in Scala, and Saxon is built in Java, but otherwise distributions including
the SchXSLT and XSpec distributions consist mainly of XSLT. This is either very good (with development and
maintenance requirements in view), or not good at all.</p>
<p>If not using Morgana but another XProc engine (at time of writing, XML Calabash 3 has been published in
alpha), there will presumably be analogous arrangements: contracts between the tool and its dependencies,
software or components and capabilities bundled and unbundled.</p>
<p>So does this work well, on balance, and what are the determining variables that tell you XProc is a good fit
for data processing, whether high touch, or at scale? How much of this is due to the high-level, abstracted
nature of <a href="../">4GLs</a> including
both XSLT 3.1 and XProc 3.0? Prior experience with XML-based systems and the problem domains in which they
work well is probably a consideration. But maybe the more important blockers have to do with culture, states
of knowledge, incorrect assumptions and outdated perceptions.</p>
<p>Will it always be that a developer determined to use XSLT will find a way, whereas a developer determined
not to, will find a way to refuse it? XProc in 2024 seems slow in adoption – maybe because everyone who
would want it, already has a functional equivalent in place.</p>
<p>In any case, it might also be that such neglect creates a market opportunity. Those who use these
technologies without advertising the fact may have the most to gain. But building the commons is also a
common responsibility.</p>
<p>It's all about the tools. Find ways to support your open-source developer and the software development
operations who offer free tools and services.</p>
</section>
<section>
<h2>Declarative markup in action</h2>
<p>Considerable care is taken in developing these demonstrations to see to it that the technologies on which we
depend, notably XProc and XSLT but not limited to these, are both nominally and actually conformant to
externally specified standard technologies, i.e. XProc and XSLT respectively (as well as others), and