Skip to content

Commit 11d589d

Browse files
namedgraphclaude
andcommitted
Resolve static asset URIs against client-side $lapp:origin
Declare $lapp:origin in the client.xsl param block with a computed default — lapp:origin(ldh:request-uri()), the browser origin — emulating the server-side writer-set param (XSLTWriterBase), and switch all 140 static-asset lookups (translations.rdf, http-statusCodes.rdf, countries.rdf, signup icon) from the 0-arg lapp:origin() back to $lapp:origin. The 0-arg lapp:origin() reads the active pane's data-base, which for a proxied LDH pane is the remote origin (stamped from the Link rel=lapp:application header). Asset document() calls therefore issued cross-origin sync XHRs that the browser blocked on CORS — "Get failure https://…/translations.rdf" when browsing remote dataspaces in ContentMode. Introduced by the #303 sweep ($ac:contextUri → lapp:origin()) and extended by bd0417c. UI labels are client-local: chrome strings are constants of the client, versioned with the SEF and resolved against the shell origin. The pane-scoped 0-arg lapp:origin() remains in place for the admin-subdomain identity checks and other per-dataspace logic. SSR output is byte-identical ($lapp:origin was already the resolved base server-side), so the Saxon and SaxonJS document-pool preloads keep matching and local rendering still performs zero asset fetches. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 20c8277 commit 11d589d

20 files changed

Lines changed: 141 additions & 140 deletions

File tree

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/admin/signup.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ exclude-result-prefixes="#all">
172172
</xsl:if>
173173

174174
<xsl:variable name="selected" select="." as="xs:anyURI"/>
175-
<xsl:for-each select="document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/countries.rdf', lapp:origin()))/rdf:RDF/*[@rdf:about]">
175+
<xsl:for-each select="document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/countries.rdf', $lapp:origin))/rdf:RDF/*[@rdf:about]">
176176
<xsl:sort select="ac:label(.)" lang="{$ac:lang}"/>
177177
<xsl:apply-templates select="." mode="xhtml:Option">
178178
<xsl:with-param name="selected" select="@rdf:about = $selected"/>
@@ -327,7 +327,7 @@ exclude-result-prefixes="#all">
327327

328328
<xsl:template match="*[@rdf:about = '&foaf;mbox'][ac:absolute-path(ldh:request-uri()) = resolve-uri(encode-for-uri('sign up'), ldt:base())]" mode="ac:label" priority="1">
329329
<xsl:value-of>
330-
<xsl:apply-templates select="key('resources', 'email', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
330+
<xsl:apply-templates select="key('resources', 'email', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
331331
</xsl:value-of>
332332
</xsl:template>
333333

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ exclude-result-prefixes="#all"
362362
<!-- delete existing block -->
363363
<xsl:when test="$block/@about">
364364
<!-- show a confirmation prompt -->
365-
<xsl:if test="ixsl:call(ixsl:window(), 'confirm', [ ac:label(key('resources', 'are-you-sure', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))) ])">
365+
<xsl:if test="ixsl:call(ixsl:window(), 'confirm', [ ac:label(key('resources', 'are-you-sure', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))) ])">
366366
<ixsl:set-style name="cursor" select="'progress'" object="ixsl:page()//body"/>
367367

368368
<xsl:variable name="block-uri" select="$block/@about" as="xs:anyURI"/>

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/chart.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ exclude-result-prefixes="#all"
272272
<xsl:param name="form-actions" as="element()?">
273273
<div class="form-actions">
274274
<button class="btn btn-primary btn-save-chart" type="button">
275-
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ldh:logo">
275+
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ldh:logo">
276276
<xsl:with-param name="class" select="'btn btn-primary btn-save-chart'"/>
277277
</xsl:apply-templates>
278278

279-
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
279+
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
280280
</button>
281281
</div>
282282
</xsl:param>

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/query.xsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,22 @@ exclude-result-prefixes="#all"
225225

226226
<div class="form-actions">
227227
<button type="submit">
228-
<xsl:apply-templates select="key('resources', 'run', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ldh:logo">
228+
<xsl:apply-templates select="key('resources', 'run', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ldh:logo">
229229
<xsl:with-param name="class" select="'btn btn-primary btn-run-query'"/>
230230
</xsl:apply-templates>
231231

232232
<xsl:value-of>
233-
<xsl:apply-templates select="key('resources', 'run', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
233+
<xsl:apply-templates select="key('resources', 'run', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
234234
</xsl:value-of>
235235
</button>
236236
<button type="button" class="btn btn-primary btn-open-query">
237237
<xsl:value-of>
238-
<xsl:apply-templates select="key('resources', 'open', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
238+
<xsl:apply-templates select="key('resources', 'open', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
239239
</xsl:value-of>
240240
</button>
241241
<button type="button" class="btn btn-primary btn-save btn-save-query">
242242
<xsl:value-of>
243-
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
243+
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
244244
</xsl:value-of>
245245
</button>
246246
</div>

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/view.xsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ exclude-result-prefixes="#all"
219219
<xsl:choose>
220220
<xsl:when test="@name = $count-var-name">
221221
<strong>
222-
<xsl:apply-templates select="key('resources', 'total-results', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
222+
<xsl:apply-templates select="key('resources', 'total-results', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
223223
<xsl:text> </xsl:text>
224224
<span class="badge badge-inverse">
225225
<xsl:value-of select="srx:literal"/>
@@ -817,7 +817,7 @@ exclude-result-prefixes="#all"
817817
<option>
818818
<xsl:value-of>
819819
<xsl:text>[</xsl:text>
820-
<xsl:apply-templates select="key('resources', 'none', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
820+
<xsl:apply-templates select="key('resources', 'none', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
821821
<xsl:text>]</xsl:text>
822822
</xsl:value-of>
823823
</option>
@@ -841,14 +841,14 @@ exclude-result-prefixes="#all"
841841
<xsl:when test="not($desc)">
842842
<button type="button" class="btn btn-order-by">
843843
<xsl:value-of>
844-
<xsl:apply-templates select="key('resources', 'ascending', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
844+
<xsl:apply-templates select="key('resources', 'ascending', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
845845
</xsl:value-of>
846846
</button>
847847
</xsl:when>
848848
<xsl:otherwise>
849849
<button type="button" class="btn btn-order-by btn-order-by-desc">
850850
<xsl:value-of>
851-
<xsl:apply-templates select="key('resources', 'descending', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
851+
<xsl:apply-templates select="key('resources', 'descending', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
852852
</xsl:value-of>
853853
</button>
854854
</xsl:otherwise>
@@ -901,7 +901,7 @@ exclude-result-prefixes="#all"
901901
<xsl:for-each select="id($result-count-container-id, ixsl:page())">
902902
<xsl:result-document href="?." method="ixsl:replace-content">
903903
<strong>
904-
<xsl:apply-templates select="key('resources', 'total-results', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
904+
<xsl:apply-templates select="key('resources', 'total-results', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
905905
<xsl:text> </xsl:text>
906906
<span class="badge badge-inverse"><xsl:value-of select="$exact-count"/></span>
907907
</strong>
@@ -1190,7 +1190,7 @@ exclude-result-prefixes="#all"
11901190
</xsl:if>
11911191

11921192
<h2 class="nav-header btn">
1193-
<xsl:apply-templates select="key('resources', 'related-results', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
1193+
<xsl:apply-templates select="key('resources', 'related-results', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
11941194
</h2>
11951195

11961196
<ul id="{$properties-container-id}" class="well well-small nav nav-list">

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/constructor.xsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,20 @@ exclude-result-prefixes="#all"
148148
<p>
149149
<button type="button" class="btn btn-primary create-action add-constructor">
150150
<xsl:value-of>
151-
<xsl:apply-templates select="key('resources', 'constructor', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
151+
<xsl:apply-templates select="key('resources', 'constructor', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
152152
</xsl:value-of>
153153
</button>
154154
</p>
155155
</div>
156156
<div class="form-actions modal-footer">
157157
<button type="button" class="btn btn-primary btn-save">
158158
<xsl:value-of>
159-
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
159+
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
160160
</xsl:value-of>
161161
</button>
162162
<button type="button" class="btn btn-close">
163163
<xsl:value-of>
164-
<xsl:apply-templates select="key('resources', 'cancel', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
164+
<xsl:apply-templates select="key('resources', 'cancel', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
165165
</xsl:value-of>
166166
</button>
167167
</div>
@@ -255,7 +255,7 @@ exclude-result-prefixes="#all"
255255
<button type="button" class="btn btn-small pull-right btn-remove-property" tabindex="-1">
256256
<xsl:attribute name="title">
257257
<xsl:value-of>
258-
<xsl:apply-templates select="key('resources', 'remove-stmt', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
258+
<xsl:apply-templates select="key('resources', 'remove-stmt', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
259259
</xsl:value-of>
260260
</xsl:attribute>
261261
</button>
@@ -268,7 +268,7 @@ exclude-result-prefixes="#all"
268268
</xsl:if>
269269
</input>
270270
<xsl:value-of>
271-
<xsl:apply-templates select="key('resources', 'resource', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
271+
<xsl:apply-templates select="key('resources', 'resource', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
272272
</xsl:value-of>
273273
</label>
274274
<label class="radio">
@@ -278,7 +278,7 @@ exclude-result-prefixes="#all"
278278
</xsl:if>
279279
</input>
280280
<xsl:value-of>
281-
<xsl:apply-templates select="key('resources', 'literal', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ac:label"/>
281+
<xsl:apply-templates select="key('resources', 'literal', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ac:label"/>
282282
</xsl:value-of>
283283
</label>
284284

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/form.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ WHERE
210210
<div class="main offset2 span7">
211211
<div class="alert alert-success row-fluid">
212212
<div class="span1">
213-
<img src="{resolve-uri('static/com/atomgraph/linkeddatahub/icons/baseline_done_white_48dp.png', lapp:origin())}" alt="Signup complete"/>
213+
<img src="{resolve-uri('static/com/atomgraph/linkeddatahub/icons/baseline_done_white_48dp.png', $lapp:origin)}" alt="Signup complete"/>
214214
</div>
215215
<div class="span11">
216216
<p>Congratulations! Your WebID profile has been created. You can see its data below.</p>
@@ -1477,7 +1477,7 @@ WHERE
14771477
<!-- delete existing content -->
14781478
<xsl:when test="$about">
14791479
<!-- show a confirmation prompt -->
1480-
<xsl:if test="ixsl:call(ixsl:window(), 'confirm', [ ac:label(key('resources', 'are-you-sure', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))) ])">
1480+
<xsl:if test="ixsl:call(ixsl:window(), 'confirm', [ ac:label(key('resources', 'are-you-sure', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))) ])">
14811481
<xsl:sequence select="ixsl:call($block, 'remove', [])[current-date() lt xs:date('2000-01-01')]"/>
14821482

14831483
<xsl:variable name="where-pattern" as="element()">

0 commit comments

Comments
 (0)