@@ -58,7 +58,7 @@ exclude-result-prefixes="#all"
5858
5959 <!-- render view -->
6060
61- <xsl : template match =" *[@typeof = '&ldh;View'][descendant::*[@property = '&spin;query'][@resource]]" mode =" ldh:RenderRow" priority =" 2" > <!-- prioritize above block.xsl -->
61+ <xsl : template match =" *[@typeof = '&ldh;View'][descendant::*[@property = '&spin;query'][@resource]]" mode =" ldh:RenderRow" as = " function(item()?) as map(*) " priority =" 2" > <!-- prioritize above block.xsl -->
6262 <xsl : param name =" block" select =" ancestor-or-self::div[contains-token(@class, 'block')][1]" as =" element()" />
6363 <xsl : param name =" this" select =" ac:absolute-path(ldh:base-uri(.))" as =" xs:anyURI" /> <!-- document URL -->
6464 <xsl : param name =" parent-about" select =" $block/ancestor::*[@about][1]/@about" as =" xs:anyURI" /> <!-- outer @about context -->
@@ -108,30 +108,44 @@ exclude-result-prefixes="#all"
108108 " />
109109 </xsl : template >
110110
111- <xsl : function name =" ldh:view-http -thunk" as =" item()*" ixsl : updating =" yes" >
111+ <xsl : function name =" ldh:view-self -thunk" as =" item()*" ixsl : updating =" yes" >
112112 <xsl : param name =" context" as =" map(*)" />
113113
114- <xsl : message >ldh:view-http -thunk</xsl : message >
114+ <xsl : message >ldh:view-self -thunk</xsl : message >
115115
116116 <xsl : sequence select ="
117- ixsl:http-request($context('request')) =>
118- ixsl:then(ldh:rethread-response($context, ?)) =>
119- ixsl:then(ldh:handle-response#1) =>
120- ixsl:then(ldh:view-query-response#1)
117+ ixsl:resolve($context) =>
118+ ixsl:then(ldh:view-query-thunk#1) =>
119+ ixsl:then(ldh:view-results-thunk#1)
121120 " />
122121 </xsl : function >
123-
124- <xsl : function name =" ldh:view-self -thunk" as =" item()*" ixsl : updating =" yes" >
122+
123+ <xsl : function name =" ldh:view-query -thunk" as =" item()*" ixsl : updating =" yes" >
125124 <xsl : param name =" context" as =" map(*)" />
126125
127- <xsl : message >ldh:view-self -thunk</xsl : message >
126+ <xsl : message >ldh:view-query -thunk</xsl : message >
128127
129128 <xsl : sequence select ="
130- ixsl:resolve($context)
131- => ixsl:then(ldh:view-http-thunk#1) (: then kick off HTTP₁→HTTP₂ chain :)
129+ ixsl:http-request($context('request')) =>
130+ ixsl:then(ldh:rethread-response($context, ?)) =>
131+ ixsl:then(ldh:handle-response#1) =>
132+ ixsl:then(ldh:view-query-response#1)
132133 " />
133134 </xsl : function >
134135
136+ <xsl : function name =" ldh:view-results-thunk" as =" item()*" ixsl : updating =" yes" >
137+ <xsl : param name =" context" as =" map(*)" />
138+
139+ <xsl : message >ldh:view-results-thunk</xsl : message >
140+
141+ <xsl : sequence select ="
142+ ixsl:http-request($context('request')) =>
143+ ixsl:then(ldh:rethread-response($context, ?)) =>
144+ ixsl:then(ldh:handle-response#1) =>
145+ ixsl:then(ldh:view-results-response#1)
146+ " />
147+ </xsl : function >
148+
135149 <!-- hide type control -->
136150 <xsl : template match =" *[rdf:type/@rdf:resource = '&ldh;View']" mode =" bs2:TypeControl" priority =" 1" >
137151 <xsl : next-match >
@@ -479,7 +493,7 @@ exclude-result-prefixes="#all"
479493 </xsl : map >
480494 </xsl : variable >
481495 <xsl : variable name =" request" select =" map{ 'method': 'GET', 'href': $request-uri, 'headers': $headers }" as =" map(*)" />
482- <xsl : variable name = " context " as = " map(*) " select ="
496+ <xsl : sequence select ="
483497 map{
484498 'request': $request,
485499 'block': $block,
@@ -492,11 +506,11 @@ exclude-result-prefixes="#all"
492506 'focus-var-name': $focus-var-name,
493507 'endpoint': $endpoint
494508 }" />
495- <ixsl : promise select =" ixsl:http-request($context('request')) =>
509+ <!-- <ixsl:promise select="ixsl:http-request($context('request')) =>
496510 ixsl:then(ldh:rethread-response($context, ?)) =>
497511 ixsl:then(ldh:handle-response#1) =>
498512 ixsl:then(ldh:view-results-response#1)"
499- on-failure =" ldh:promise-failure#1" />
513+ on-failure="ldh:promise-failure#1"/>-->
500514 </xsl : template >
501515
502516 <!-- $container here is the inner result container, not the content container! -->
@@ -1630,11 +1644,11 @@ exclude-result-prefixes="#all"
16301644 </div >
16311645 </xsl : result-document >
16321646 </xsl : for-each >
1647+
1648+ <xsl : sequence select =" $context" />
16331649 </xsl : otherwise >
16341650 </xsl : choose >
1635- </xsl : for-each >
1636-
1637- <xsl : sequence select =" $context" />
1651+ </xsl : for-each >
16381652 </xsl : function >
16391653
16401654 <!-- when view RDF/XML results load, render them -->
0 commit comments