Skip to content

Commit

Permalink
More wip including encoding solution
Browse files Browse the repository at this point in the history
  • Loading branch information
wendellpiez committed Oct 2, 2024
1 parent 2f9849b commit 104f8ab
Show file tree
Hide file tree
Showing 39 changed files with 540 additions and 374 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
<xsl:template match="/">
<html>
<head>
<title></title>
<title>
<xsl:value-of select="*/oscal:metadata/oscal:title"/>
</title>
<xsl:call-template name="css-style"/>
<xsl:call-template name="extra-style"/>
</head>
<xsl:call-template name="css-style"/>
<xsl:apply-templates/>
</html>
</xsl:template>
Expand Down Expand Up @@ -489,4 +492,7 @@ th { background-color: gainsboro }
</style>
</xsl:template>

<!-- Hook for extension -->
<xsl:template name="extra-style"/>

</xsl:stylesheet>
19 changes: 0 additions & 19 deletions projects/oscal-import/src/www_fm22-6_summary.xsl

This file was deleted.

45 changes: 45 additions & 0 deletions projects/oscal-import/src/www_fm22-6_tables.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:oscal="http://csrc.nist.gov/ns/oscal/1.0">

<xsl:import href="www_fm22-6_simple.xsl"/>

<xsl:template match="oscal:catalog">
<body class="catalog">
<header>
<xsl:apply-templates select="oscal:metadata/oscal:title"/>
</header>
<main>
<xsl:apply-templates select="oscal:group[@class='requirement-category']"/>
</main>
</body>
</xsl:template>

<!-- overriding import -->
<xsl:template match="oscal:control[@class='requirement']/oscal:title" priority="1">
<summary class="h3">
<xsl:apply-templates/>
</summary>
</xsl:template>

<xsl:template name="extra-style">
<style type="text/css">
<xsl:text disable-output-escaping="yes" xml:space="preserve">

.requirements.group .group { display: inline-block; width: 24em; vertical-align: top;
margin-top: 1em; margin-bottom: 0em;
padding: 0.4em; border: thin solid black }

.requirements-group-title { margin-top: 0em }

details.control { background-color: whitesmoke; color: black; padding: 0.42em; border: thin outset black }

details[open] { width: max-content; padding-right: 2em; position: sticky; z-index: 2;
border: medium inset black}

</xsl:text>
</style>
</xsl:template>
</xsl:stylesheet>
4 changes: 1 addition & 3 deletions projects/xproc-doc/XPROC-STEP-INDEX-HTML.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
<p:insert match="div[@id='specification-links']"
xmlns="http://www.w3.org/1999/xhtml"
position="last-child" message="[XPROC-STEP-INDEX-HTML] Inserting reference links">
<p:with-input port="insertion" select="/descendant::ul[5]" pipe="@links-rewritten">
<!--<p:document href="https://xproc.org/specifications.html"/>-->
</p:with-input>
<p:with-input port="insertion" select="/descendant::ul[5]" pipe="@links-rewritten"/>
</p:insert>

<p:store href="out/xproc-step-list.html" message="[XPROC-STEP-INDEX-HTML] Storing xproc-step-list.html"/>
Expand Down
10 changes: 9 additions & 1 deletion projects/xproc-doc/src/declarations-html.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,23 @@
<a class="steplink speclink" target="spec" href="https://spec.xproc.org/3.0/steps/#c.{ox:step-name(.)}">
<xsl:sequence select="$linktext"/>
</a>
<xsl:call-template name="xprecref-link"/>
</xsl:template>

<xsl:template match="declare-step" mode="specification-link">
<xsl:param name="linktext">{ @type }</xsl:param>
<a class="steplink speclink" target="spec" href="https://spec.xproc.org/master/head/{@library}/#c.{ox:step-name(.)}">
<xsl:sequence select="$linktext"/>
</a>
<xsl:call-template name="xprecref-link"/>
</xsl:template>


<xsl:template name="xprecref-link">
<!--Still getting some 404s -->
<!--<a class="steplink speclink" target="spec" href="https://xprocref.org/3.0/p.{ox:step-name(.)}.html">XProcRef description</a>-->
</xsl:template>


<xsl:template match="declare-step" mode="internal-link">
<a href="#{ox:step-name(.)}" class="steplink internal{ @library[.='standard']/' standard-step' } {
if (ox:morgana-supports(.)) then 'supported' else 'unsupported' }">{ @type }</a>
Expand Down
6 changes: 4 additions & 2 deletions tutorial/PRODUCE-TUTORIAL-MARKDOWN.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@

