@@ -1428,10 +1428,19 @@ GET /foo/
1428
1428
as it is not always possible to tell whether a template will resolve
1429
1429
to a full URI or a URI-reference.
1430
1430
</t >
1431
+ <t >
1432
+ In English, the high-level algorithm is:
1433
+ <list >
1434
+ <t >Populate template variable data from the instance</t >
1435
+ <t >If input is desired, accept input</t >
1436
+ <t >Check that all required variables have a value</t >
1437
+ <t >Encode values into strings and fill out the template</t >
1438
+ </list >
1439
+ </t >
1431
1440
<figure >
1432
1441
<preamble >
1433
- This is the high-level algorithm. "T" comes from either "href"
1434
- or "anchor" within the LDO, or from "base" in a containing schema.
1442
+ This is the high-level algorithm as pseudocode . "T" comes from either
1443
+ "href" or "anchor" within the LDO, or from "base" in a containing schema.
1435
1444
Pseudocode for each step follows.
1436
1445
</preamble >
1437
1446
<artwork >
@@ -1454,6 +1463,17 @@ R = rfc6570ResolutionAlgorithm(T, templateData)
1454
1463
</figure >
1455
1464
1456
1465
<section title =" Populating template data from the instance" >
1466
+ <t >
1467
+ This step looks at various data sources in the instance:
1468
+ <list >
1469
+ <t >Use "templatePointers" to find values where appropriate</t >
1470
+ <t >Look in the immediate instance for remaining values</t >
1471
+ <t >
1472
+ Either way, if there is a value there, put it in the
1473
+ template resolution data set
1474
+ </t >
1475
+ </list >
1476
+ </t >
1457
1477
<figure >
1458
1478
<artwork >
1459
1479
<![CDATA[
@@ -1476,6 +1496,27 @@ for varname in T:
1476
1496
</section >
1477
1497
1478
1498
<section title =" Accepting input for template data" >
1499
+ <t >
1500
+ This step is relatively complex, as there are several cases to support.
1501
+ Some variables will forbid input and some will allow it. Some will
1502
+ have initial values that need to be presented in the input interface,
1503
+ and some will not.
1504
+ </t >
1505
+ <t >
1506
+ <list >
1507
+ <t >Figure out which variables can accept input</t >
1508
+ <t >
1509
+ Pre-populate the input data set if the template resolution data
1510
+ set has a value
1511
+ </t >
1512
+ <t >Accept input (present a web form, make a callback, etc.)</t >
1513
+ <t >Validate the input data set, (not the template resolution data set)</t >
1514
+ <t >
1515
+ Put the input in the template resolution data set, overriding
1516
+ any existing values
1517
+ </t >
1518
+ </list >
1519
+ </t >
1479
1520
<figure >
1480
1521
<preamble >
1481
1522
"InputForm" represents whatevers sort of input mechanism is appropriate.
@@ -1519,6 +1560,11 @@ return inputData:
1519
1560
</section >
1520
1561
1521
1562
<section title =" Encoding data as strings" >
1563
+ <t >
1564
+ This section is straightforward, converting literals to their names
1565
+ as strings, and converting numbers to strings in the most obvious manner,
1566
+ and percent-encoding as needed for use in the URI.
1567
+ </t >
1522
1568
<figure >
1523
1569
<artwork >
1524
1570
<![CDATA[
0 commit comments