Skip to content

Commit 8b8aa5d

Browse files
namedgraphclaude
andauthored
Scope modal forms to active tab pane and promise-ify their handlers (#302)
* Thread doc-uri / fragment / mode separately across navigation The client-side navigation pipeline overloaded a single $uri to mean both "doc to fetch/cache" and "resource to display." Different consumers silently stripped or kept different parts, surfacing as: blank panes on fragment-bearing link clicks, mode toggles ignored when the doc was cached, URL bar gaining a re-encoded fragment after forth-and-back navigation across the local tab. Split into explicit components, threaded through every entry point: - $doc-uri (no fragment, no query) — cache key (LinkedDataHub.contents), tab <li> data-uri, pane @about, every lookup predicate. Always via ac:absolute-path. - $fragment — the sub-anchor; lives on the outer URL per RFC 3986, extracted via ac:fragment-id($href). Round-tripped through tab @href via the 3-arity ldh:href. - $query-params — mode/forClass/etc.; callers strip the URL fragment via ac:document-uri before passing to ldh:parse-query-params, so no caller can corrupt the last value by gluing the fragment onto it. Touched: ldh:DocumentNavigate, ldh:RDFDocumentLoad, ldh:rdf-document-response, ldh:RenderTab, ldh:ActivateTab, ldh:TabSwitch, ldh:AddTabNavBarListItem; the four event handlers (main, link click, tab click, popstate), close-tab fallback, navbar-form, onDelete, onRDFFileUpload; modal/form callers in bootstrap/2.3.2/client. bs2:TabBody and bs2:DocumentBody now take @about as a mandatory param; the no-op ixsl:set-attribute workaround (operating on a detached node after ixsl:replace-element) is removed; layout.xsl passes @about server-side. TabSwitch gate requires cache hit AND non-uri query params unchanged (deep-equal vs ldh:query-params()); mode changes correctly fall through to DocumentNavigate, so the rendered DOM gets refreshed. ldh:query-params is now defined once (imports/default.xsl); the client-side override that wrapped ixsl:query-params() shadowed fragment-safe parsing and is removed. The remaining direct ixsl:query-params() callers (ac:query stylesheet param, navigation.xsl mode tunnel) go through ldh:query-params() too. Anchor-emitting server templates (xhtml:Anchor, svg:Anchor, @Rdf:resource|srx:uri) drop the encoded-full-URI fragment convention: $fragment = ac:fragment-id(.), $href via ac:document-uri. External resource links become ?uri=<doc-uri>#<frag> instead of ?uri=<doc-uri%23frag>#<encoded-full-uri>. Scroll-to-fragment in RenderTab and TabSwitch uses [@about = $resource-uri] in the active pane, replacing id($fragment, ixsl:page()). Sidesteps the DOM-id uniqueness constraint when two panes both render a resource at #this — the RDFa-emitted @about is resource-URI-scoped, naturally unique. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Scope modal forms to active tab pane and promise-ify their handlers Modals (class-instances, geo, latest, search) and the Add Data / Save As / Reconcile forms now mount inside the active pane's content-body instead of document body, with pane-scoped @id and a data-container-id hook so multiple tabs no longer collide on a single shared modal id. Selectors targeting these modals move from fixed @id to CSS classes (modal-class-instances, modal-geo, modal-latest, modal-search). Converts the access / endpoint-classes / typeahead-resource handlers from xsl:schedule-action named templates to ixsl:promise chains backed by ldh:*-response functions, matching the rest of the client. The typeahead-fetching half of ldh:ShowAddDataForm is extracted to a new ldh:LoadTypeaheads helper so callers compose the two steps explicitly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5525722 commit 8b8aa5d

9 files changed

Lines changed: 368 additions & 238 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ exclude-result-prefixes="#all"
391391
<xsl:template match="button[contains-token(@class, 'btn-edit-constructors')]" mode="ixsl:onclick">"
392392
<xsl:variable name="type" select="ixsl:get(., 'dataset.resourceType')" as="xs:anyURI"/>
393393

394-
<xsl:for-each select="ixsl:page()//body">
394+
<xsl:for-each select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]">
395395
<xsl:call-template name="ldh:LoadConstructors">
396396
<xsl:with-param name="type" select="$type"/>
397397
</xsl:call-template>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,10 @@ WHERE
762762
<xsl:variable name="href" select="?headers?location" as="xs:anyURI"/>
763763

764764
<xsl:call-template name="ldh:DocumentNavigate">
765-
<xsl:with-param name="uri" select="$href"/>
765+
<xsl:with-param name="doc-uri" select="ac:absolute-path($href)"/>
766+
<xsl:with-param name="fragment" select="ac:fragment-id($href)"/>
766767
</xsl:call-template>
767-
</xsl:for-each>
768+
</xsl:for-each>
768769
</xsl:function>
769770