<!-- Shocking that this works, needing some explanation -->

<!--<p:text-replace pattern="–" replacement="&amp;mdash;"/>-->
<!--<p:cast-content-type content-type="text/plain"/>-->

<p:text-replace pattern="" replacement="&amp;mdash;"/>
<p:text-replace pattern="–" replacement="&amp;mdash;"/>

<!--<p:text-replace pattern="–" replacement="&amp;mdash;"/>-->

<p:store href="{$result-md-path}" serialization="map{'method': 'text', 'encoding': 'utf-8'}"
message="[PRODUCE-TUTORIAL-MARKDOWN] Storing { $result-md-path }"/>
Expand Down
15 changes: 9 additions & 6 deletions tutorial/sequence/Lesson01/setup_101.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


> *Warning:* this Markdown file will be rewritten under continuous deployment (CD): edit the source in [/tutorial/source/setup/setup_101_src.html](../../../tutorial/source/setup/setup_101_src.html).
>
> Save this file elsewhere to create a persistent copy (for example, for purposes of annotation).
Expand All @@ -23,13 +24,13 @@ You have a live Internet connection and the capability to download and save reso

You are comfortable entering commands on the command line. For installation, you want a `bash` shell if available. On Windows, both WSL (Ubuntu) and Git Bash have been found to work. If you cannot use `bash`, the setup can be done by hand (downloading and unpacking a package from SourceForge).

After installation, subsequent work on Windows does not require `bash` unless you choose to use it – a Windows `CMD` or Powershell can serve as your environment and the processor invoked with a Windows `bat` file (as described in the documentation). Mac and Linux (and WSL) users can continue to use `bash`.
After installation, subsequent work on Windows does not require `bash` unless you choose to use it a Windows `CMD` or Powershell can serve as your environment and the processor invoked with a Windows `bat` file (as described in the documentation). Mac and Linux (and WSL) users can continue to use `bash`.

## Resources

The setup script is a `bash` script: [./setup.sh](../../../setup.sh), to be run with no arguments.

For XProc runtime -- to execute pipelines -- use either of the scripts [./xp3.sh](../../../xp3.sh) (under `bash`) or [./xp3.bat](../../../xp3.bat) (for Windows). These scripts are used for all pipelines (basically, for everything) unless otherwise noted.
For XProc runtime to execute pipelines use either of the scripts [./xp3.sh](../../../xp3.sh) (under `bash`) or [./xp3.bat](../../../xp3.bat) (for Windows). These scripts are used for all pipelines (basically, for everything) unless otherwise noted.

The following pipelines will be run. They are described in top-level [README](../../../README.md) documentation and the expected places.

Expand Down Expand Up @@ -81,13 +82,15 @@ When you can run all the smoke tests without ugly tracebacks, this lesson is com

Within this project as a whole, and within its subprojects, everything is done with XProc 3.0, meaning everything can be done using a single script, which invokes an XProc processor to read and execute a pipeline. This simplicity is at the center of the argument for XProc. The counter argument is that the world is never like that. This project is based on the premise that a lab environment can be useful even for studying things more commonly encountered in the real world.

Effectively (and much more could be said about the processing stack, dependency management and so forth) what this means is that XProc offers the user and the developer (in either or both roles) very focused and concentrated points of control or points of adjustment. Out in the field - where software is deployed and used - it may never be like that. User interfaces constrain what users can do, and even developers are rarely free to just mess around, as it might be thought of.
Effectively (and much more could be said about the processing stack, dependency management and so forth) what this means is that XProc offers 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 &ldquo;drop in&rdquo;. User interfaces, APIs, dependencies and platform quirks: all these constrain what users can do, and even developers are rarely free to just mess around, as it might be thought of.

To the extent this is the case, this project only works if things are actually simple enough to pick up and use.
To the extent this is the case, this project only works if things are actually simple enough to pick up, use, learn and adapt.

