From cea91605ed2066e92c938a992fbebe080a853e9f Mon Sep 17 00:00:00 2001
From: Wendell Piez Acquisition pipeline in the project folder collects some OSCAL onto the local system, where it can be
- managed, easily inspected, controlled, and edited if necessary. An acquisition pipeline in the project folder
+ collects some OSCAL onto the local system, where it can be managed, easily inspected, controlled, and edited
+ if necessary. But sources and results from a conversion process do not always have to work with local resources. XProc
sees the Internet itself - whatever protocols are supported by the processor (the Two ways: separate pipeline; and single pipeline; also a 'switcher' pipeline? If your criticism of XProc so far is that it makes it look easy when it isn't, you have a point. Conversion
+ from XML to JSON isn't free, assuming it works at all. In this case, the heavy lifting is done by the XSLT
+ component - the Saxon engine invoked by the In later units we will see how using the XProc steps described, rudimentary data manipulations can be done
+ using XProc by itself, without entailing the use of either XSLT or XQuery (another capability invoked with a
+ different step). At the same time, while pipelines are based on the idea of passing data through a series of
+ processes, there are many cases where logic is sufficiently complex that it becomes essential to maintain –
+ and test – that logic externally from the XProc. At what point it becomes more efficient to encapsulate
+ logic separately (whether by XSLT, XQuery or other means), depends very much on the case. The When coping with errors, syntax errors are relatively easy. But anomalous inputs, especially invalid inputs,
diff --git a/tutorial/source/setup/setup_101_src.html b/tutorial/source/setup/setup_101_src.html
index 96d385ee..cee5c349 100644
--- a/tutorial/source/setup/setup_101_src.html
+++ b/tutorial/source/setup/setup_101_src.html
@@ -15,8 +15,8 @@ You have Java installed with a JVM (Java Virtual Machine) available on the command line, version 8.0 and 11
- (and later). You have Java installed with a JVM (Java Virtual Machine) available on the command line (a JRE or JDK),
+ version 8 (and later). You have a live Internet connection and the capability to download and save resources (binaries and code
libraries) for local use. Tip: check your Java version from the console using Please complete the repository setup and smoke tests as described in the 101 lesson. In this lesson, we will run these pipelines with adjustments, or similar pipelines. This discussion assumes basic knowledge of coding, the Internet (including retrieving resources via XML knowledge is also assumed, while at the same time we are interested to know where this gap needs to be filled. XML knowledge is also assumed, while at the same time we are interested to know where this gap needs to be
+ filled. 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. The same pipelines you ran in setup: Setup 101. This tutorial's handmadeXProc dashboard with links Take a quick look now: This tutorial's handmade XProc dashboard with links Also, the official XProc.org dashboard page Also, check out XProc index materials produced in this repository: XProc docs And the same pipelines you ran in setup: Setup 101. Keep in mind that every XProc pipeline is also, potentially and actually, a step. There are two things we
need to know about steps - how to define them, and how to use them. We begin with how to recognize and use steps, but we can't avoid how to define them - because an XProc
+ We begin with how to recognize and use steps, but we can't avoid how to define them: because an XProc
pipeline is also an XProc step, we can't use steps without ending up with a pipeline. We have only to
look at the working pipeline we make with our steps, to see how a step is made. As described in the XProc 3.0
specification, XProc step declarations can be divided into an initial set of elements for setup
and configuration, followed by what the specification calls a subpipeline, which is typically a
- sequence of steps to be executed – any steps available, which could be anything. Fortunately, the list of elements that come before the steps is short: The list of elements that come before the steps is short, which helps: Within this set of elements XProc further distinguishes between the imports for steps and
- functions, appearing first (elements The prologue is used to define ports and options for the pipeline - the points of control for its
interfaces. (Technically: runtime bindings, and parameter or option settings.) If only a single input is
- needed, a single input port (named Resources
Step one: convert some OSCAL XML into OSCAL JSON
- file
and
http
protocols are required for conformance) work as they do on the Worldwide Web. Of
@@ -48,6 +49,25 @@ Step one: convert some OSCAL XML into OSCAL JSON
Step two: return trip
What is this XSLT?
+ p:xslt
step, applying logic defined in an XSLT
+ stylesheet (aka transformation) stored elsewhere. It happens that a converter for OSCAL data is available in
+ XSLT, so rather than having to confront this considerable problem ourselves, we drop that in.p:xslt
pipeline step in particular is so important for real-world uses of XProc that it is
+ introduced early, to show such black-box application. XProc also makes a fine environment for testing XSLT
+ developed or acquired to handle specific tasks, a topic covered in more depth later. Indeed XSLT and XQuery
+ being, like XProc itself, declarative languages, it makes sense to factor them out while maintaining easy
+ access and transparency for analysis and auditing purposes.What could possibly go wrong?
Goals
Prerequisites
- java --version
.102: Examining the setup
Goals
Resources
@@ -18,7 +19,8 @@ 102: Examining the setup
Prerequisites
file
and http
protocols, and web-based technologies including HTML.102: XProc fundamentals
Resources
- Prerequisites
@@ -208,30 +209,33 @@ XProc embedded documentation
XProc step prologue and body
p:import
,
+ sequence of steps to be executed – any steps available, which could be anything. Think of the subpipeline
+ as the working parts of the pipeline, while the rest is all about how it is set up.p:import
,
p:import-functions
, p:input
, p:output
, p:option
or
p:declare-step
. Everything coming after is a step.p:import
and p:import-functions
), to be
- followed by elements configuring the step: p:input
, p:output
,
- p:option
– elements together called the Within this set of elements (all preceding, none following the subpipeline) XProc further distinguishes
+ between the imports for steps and functions, appearing first (elements p:import
and
+ p:import-functions
), to be followed by elements configuring the step:
+ p:input
, p:output
, p:option
– elements together called the prologue.source
) will be assumed.source
) can be assumed, so prologues can be empty (and
+ invisible, or not there).
Following the prologue, a step may also have local step definitions (p:declare-step
).
After imports, prologue and (optional) step declarations, the step sequence that follows is called the subpipeline. One other complication: for
- purposes of exposition, we are pretending that p:variable
(a variable declaration) is a
- step, which is not how the XProc recommendation describes it, although it appears in the subpipeline with
- and among its steps.
After imports, prologue and (optional) step declarations, the step sequence that follows comprises the subpipeline.
+One other complication: for purposes of exposition, we have pretended that p:variable
(a
+ variable declaration) and p:documentation
(for out-of-band documentation) are steps, which
+ is not how the XProc recommendation describes them, although they appears in the subpipeline with and
+ among its steps.
In summary: any XProc pipeline, viewed as a step declaration, can have the following --
p:variable
p:documentation
can appear anywhere in a pipeline, but it will
- be ignored except when appearing inside p:inline
– a detail to be covered later.p:inline
. What to do with these is a topic to be
+ covered later.
NB: the pipelines run so far have XML comments demarcating the prologue from the steps
@@ -271,7 +276,7 @@p:for-each
- - produce subpipeline results for each member of a (provided or defined) sequence of inputsp:if
@@ -279,11 +284,11 @@ p:choose
- - execute subpipeline based on a series of tests switch/case
operator)
p:group
- - group a subpipeline (step sequence) into a single stepp:viewport
@@ -295,15 +300,16 @@ p:catch
Additionally to these elements, XProc subpipelines may contain variable declarations, to be covered - RSN.
+Additionally to these elements, XProc subpipelines may contain variable declarations and documentation, + as noted below.
We recognize steps because we either recognize them by name - for standard steps in the p:
(XProc) namespace such as p:filter
and p:add-attribute
- or because we do not.
Extension steps in XProc take the form of elements in an extension namespace. Generally speaking, that
- is, any element not prefixed with p:
is subject to evaluation as an extension.
p:
is treated as out of scope for XProc and to be ignored,
+ while subject to evaluation as an extension.
In an XProc pipeline (library or step declaration) one may also see a namespace c:
. TODO -
come back to
p:output
, when
given, shows not what will or should happen with process results (outputs), but rather exactly what kinds
- of outputs are available, i.e. a pipelines defined outputs with the names and configurations including
- which results they capture.
+ of outputs are available, with the names and configurations including which results they capture. If such
+ a port is not connected to a processing result but to a static resource, the static resource is what will
+ appear there.
p:output
must somewhere among
its steps have one or more p:store
steps, since these are the only ways results are made
available externally to the pipeline runtime.p:store
has no effects on a file
+ system where it runs; a pipeline with no output ports exposes no results (for a calling process to
+ receive) - so to have neither is effectively to have no effects anywhere.
p:load
and p:store
are commonly provided with @message
attributes, which are used to produce console messages (in a tool like Morgana) when steps in a
subpipeline are executed.A schema for the XProc language, considered as core steps (compound and atomic) plus optional + community-defined steps, is referenced from the XProc Specification. This RNG schema is + very useful.
+It may often be considered gratuitous to validate XProc files against a schema, when the application (for + us, Morgana)must in any case take responsibility for conformance issues, as it sees fit. The reference + schema becomes useful if we find or suspect bugs in Morgana, but until then it need not have any direct role + in any runtime operation.
+Nevertheless the RNG schema still serves as a reference and an object for querying -- queries whose results + tell us about XProc. A pipeline for acquiring both RNG schema + and its RNC (compact syntax) variant is provided for interest and possible later use.
A schema for the XProc language, considered as core steps (compound and atomic) plus optional community-defined - steps, is referenced from the XProc - Specification. This RNG schema is very - useful.
-It may often be considered gratuitous to validate XProc files against a schema, when the application (for us, - Morgana)must in any case take responsibility for conformance issues, as it sees fit. The reference schema - becomes useful if we find or suspect bugs in Morgana, but until then it need not have any direct role in any - runtime operation.
-Nevertheless the RNG schema still serves as a reference and an object for querying -- queries whose results - tell us about XProc. A pipeline for acquiring both RNG schema and - its RNC (compact syntax) variant is provided for interest and possible later use.
Like other XDM-based technologies, XProc embeds and incorporates XPath, an expression language for XML. diff --git a/tutorial/src/tutorial-authoring.css b/tutorial/src/tutorial-authoring.css index 0e9bdf14..0f2a18bc 100644 --- a/tutorial/src/tutorial-authoring.css +++ b/tutorial/src/tutorial-authoring.css @@ -13,6 +13,17 @@ h4 { color: #00cc44 } h5 { color: #00ff55 } h6 { color: #33ff77 } +h1:before, +h2:before, +h3:before, +h4:before, +h5:before, +h6:before { + float: left; clear: both; font-family: sans-serif; outline: thin solid blue; + color: steelblue; margin-right: 0.2rem; padding: 0.3em; font-size: 40%; + vertical-align: text-top; +content: oxy_name() } + a:after { content: oxy_urlChooser(