770771
<xsl:function name="ldh:row-form-submit-violation" ixsl:updating="yes">

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ exclude-result-prefixes="#all"
4141
<xsl:sequence select="xs:anyURI(ixsl:location())"/>
4242
</xsl:function>
4343

44-
<xsl:function name="ldh:query-params" as="map(xs:string, xs:string*)">
45-
<xsl:sequence select="ixsl:query-params()"/>
46-
</xsl:function>
44+
<!-- ldh:query-params is defined once in imports/default.xsl and works in both contexts via ldh:request-uri -->
4745

4846
<xsl:function name="ldh:base-uri" as="xs:anyURI">
4947
<xsl:param name="arg" as="node()"/> <!-- ignored -->

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

Lines changed: 124 additions & 91 deletions
Large diffs are not rendered by default.

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

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ ORDER BY DESC(?created)
667667
<ul class="well well-small nav nav-list">
668668
<xsl:apply-templates select="$results/rdf:RDF/rdf:Description[not(@rdf:about = $doc-uri)]" mode="xhtml:ListItem">
669669
<xsl:sort select="ac:label(.)" order="ascending" lang="{$ldt:lang}"/>
670-
<xsl:with-param name="mode" select="ixsl:query-params()?mode[1]" tunnel="yes"/> <!-- TO-DO: support multiple modes -->
670+
<xsl:with-param name="mode" select="ldh:query-params()?mode[1]" tunnel="yes"/> <!-- TO-DO: support multiple modes -->
671671
<xsl:with-param name="render-id" select="false()" tunnel="yes"/>
672672
</xsl:apply-templates>
673673
</ul>
@@ -847,10 +847,13 @@ ORDER BY DESC(?created)
847847
<!-- opens modal dialog to show instances of a class -->
848848
<xsl:template match="button[contains-token(@class, 'btn-class')]" mode="ixsl:onclick">
849849
<xsl:variable name="class-uri" select="xs:anyURI(ixsl:get(., 'dataset.classUri'))"/>
850-
<xsl:variable name="container-id" select="'class-instances-container'" as="xs:string"/>
850+
<xsl:variable name="target" select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]" as="element()"/>
851+
<xsl:variable name="pane-id" select="$target/ancestor::div[contains-token(@class, 'tab-pane')]/@id" as="xs:string"/>
852+
<xsl:variable name="modal-id" select="'class-instances-modal-' || $pane-id" as="xs:string"/>
853+
<xsl:variable name="container-id" select="'class-instances-container-' || $pane-id" as="xs:string"/>
851854

852855
<xsl:variable name="modal" as="element()">
853-
<div class="modal modal-constructor fade in" id="class-instances-modal">
856+
<div class="modal modal-constructor modal-class-instances fade in" id="{$modal-id}" data-container-id="{$container-id}">
854857
<div class="modal-header">
855858
<button type="button" class="close">×</button>
856859
<legend>
@@ -895,6 +898,7 @@ ORDER BY DESC(?created)
895898

896899
<xsl:call-template name="ldh:ShowModalForm">
897900
<xsl:with-param name="form" select="$modal"/>
901+
<xsl:with-param name="target" select="$target"/>
898902
</xsl:call-template>
899903