`xp3.sh` and `xp3.bat` represent attempts at this. Each of them (on its execution platform) enables a user to run, without further configuration, the [Morgana XProcIIIse](https://www.xml-project.com/morganaxproc-iiise.html) processor on any XProc 3.0 pipeline, assuming the appropriate platform for each (`bash` in the case of the shell script, Windows batch command syntax for the `bat` file). Other platforms supporting Java (and hence Morgana with its libraries) could be provided with similar scripts.

Such a script itself must be &ldquo;vanilla&rdquo; and generic: it simply invokes the processor with the designated pipeline, and stands back. 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.
Such a script itself must be &ldquo;vanilla&rdquo; and generic: it simply invokes the processor with the designated pipeline, and stands back. 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 a long and profitable voyage.

### Tweaks

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.

Expand Down Expand Up @@ -115,4 +118,4 @@ Windows users (and others to varying degrees) can set up a drag-and-drop based w

It is important to try things out since any of these methods can be the basis of a workflow.

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 the uninitiated it remains obscure and cryptic. XProc-based systems, when integrated into tools or developer editors and environments, can look much nicer than tracebacks in a console window. The beauty we are looking for here is in a different kind of elegance and power.
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 the uninitiated it remains obscure and cryptic. XProc-based systems, when integrated into tools or developer editors and environments, can look much nicer than tracebacks in a console window. The beauty we are looking for here is in a different kind of elegance and power.
15 changes: 7 additions & 8 deletions tutorial/sequence/Lesson01/setup_102.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@


> *Warning:* this Markdown file will be rewritten under continuous deployment (CD): edit the source in [/tutorial/source/setup/setup_102_src.html](../../../tutorial/source/setup/setup_102_src.html).
>
> Save this file elsewhere to create a persistent copy (for example, for purposes of annotation).
# 102: Examining the setup



## Goals

* Look at some pipeline organization and syntax on the inside
* Success and failure invoking XProc pipelines: an early chance to "learn to die" gracefully (to use the gamers' idiom).

## Resources

Same as [Setup 101](setup_101_src.html).
Same as [Setup 101](setup_101.md).

## Prerequisites

Please complete the repository setup and smoke tests as described in the [101 lesson](setup_101_src.html). In this lesson, we will run these pipelines with adjustments, or similar pipelines.
Please complete the repository setup and smoke tests as described in the [101 lesson](setup_101.md). 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 `file` and `http` protocols, and web-based technologies including HTML.
This discussion assumes basic knowledge of coding, the Internet (including retrieving resources via `file` and `http` protocols), and web-based technologies including HTML.

XML knowledge is also assumed. In particular, XProc uses [XPath 3.1](https://www.w3.org/TR/xpath-31/), the query language for XML. This latest version of XPath builds on XPath 1.0, so any XPath experience will help. In general, any XSLT or XQuery experience will be invaluable.

Expand All @@ -30,7 +29,7 @@ You will also need a programmer's plain text editor, XML/XSLT editor or IDE (int

The two groupings of pipelines used in setup and testing can be considered separately.

The key to understanding both groups is to know that once the initial [Setup script](../../../setup.sh) is run, 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 for these purposes.
The key to understanding both groups is to know that once the initial [Setup script](../../../setup.sh) is run, 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 for these purposes.

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.

Expand Down Expand Up @@ -73,6 +72,6 @@ Developers coming to this technology need to consider who would use it, and whet

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 *particular*, *special* and *local* problems discovered only at the points where information is gathered and codified.

This larger fitting of solutions to problems is a responsibility for both CMEs (content matter experts) and developers together, who must define problems to be solved before approaches to them can be found.
This larger fitting of solutions to problems is a responsibility for both SMEs (subject matter experts) and developers together, who must define problems to be solved before approaches to them can be found.

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.
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.
5 changes: 3 additions & 2 deletions tutorial/sequence/Lesson01/setup_599.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


> *Warning:* this Markdown file will be rewritten under continuous deployment (CD): edit the source in [/tutorial/source/setup/setup_599_src.html](../../../tutorial/source/setup/setup_599_src.html).
>
> Save this file elsewhere to create a persistent copy (for example, for purposes of annotation).
Expand All @@ -7,8 +8,8 @@

## Some observations

Because it is now centered on *pipelines* as much as on software packages, dependency management is different from other technologies including Java and NodeJS - how so?
Because it is now centered on *pipelines* as much as on files and software packages, dependency management is different from other technologies including Java and NodeJS - how so?

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.

How much of this is due to the high-level, abstracted nature of [4GLs](https://en.wikipedia.org/wiki/Fourth-generation_programming_language) including both XSLT 3.1 and XProc 3.0?
How much of this is due to the high-level, abstracted nature of [4GLs](https://en.wikipedia.org/wiki/Fourth-generation_programming_language) including both XSLT 3.1 and XProc 3.0?
Loading

0 comments on commit 104f8ab

Please sign in to comment.