diff --git a/www/documentation/generated.html b/www/documentation/generated.html index 3789ca3..2086208 100644 --- a/www/documentation/generated.html +++ b/www/documentation/generated.html @@ -84,7 +84,7 @@

Definitions

-

The description element

Content model:
import*
scenario*
pending*
Content attributes:
pending?
script
version?
Zero or more attributes from any namespace.
+

The description element

Content model:
script?
import*
scenario*
pending*
Content attributes:
pending?
script?
version?
Zero or more attributes from any namespace.

The description element is the root element of an xprocspec test and describes the functionality of a specific XProc script.

Assertions or scenarios with the pending attribute will remain untested, but will be @@ -95,6 +95,18 @@

The description element

Content mod

The version attribute can be used to aid development over time.

+
+

The script element

Content model:
declare-step?
pipeline?
library?
Content attributes:
None.
+

The script element can be used insted of the script attribute. + It allows you to inline the XProc script to test. + The base URI of the script is the same as the containing xprocspec document, + unless otherwise specified using xml:base. One of the p:declare-step, + p:pipeline or p:library elements must be used.

+ +
+ + +

The import element

Content model:
Empty.
Content attributes:
href
Zero or more attributes from any namespace.

diff --git a/www/documentation/index.html b/www/documentation/index.html index ba81009..b805d54 100644 --- a/www/documentation/index.html +++ b/www/documentation/index.html @@ -187,7 +187,7 @@

xprocspec

A tool for testing XProc scripts

-

Unofficial Draft

+

Unofficial Draft

@@ -233,12 +233,12 @@

Table of Contents

+

Table of Contents

1. Definitions

-

1.1 The description element

Content model:
import*
scenario*
pending*
Content attributes:
pending?
script
version?
Zero or more attributes from any namespace.
+

1.1 The description element

Content model:
script?
import*
scenario*
pending*
Content attributes:
pending?
script?
version?
Zero or more attributes from any namespace.

The description element is the root element of an xprocspec test and describes the functionality of a specific XProc script.

Assertions or scenarios with the pending attribute will remain untested, but will be @@ -249,8 +249,20 @@

The version attribute can be used to aid development over time.

+
+

1.2 The script element

Content model:
declare-step?
pipeline?
library?
Content attributes:
None.
+

The script element can be used insted of the script attribute. + It allows you to inline the XProc script to test. + The base URI of the script is the same as the containing xprocspec document, + unless otherwise specified using xml:base. One of the p:declare-step, + p:pipeline or p:library elements must be used.

+ +
+ + +
-

1.2 The import element

Content model:
Empty.
Content attributes:
href
Zero or more attributes from any namespace.
+

1.3 The import element

Content model:
Empty.
Content attributes:
href
Zero or more attributes from any namespace.

An import runs the xprocspec description in the referenced file. It has no effect on the scenarios in the current document, but can be a useful method @@ -263,7 +275,7 @@

-

1.3 The scenario element

Content model:
call?
scenario*
pending*
context*
expect*
Content attributes:
focus?
label
Zero or more attributes from any namespace.
+

1.4 The scenario element

Content model:
call?
scenario*
pending*
context*
expect*
Content attributes:
focus?
label
Zero or more attributes from any namespace.