900904
<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`'))">
@@ -975,7 +979,7 @@ ORDER BY DESC(?created)
975979
</xsl:template>
976980

977981
<!-- close modals when a link inside them is clicked -->
978-
<xsl:template match="div[@id = ('class-instances-modal', 'geo-modal', 'latest-modal', 'search-modal')]//a[@href]" mode="ixsl:onclick" priority="1">
982+
<xsl:template match="div[contains-token(@class, 'modal-class-instances') or contains-token(@class, 'modal-geo') or contains-token(@class, 'modal-latest') or contains-token(@class, 'modal-search')]//a[@href]" mode="ixsl:onclick" priority="1">
979983
<xsl:variable name="modal" select="ancestor::div[contains-token(@class, 'modal')][@id][1]" as="element()"/>
980984

981985
<!-- remove the modal -->
@@ -988,11 +992,14 @@ ORDER BY DESC(?created)
988992

989993
<!-- opens modal dialog to show geo resources -->
990994
<xsl:template match="button[contains-token(@class, 'btn-geo')]" mode="ixsl:onclick">
991-
<xsl:variable name="container-id" select="'geo-container'" as="xs:string"/>
995+
<xsl:variable name="target" select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]" as="element()"/>
996+
<xsl:variable name="pane-id" select="$target/ancestor::div[contains-token(@class, 'tab-pane')]/@id" as="xs:string"/>
997+
<xsl:variable name="modal-id" select="'geo-modal-' || $pane-id" as="xs:string"/>
998+
<xsl:variable name="container-id" select="'geo-container-' || $pane-id" as="xs:string"/>
992999
<xsl:variable name="select-string" select="$geo-resources-string" as="xs:string"/>
9931000

9941001
<xsl:variable name="modal" as="element()">
995-
<div class="modal modal-constructor fade in" id="geo-modal">
1002+
<div class="modal modal-constructor modal-geo fade in" id="{$modal-id}" data-container-id="{$container-id}">
9961003
<div class="modal-header">
9971004
<button type="button" class="close">×</button>
9981005
<legend>
@@ -1009,7 +1016,7 @@ ORDER BY DESC(?created)
10091016
</div>
10101017
</div>
10111018
</div>
1012-
1019+
10131020
<div id="{$container-id}" class="row-fluid" typeof="&ldh;View">
10141021
<div class="main span12">
10151022
<!-- View results will be rendered here -->
@@ -1030,6 +1037,7 @@ ORDER BY DESC(?created)
10301037

10311038
<xsl:call-template name="ldh:ShowModalForm">
10321039
<xsl:with-param name="form" select="$modal"/>
1040+
<xsl:with-param name="target" select="$target"/>
10331041
</xsl:call-template>
10341042

10351043
<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`'))">
@@ -1096,11 +1104,14 @@ ORDER BY DESC(?created)
10961104

10971105
<!-- opens modal dialog to show latest resources -->
10981106
<xsl:template match="button[contains-token(@class, 'btn-latest')]" mode="ixsl:onclick">
1099-
<xsl:variable name="container-id" select="'latest-container'" as="xs:string"/>
1107+
<xsl:variable name="target" select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]" as="element()"/>
1108+
<xsl:variable name="pane-id" select="$target/ancestor::div[contains-token(@class, 'tab-pane')]/@id" as="xs:string"/>
1109+
<xsl:variable name="modal-id" select="'latest-modal-' || $pane-id" as="xs:string"/>
1110+
<xsl:variable name="container-id" select="'latest-container-' || $pane-id" as="xs:string"/>
11001111
<xsl:variable name="select-string" select="$latest-resources-string" as="xs:string"/>
11011112

11021113
<xsl:variable name="modal" as="element()">
1103-
<div class="modal modal-constructor fade in" id="latest-modal">
1114+
<div class="modal modal-constructor modal-latest fade in" id="{$modal-id}" data-container-id="{$container-id}">
11041115
<div class="modal-header">
11051116
<button type="button" class="close">×</button>
11061117
<legend>
@@ -1138,6 +1149,7 @@ ORDER BY DESC(?created)
11381149

11391150
<xsl:call-template name="ldh:ShowModalForm">
11401151
<xsl:with-param name="form" select="$modal"/>
1152+
<xsl:with-param name="target" select="$target"/>
11411153
</xsl:call-template>
11421154

11431155
<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`'))">
@@ -1216,10 +1228,13 @@ ORDER BY DESC(?created)
12161228
<xsl:template match="form[contains-token(@class, 'search-form')]" mode="ixsl:onsubmit">
12171229
<xsl:sequence select="ixsl:call(ixsl:event(), 'preventDefault', [])"/>
12181230
<xsl:variable name="text" select=".//input[@name = 'q']/ixsl:get(., 'value')" as="xs:string?"/>
1219-
<xsl:variable name="container-id" select="'search-results-container'" as="xs:string"/>
1231+
<xsl:variable name="target" select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]" as="element()"/>
1232+
<xsl:variable name="pane-id" select="$target/ancestor::div[contains-token(@class, 'tab-pane')]/@id" as="xs:string"/>
1233+
<xsl:variable name="modal-id" select="'search-modal-' || $pane-id" as="xs:string"/>
1234+
<xsl:variable name="container-id" select="'search-results-container-' || $pane-id" as="xs:string"/>
12201235

12211236
<xsl:variable name="modal" as="element()">
1222-
<div class="modal modal-constructor fade in" id="search-modal">
1237+
<div class="modal modal-constructor modal-search fade in" id="{$modal-id}" data-container-id="{$container-id}">
12231238
<div class="modal-header">
12241239
<button type="button" class="close">×</button>
12251240
<legend>
@@ -1267,6 +1282,7 @@ ORDER BY DESC(?created)
12671282

12681283
<xsl:call-template name="ldh:ShowModalForm">
12691284
<xsl:with-param name="form" select="$modal"/>
1285+
<xsl:with-param name="target" select="$target"/>
12701286
</xsl:call-template>
12711287

12721288
<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`'))">
@@ -1286,7 +1302,7 @@ ORDER BY DESC(?created)
12861302
</xsl:call-template>
12871303
</xsl:if>
12881304

1289-
<xsl:for-each select="id('search-modal', ixsl:page())//input[@name = 'q']">
1305+
<xsl:for-each select="id($modal-id, ixsl:page())//input[@name = 'q']">
12901306
<xsl:sequence select="ixsl:call(., 'focus', [])[current-date() lt xs:date('2000-01-01')]"/>
12911307
</xsl:for-each>
12921308
</xsl:template>
@@ -1295,7 +1311,7 @@ ORDER BY DESC(?created)
12951311
<xsl:template match="form[contains-token(@class, 'search-form-modal')]" mode="ixsl:onsubmit">
12961312
<xsl:sequence select="ixsl:call(ixsl:event(), 'preventDefault', [])"/>
12971313
<xsl:variable name="text" select=".//input[@name = 'q']/ixsl:get(., 'value')" as="xs:string?"/>
1298-
<xsl:variable name="container-id" select="'search-results-container'" as="xs:string"/>
1314+
<xsl:variable name="container-id" select="ancestor::div[contains-token(@class, 'modal')][@data-container-id][1]/@data-container-id" as="xs:string"/>
12991315
<xsl:variable name="cache" select="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`')" as="item()"/>
13001316

13011317
<xsl:choose>
@@ -1316,11 +1332,11 @@ ORDER BY DESC(?created)
13161332
</xsl:template>
13171333

13181334
<!-- in-modal search input: debounced live search (form-submit handles Enter) -->
1319-
<xsl:template match="div[@id = 'search-modal']//input[@name = 'q']" mode="ixsl:onkeyup">
1335+
<xsl:template match="div[contains-token(@class, 'modal-search')]//input[@name = 'q']" mode="ixsl:onkeyup">
13201336
<xsl:param name="delay" select="400" as="xs:integer"/>
13211337
<xsl:variable name="key-code" select="ixsl:get(ixsl:event(), 'code')" as="xs:string"/>
13221338
<xsl:variable name="text" select="ixsl:get(., 'value')" as="xs:string?"/>
1323-
<xsl:variable name="container-id" select="'search-results-container'" as="xs:string"/>
1339+
<xsl:variable name="container-id" select="ancestor::div[contains-token(@class, 'modal')][@data-container-id][1]/@data-container-id" as="xs:string"/>
13241340
<xsl:variable name="cache" select="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`')" as="item()"/>
13251341

13261342
<xsl:choose>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ extension-element-prefixes="ixsl"
419419
<xsl:param name="base" as="xs:anyURI?"/>
420420
<xsl:param name="endpoint" as="xs:anyURI?"/>
421421
<xsl:param name="application" as="xs:anyURI?"/>
422+
<xsl:param name="about" as="xs:anyURI"/>
422423
<xsl:param name="object-metadata" as="document-node()?" tunnel="yes"/>
423424

424425
<div>
@@ -444,6 +445,7 @@ extension-element-prefixes="ixsl"
444445

445446
<xsl:apply-templates select="." mode="bs2:DocumentBody">
446447
<xsl:with-param name="mode" select="$mode"/>
448+
<xsl:with-param name="about" select="$about"/>
447449
</xsl:apply-templates>
448450
</div>
449451
</xsl:template>
@@ -454,7 +456,7 @@ extension-element-prefixes="ixsl"
454456
<xsl:param name="id" as="xs:string?"/>
455457
<xsl:param name="class" select="'document-body'" as="xs:string?"/>
456458
<xsl:param name="mode" as="xs:anyURI"/>
457-
<xsl:param name="about" select="ac:absolute-path(ldh:base-uri(.))" as="xs:anyURI"/>
459+
<xsl:param name="about" as="xs:anyURI"/>
458460
<xsl:param name="object-metadata" as="document-node()?" tunnel="yes"/>
459461

460462
<div>
@@ -464,9 +466,7 @@ extension-element-prefixes="ixsl"
464466
<xsl:if test="$class">
465467
<xsl:attribute name="class" select="$class"/>
466468
</xsl:if>
467-
<xsl:if test="$about">
468-
<xsl:attribute name="about" select="$about"/>
469-
</xsl:if>
469+
<xsl:attribute name="about" select="$about"/>
470470

