Skip to content

Commit 5041b15

Browse files
namedgraphclaude
andcommitted
Wrap dataspace origin in a 0-arg lapp:origin() function
The previous $ac:contextUri → $lapp:origin sweep broke client.xsl compilation: $lapp:origin is a server-side writer-set parameter and has no client-side declaration, yielding XPST0008 in Saxon-JS. Passing the value through Saxon-JS stylesheetParams would also snapshot it at page-load and go stale on in-page tab navigation. Replace $lapp:origin references with a 0-arg lapp:origin() function following the existing ldh:request-uri() paired-definition pattern: - Server-side (imports/default.xsl, use-when SAXON): returns the $lapp:origin param set by XSLTWriterBase. - Client-side (client/functions.xsl): returns the origin extracted from ldt:base(), which reads the active tab pane's data-base — the per-tab dataspace source of truth that already drives ldt:base() and lapp:application(). Sweep $lapp:origin → lapp:origin() across all stylesheets touched by the prior commits, and add the missing xmlns:lapp declaration to resource.xsl. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e011ea0 commit 5041b15

19 files changed

Lines changed: 183 additions & 174 deletions

File tree

src/main/resources/com/linkeddatahub/packages/skos/layout.xsl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,29 @@ exclude-result-prefixes="#all">
3333

3434
<xsl:param name="foaf:Agent" as="document-node()?"/>
3535

36-
<xsl:template match="rdf:RDF[$lapp:origin] | srx:sparql[$lapp:origin]" mode="xhtml:Style">
36+
<xsl:template match="rdf:RDF[lapp:origin()] | srx:sparql[lapp:origin()]" mode="xhtml:Style">
3737
<xsl:param name="load-wymeditor" select="exists($foaf:Agent//@rdf:about)" as="xs:boolean"/>
3838
<xsl:param name="load-yasqe" select="true()" as="xs:boolean"/>
3939

4040
<xsl:apply-imports/>
4141

4242
<!-- inject custom Bootstrap theme that overrides the default one -->
43-
<link href="{resolve-uri('static/com/linkeddatahub/demo/skos/css/bootstrap.css', $lapp:origin)}" rel="stylesheet" type="text/css"/>
43+
<link href="{resolve-uri('static/com/linkeddatahub/demo/skos/css/bootstrap.css', lapp:origin())}" rel="stylesheet" type="text/css"/>
4444
<!-- re-apply LinkedDataHub's Bootstrap customizations -->
45-
<link href="{resolve-uri('static/com/atomgraph/linkeddatahub/css/bootstrap.css', $lapp:origin)}" rel="stylesheet" type="text/css"/>
45+
<link href="{resolve-uri('static/com/atomgraph/linkeddatahub/css/bootstrap.css', lapp:origin())}" rel="stylesheet" type="text/css"/>
4646

4747
<xsl:if test="$load-wymeditor">
48-
<link href="{resolve-uri('static/com/atomgraph/linkeddatahub/js/wymeditor/skins/default/skin.css', $lapp:origin)}" rel="stylesheet" type="text/css"/>
48+
<link href="{resolve-uri('static/com/atomgraph/linkeddatahub/js/wymeditor/skins/default/skin.css', lapp:origin())}" rel="stylesheet" type="text/css"/>
4949
</xsl:if>
5050
<xsl:if test="$load-yasqe">
51-
<link href="{resolve-uri('static/css/yasqe.css', $lapp:origin)}" rel="stylesheet" type="text/css"/>
51+
<link href="{resolve-uri('static/css/yasqe.css', lapp:origin())}" rel="stylesheet" type="text/css"/>
5252
</xsl:if>
5353
</xsl:template>
5454

55-
<xsl:template match="rdf:RDF[$lapp:origin]" mode="xhtml:Style">
55+
<xsl:template match="rdf:RDF[lapp:origin()]" mode="xhtml:Style">
5656
<xsl:next-match/>
5757

58-
<link href="{resolve-uri('static/com/linkeddatahub/demo/skos/css/bootstrap.css', $lapp:origin)}" rel="stylesheet" type="text/css"/>
58+
<link href="{resolve-uri('static/com/linkeddatahub/demo/skos/css/bootstrap.css', lapp:origin())}" rel="stylesheet" type="text/css"/>
5959
</xsl:template>
6060

6161
<xsl:template match="skos:narrower | skos:broader | skos:related | skos:member" mode="bs2:PropertyList"/>

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/acl/layout.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ WHERE
7373
<xsl:if test="$notifications/rdf:RDF/*[@rdf:about]">
7474
<li>
7575
<div class="btn-group">
76-
<button title="{ac:label(key('resources', 'notifications', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin))))}">
77-
<xsl:apply-templates select="key('resources', 'notifications', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $lapp:origin)))" mode="ldh:logo">
76+
<button title="{ac:label(key('resources', 'notifications', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin()))))}">
77+
<xsl:apply-templates select="key('resources', 'notifications', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', lapp:origin())))" mode="ldh:logo">
7878
<xsl:with-param name="class" select="'btn btn-primary dropdown-toggle'"/>
7979
</xsl:apply-templates>
8080
</button>

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
@@ -141,7 +141,7 @@ exclude-result-prefixes="#all">
141141
</xsl:if>
142142

143143
<xsl:variable name="selected" select="." as="xs:anyURI"/>
144-
<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]">
144+
<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]">
145145
<xsl:sort select="ac:label(.)" lang="{$ldt:lang}"/>
146146
<xsl:apply-templates select="." mode="xhtml:Option">
147147
<xsl:with-param name="selected" select="@rdf:about = $selected"/>
@@ -296,7 +296,7 @@ exclude-result-prefixes="#all">
296296

297297
<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">
298298
<xsl:value-of>
299-
<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"/>
299+
<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"/>
300300
</xsl:value-of>
301301
</xsl:template>
302302

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
@@ -274,11 +274,11 @@ exclude-result-prefixes="#all"
274274
<xsl:param name="form-actions" as="element()?">
275275
<div class="form-actions">
276276
<button class="btn btn-primary btn-save-chart" type="button">
277-
<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">
277+
<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">
278278
<xsl:with-param name="class" select="'btn btn-primary btn-save-chart'"/>
279279
</xsl:apply-templates>
280280

281-
<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"/>
281+
<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"/>
282282
</button>
283283
</div>
284284
</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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ exclude-result-prefixes="#all"
226226
<xsl:choose>
227227
<xsl:when test="@name = $count-var-name">
228228
<strong>
229-
<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"/>
229+
<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"/>
230230
<xsl:text> </xsl:text>
231231
<span class="badge badge-inverse">
232232
<xsl:value-of select="srx:literal"/>
@@ -798,7 +798,7 @@ exclude-result-prefixes="#all"
798798
<option>
799799
<xsl:value-of>
800800
<xsl:text>[</xsl:text>
801-
<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"/>
801+
<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"/>
802802
<xsl:text>]</xsl:text>
803803
</xsl:value-of>
804804
</option>
@@ -822,14 +822,14 @@ exclude-result-prefixes="#all"
822822
<xsl:when test="not($desc)">
823823
<button type="button" class="btn btn-order-by">
824824
<xsl:value-of>
825-
<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"/>
825+
<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"/>
826826
</xsl:value-of>
827827
</button>
828828
</xsl:when>
829829
<xsl:otherwise>
830830
<button type="button" class="btn btn-order-by btn-order-by-desc">
831831
<xsl:value-of>
832-
<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"/>
832+
<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"/>
833833
</xsl:value-of>
834834
</button>
835835
</xsl:otherwise>
@@ -1150,7 +1150,7 @@ exclude-result-prefixes="#all"
11501150
</xsl:if>
11511151

11521152
<h2 class="nav-header btn">
1153-
<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"/>
1153+
<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"/>
11541154
</h2>
11551155

11561156
<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
@@ -146,20 +146,20 @@ exclude-result-prefixes="#all"
146146
<p>
147147
<button type="button" class="btn btn-primary create-action add-constructor">
148148
<xsl:value-of>
149-
<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"/>
149+
<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"/>
150150
</xsl:value-of>
151151
</button>
152152
</p>
153153
</div>
154154
<div class="form-actions modal-footer">
155155
<button type="button" class="btn btn-primary btn-save">
156156
<xsl:value-of>
157-
<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"/>
157+
<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"/>
158158
</xsl:value-of>
159159
</button>
160160
<button type="button" class="btn btn-close">
161161
<xsl:value-of>
162-
<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"/>
162+
<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"/>
163163
</xsl:value-of>
164164
</button>
165165
</div>
@@ -227,7 +227,7 @@ exclude-result-prefixes="#all"
227227
<button type="button" class="btn btn-small pull-right btn-remove-property" tabindex="-1">
228228
<xsl:attribute name="title">
229229
<xsl:value-of>
230-
<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"/>
230+
<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"/>
231231
</xsl:value-of>
232232
</xsl:attribute>
233233
</button>
@@ -240,7 +240,7 @@ exclude-result-prefixes="#all"
240240
</xsl:if>
241241
</input>
242242
<xsl:value-of>
243-
<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"/>
243+
<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"/>
244244
</xsl:value-of>
245245
</label>
246246
<label class="radio">
@@ -250,7 +250,7 @@ exclude-result-prefixes="#all"
250250
</xsl:if>
251251
</input>
252252
<xsl:value-of>
253-
<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"/>
253+
<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"/>
254254
</xsl:value-of>
255255
</label>
256256

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
@@ -215,7 +215,7 @@ WHERE
215215
<div class="main offset2 span7">
216216
<div class="alert alert-success row-fluid">
217217
<div class="span1">
218-
<img src="{resolve-uri('static/com/atomgraph/linkeddatahub/icons/baseline_done_white_48dp.png', $lapp:origin)}" alt="Signup complete"/>
218+
<img src="{resolve-uri('static/com/atomgraph/linkeddatahub/icons/baseline_done_white_48dp.png', lapp:origin())}" alt="Signup complete"/>
219219
</div>
220220
<div class="span11">
221221
<p>Congratulations! Your WebID profile has been created. You can see its data below.</p>
@@ -1245,7 +1245,7 @@ WHERE
12451245
<!-- delete existing content -->
12461246
<xsl:when test="$about">
12471247
<!-- show a confirmation prompt -->
1248-
<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)))) ])">
1248+
<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())))) ])">
12491249
<xsl:sequence select="ixsl:call(ancestor::div[contains-token(@class, 'row-fluid')][1], 'remove', [])[current-date() lt xs:date('2000-01-01')]"/>
12501250

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

0 commit comments

Comments
 (0)