966
966
as it is not always possible to tell whether a template will resolve
967
967
to a full URI or a URI-reference.
968
968
</t >
969
+ <t >
970
+ In English, the high-level algorithm is:
971
+ <list >
972
+ <t >Populate template variable data from the instance</t >
973
+ <t >If input is desired, accept input</t >
974
+ <t >Check that all required variables have a value</t >
975
+ <t >Encode values into strings and fill out the template</t >
976
+ </list >
977
+ </t >
969
978
<figure >
970
979
<preamble >
971
- This is the high-level algorithm. "T" comes from either "href"
972
- or "anchor" within the LDO, or from "base" in a containing schema.
980
+ This is the high-level algorithm as pseudocode . "T" comes from either
981
+ "href" or "anchor" within the LDO, or from "base" in a containing schema.
973
982
Pseudocode for each step follows.
974
983
</preamble >
975
984
<artwork >
@@ -992,6 +1001,17 @@ R = rfc6570ResolutionAlgorithm(T, templateData)
992
1001
</figure >
993
1002
994
1003
<section title =" Populating template data from the instance" >
1004
+ <t >
1005
+ This step looks at various data sources in the instance:
1006
+ <list >
1007
+ <t >Use "templatePointers" to find values where appropriate</t >
1008
+ <t >Look in the immediate instance for remaining values</t >
1009
+ <t >
1010
+ Either way, if there is a value there, put it in the
1011
+ template resolution data set
1012
+ </t >
1013
+ </list >
1014
+ </t >
995
1015
<figure >
996
1016
<artwork >
997
1017
<![CDATA[
@@ -1014,6 +1034,27 @@ for varname in T:
1014
1034
</section >
1015
1035
1016
1036
<section title =" Accepting input for template data" >
1037
+ <t >
1038
+ This step is relatively complex, as there are several cases to support.
1039
+ Some variables will forbid input and some will allow it. Some will
1040
+ have initial values that need to be presented in the input interface,
1041
+ and some will not.
1042
+ </t >
1043
+ <t >
1044
+ <list >
1045
+ <t >Figure out which variables can accept input</t >
1046
+ <t >
1047
+ Pre-populate the input data set if the template resolution data
1048
+ set has a value
1049
+ </t >
1050
+ <t >Accept input (present a web form, make a callback, etc.)</t >
1051
+ <t >Validate the input data set, (not the template resolution data set)</t >
1052
+ <t >
1053
+ Put the input in the template resolution data set, overriding
1054
+ any existing values
1055
+ </t >
1056
+ </list >
1057
+ </t >
1017
1058
<figure >
1018
1059
<preamble >
1019
1060
"InputForm" represents whatevers sort of input mechanism is appropriate.
@@ -1057,6 +1098,11 @@ return inputData:
1057
1098
</section >
1058
1099
1059
1100
<section title =" Encoding data as strings" >
1101
+ <t >
1102
+ This section is straightforward, converting literals to their names
1103
+ as strings, and converting numbers to strings in the most obvious manner,
1104
+ and percent-encoding as needed for use in the URI.
1105
+ </t >
1060
1106
<figure >
1061
1107
<artwork >
1062
1108
<![CDATA[
0 commit comments