471471
<xsl:apply-templates select="." mode="bs2:ActionBar">
472472
<xsl:with-param name="active-mode" select="$mode"/>

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/imports/default.xsl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ exclude-result-prefixes="#all"
161161
</xsl:function>
162162

163163
<xsl:function name="ldh:query-params" as="map(xs:string, xs:string*)">
164-
<xsl:sequence select="ldh:parse-query-params(substring-after(ldh:request-uri(), '?'))"/>
164+
<!-- ac:document-uri strips the URL's #fragment so it doesn't get glued onto the last query value -->
165+
<xsl:sequence select="ldh:parse-query-params(substring-after(ac:document-uri(ldh:request-uri()), '?'))"/>
165166
</xsl:function>
166167

167168
<xsl:function name="ldh:base-uri" as="xs:anyURI" use-when="system-property('xsl:product-name') = 'SAXON'">
@@ -329,7 +330,7 @@ exclude-result-prefixes="#all"
329330

330331
<xsl:function name="ldh:parse-query-params" as="map(xs:string, xs:string*)">
331332
<xsl:param name="query-string" as="xs:string"/>
332-
333+
333334
<xsl:sequence select="map:merge(
334335
tokenize($query-string, '&amp;')[normalize-space()]
335336
!
@@ -534,8 +535,8 @@ exclude-result-prefixes="#all"
534535
<!-- subject resource -->
535536
<xsl:template match="@rdf:about" mode="xhtml:Anchor">
536537
<!-- <xsl:param name="graph" as="xs:anyURI?" tunnel="yes"/>-->
537-
<xsl:param name="fragment" select="if (starts-with(., ldt:base())) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as="xs:string?"/>
538-
<xsl:param name="href" select="ldh:href(xs:anyURI(.), map{}, $fragment)" as="xs:anyURI"/>
538+
<xsl:param name="fragment" select="ac:fragment-id(.)" as="xs:string?"/>
539+
<xsl:param name="href" select="ldh:href(ac:document-uri(xs:anyURI(.)), map{}, $fragment)" as="xs:anyURI"/>
539540
<xsl:param name="id" as="xs:string?"/>
540541
<xsl:param name="title" select="." as="xs:string?"/>
541542
<xsl:param name="class" as="xs:string?"/>
@@ -551,8 +552,8 @@ exclude-result-prefixes="#all"
551552
</xsl:template>
552553

553554
<xsl:template match="@rdf:about | @rdf:resource" mode="svg:Anchor">
554-
<xsl:param name="fragment" select="if (starts-with(., ldt:base())) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as="xs:string?"/>
555-
<xsl:param name="href" select="ldh:href(xs:anyURI(.), map{}, $fragment)" as="xs:anyURI"/>
555+
<xsl:param name="fragment" select="ac:fragment-id(.)" as="xs:string?"/>
556+
<xsl:param name="href" select="ldh:href(ac:document-uri(xs:anyURI(.)), map{}, $fragment)" as="xs:anyURI"/>
556557
<xsl:param name="id" select="$fragment" as="xs:string?"/>
557558
<xsl:param name="label" select="if (parent::rdf:Description) then ac:svg-label(..) else ac:svg-object-label(.)" as="xs:string"/>
558559
<xsl:param name="title" select="$label" as="xs:string"/>
@@ -573,8 +574,8 @@ exclude-result-prefixes="#all"
573574

574575
<!-- proxy link URIs if they are external -->
575576
<xsl:template match="@rdf:resource | srx:uri" priority="2">
576-
<xsl:param name="fragment" select="if (starts-with(., ldt:base())) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as="xs:string?"/>
577-
<xsl:param name="href" select="ldh:href(xs:anyURI(.), map{}, $fragment)" as="xs:anyURI"/>
577+
<xsl:param name="fragment" select="ac:fragment-id(.)" as="xs:string?"/>
578+
<xsl:param name="href" select="ldh:href(ac:document-uri(xs:anyURI(.)), map{}, $fragment)" as="xs:anyURI"/>
578579
<xsl:param name="id" as="xs:string?"/>
579580
<xsl:param name="title" select="." as="xs:string?"/>
580581
<xsl:param name="class" as="xs:string?"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ exclude-result-prefixes="#all">
758758
<xsl:with-param name="mode" select="ac:mode(root())"/>
759759
<xsl:with-param name="base" select="ldt:base()"/>
760760
<xsl:with-param name="endpoint" select="sd:endpoint()"/>
761+
<xsl:with-param name="about" select="ac:absolute-path(ldh:base-uri(.))"/>
761762
<xsl:with-param name="object-metadata" select="$object-metadata" tunnel="yes"/>
762763
</xsl:apply-templates>
763764
</div>

0 commit comments

Comments
 (0)