A scenario groups together the definition of the script environment (the call element) and the script assertions (the context and @@ -282,7 +294,7 @@

-

1.4 The call element

Content model:
input*
option*
param*
Content attributes:
step?
Zero or more attributes from any namespace.
+

1.5 The call element

Content model:
input*
option*
param*
Content attributes:
step?
Zero or more attributes from any namespace.

A call element defines a step call and the inputs, options and parameters passed to it. @@ -298,7 +310,7 @@

1
-

1.5 The pending element

Content model:
scenario*
pending*
Content attributes:
label?
Zero or more attributes from any namespace.
+

1.6 The pending element

Content model:
scenario*
pending*
Content attributes:
label?
Zero or more attributes from any namespace.

TODO: the element pending has not been documented yet.

The label attribute is used to describe the current element in human-readable words.

@@ -307,7 +319,7 @@

-

1.6 The context element

Content model:
document*
Content attributes:
label?
pending?
Zero or more attributes from any namespace.
+

1.7 The context element

Content model:
document*
Content attributes:
label?
pending?
Zero or more attributes from any namespace.

Defines the context against which assertions are made.

The label attribute is used to describe the current element in human-readable words.

@@ -318,7 +330,7 @@

-

1.7 The expect element

Content model:
document*
Content attributes:
equals?
focus?
grammar?
href?
label?
max?
min?
normalize-space?
pending?
step?
test?
type?
Zero or more attributes from any namespace.
+

1.8 The expect element

Content model:
document*
Content attributes:
equals?
focus?
grammar?
href?
label?
max?
min?
normalize-space?
pending?
step?
test?
type?
Zero or more attributes from any namespace.

Defines what is expected from the context document(s).

@@ -396,14 +408,14 @@

-

1.8 The input element

Content model:
document*
Content attributes:
port?
Zero or more attributes from any namespace.
+

1.9 The input element

Content model:
document*
Content attributes:
port?
Zero or more attributes from any namespace.

The input element is used to provide documents on the input ports of the XProc step you are testing.

-

1.9 The option element

Content model:
Empty.
Content attributes:
name?
select?
Zero or more attributes from any namespace.
+

1.10 The option element

Content model:
Empty.
Content attributes:
name?
select?
Zero or more attributes from any namespace.

The option element is used to provide values to XProc options on the XProc step you are testing.

The name attribute is the name of the option used in the XProc step.

@@ -416,7 +428,7 @@

-

1.10 The param element

Content model:
Empty.
Content attributes:
name?
select?
Zero or more attributes from any namespace.
+

1.11 The param element

Content model:
Empty.
Content attributes:
name?
select?
Zero or more attributes from any namespace.

The param element is used to provide values to XProc paramaters on the XProc step you are testing.

The name attribute is the name of the parameter to be provided on the XProc steps primary parameter input @@ -439,7 +451,7 @@

-

1.11 The document element

Content model:
One element from any namespace. (optional)
Content attributes:
base-uri?
href?
method?
port?
position?
recursive?
select?
type?
Zero or more attributes from any namespace.
+

1.12 The document element

Content model:
One element from any namespace. (optional)
Content attributes:
base-uri?
href?
method?
port?
position?
recursive?
select?
type?
Zero or more attributes from any namespace.

The document element is used to define which documents are provided on a steps input ports, what the context is when making assertions, and for assertions when making comparisons or performing validations. It can be used in a number of ways:

diff --git a/xprocspec/pom.xml b/xprocspec/pom.xml index ba3fe2d..d0190ef 100644 --- a/xprocspec/pom.xml +++ b/xprocspec/pom.xml @@ -4,7 +4,7 @@ org.daisy xprocspec - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT jar xprocspec diff --git a/xprocspec/src/it/it-xprocspec/src/test/xprocspec/tests/script-1.xprocspec b/xprocspec/src/it/it-xprocspec/src/test/xprocspec/tests/script-1.xprocspec new file mode 100644 index 0000000..a97ce96 --- /dev/null +++ b/xprocspec/src/it/it-xprocspec/src/test/xprocspec/tests/script-1.xprocspec @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xprocspec/src/main/resources/content/xml/schema/xprocspec.preprocess.rng b/xprocspec/src/main/resources/content/xml/schema/xprocspec.preprocess.rng index 90ff2cb..5d929eb 100644 --- a/xprocspec/src/main/resources/content/xml/schema/xprocspec.preprocess.rng +++ b/xprocspec/src/main/resources/content/xml/schema/xprocspec.preprocess.rng @@ -30,6 +30,23 @@ + + + + The `script` attribute is a URI that points to the XProc script you want to test. + + + + + The `version` attribute can be used to aid development over time. + + + + + + + + diff --git a/xprocspec/src/main/resources/content/xml/schema/xprocspec.rng b/xprocspec/src/main/resources/content/xml/schema/xprocspec.rng index 3134f96..4dc6f2e 100644 --- a/xprocspec/src/main/resources/content/xml/schema/xprocspec.rng +++ b/xprocspec/src/main/resources/content/xml/schema/xprocspec.rng @@ -38,10 +38,13 @@ - - The `script` attribute is a URI that points to the XProc script you want to test. - - + + + + The `script` attribute is a URI that points to the XProc script you want to test. + + + The `version` attribute can be used to aid development over time. @@ -53,6 +56,35 @@ + + + +

The script element can be used insted of the script attribute. + It allows you to inline the XProc script to test. + The base URI of the script is the same as the containing xprocspec document, + unless otherwise specified using `xml:base`. One of the p:declare-step, + p:pipeline or p:library elements must be used.

+
+ + + XProc step declaration + + + + + XProc pipeline declaration + + + + + XProc library declaration + + + + +
+
+ diff --git a/xprocspec/src/main/resources/content/xml/xproc/preprocess/preprocess.xpl b/xprocspec/src/main/resources/content/xml/xproc/preprocess/preprocess.xpl index d725605..4d91f05 100644 --- a/xprocspec/src/main/resources/content/xml/xproc/preprocess/preprocess.xpl +++ b/xprocspec/src/main/resources/content/xml/xproc/preprocess/preprocess.xpl @@ -500,6 +500,7 @@ + @@ -529,6 +530,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +