Skip to content

Commit

Permalink
Debug $block
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Sep 17, 2024
1 parent 3f09016 commit a369f15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ exclude-result-prefixes="#all"
<xsl:with-param name="this" select="$this"/>
<xsl:with-param name="block" select="$block"/>
<xsl:with-param name="block-uri" select="$block-uri"/>
<!-- <xsl:with-param name="container" select="$container"/>-->
<xsl:with-param name="mode" select="$mode"/>
<xsl:with-param name="show-edit-button" select="$show-edit-button" tunnel="yes"/>
</xsl:apply-templates>
Expand Down Expand Up @@ -620,7 +619,6 @@ exclude-result-prefixes="#all"
<xsl:variable name="doc" select="ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || ac:absolute-path(xs:anyURI(ixsl:location())) || '`'), 'results')" as="document-node()"/>
<xsl:call-template name="ldh:LoadBlock">
<xsl:with-param name="doc" select="$doc"/>
<!-- <xsl:with-param name="container" select="$container"/>-->
</xsl:call-template>
</xsl:for-each>
</xsl:when>
Expand Down Expand Up @@ -871,16 +869,14 @@ exclude-result-prefixes="#all"
<!-- load block -->

<!-- TO-DO: move to respective stylesheets -->
<xsl:template match="*[@about][@typeof = ('&ldh;View', '&ldh;Object', '&ldh;ResultSetChart', '&ldh;GraphChart')]//div[contains-token(@class, 'content')]" mode="ldh:LoadBlock" priority="2">
<xsl:template match="*[@about][@typeof = ('&ldh;View', '&ldh;Object', '&ldh;ResultSetChart', '&ldh;GraphChart')]" mode="ldh:LoadBlock" priority="2">
<xsl:param name="block" select="ancestor::div[@about][1]" as="element()"/>
<!-- <xsl:param name="container" select="." as="element()"/>-->
<xsl:param name="acl-modes" as="xs:anyURI*"/>
<xsl:param name="doc" as="document-node()"/>
<xsl:param name="refresh-content" as="xs:boolean?"/>

<xsl:for-each select="$block">
<xsl:call-template name="ldh:LoadBlock">
<!-- <xsl:with-param name="container" select="$container"/>-->
<xsl:with-param name="acl-modes" select="$acl-modes"/>
<xsl:with-param name="doc" select="$doc"/>
<xsl:with-param name="refresh-content" select="$refresh-content"/>
Expand All @@ -890,7 +886,6 @@ exclude-result-prefixes="#all"

<xsl:template name="ldh:LoadBlock">
<xsl:context-item as="element()" use="required"/> <!-- block element -->
<!-- <xsl:param name="container" as="element()"/>-->
<xsl:param name="acl-modes" as="xs:anyURI*"/>
<xsl:param name="doc" as="document-node()"/>
<xsl:param name="refresh-content" as="xs:boolean?"/>
Expand All @@ -917,7 +912,6 @@ exclude-result-prefixes="#all"
<xsl:call-template name="ldh:BlockLoaded">
<xsl:with-param name="this" select="$this"/>
<xsl:with-param name="block-uri" select="$block-uri"/>
<!-- <xsl:with-param name="container" select="$container"/>-->
<xsl:with-param name="acl-modes" select="$acl-modes"/>
<xsl:with-param name="refresh-content" select="$refresh-content"/>
</xsl:call-template>
Expand Down Expand Up @@ -982,7 +976,6 @@ exclude-result-prefixes="#all"
<xsl:call-template name="ldh:BlockLoaded">
<xsl:with-param name="this" select="$this"/>
<xsl:with-param name="block-uri" select="$block-uri"/>
<!-- <xsl:with-param name="container" select="$container"/>-->
<xsl:with-param name="acl-modes" select="$acl-modes"/>
<xsl:with-param name="refresh-content" select="$refresh-content"/>
</xsl:call-template>
Expand Down Expand Up @@ -1024,18 +1017,17 @@ exclude-result-prefixes="#all"
<xsl:template name="ldh:BlockLoaded">
<xsl:context-item as="element()" use="required"/>
<xsl:param name="this" as="xs:anyURI"/>
<!-- <xsl:param name="container" as="element()"/>-->
<xsl:param name="block" select="." as="xs:anyURI"/>
<xsl:param name="block-uri" as="xs:anyURI"/>
<xsl:param name="acl-modes" as="xs:anyURI*"/>
<xsl:param name="refresh-content" as="xs:boolean?"/>

<xsl:message>
ldh:BlockLoaded
block: <xs:value-of select="serialize(.)"/>
<!-- $container: <xs:value-of select="serialize($container)"/>-->
block: <xs:value-of select="serialize($block)"/>
$this: <xsl:value-of select="$this"/>
root(block)?: <xsl:value-of select="if (root(.) instance of document-node()) then true() else false()"/>
<!-- root($container)?: <xsl:value-of select="if (root($container) instance of document-node()) then true() else false()"/>-->
root($block)?: <xsl:value-of select="if (root($block) instance of document-node()) then true() else false()"/>
count($block/div/div[contains-token(@class, 'row-fluid')]): <xsl:value-of select="count($block/div/div[contains-token(@class, 'row-fluid')])"/>
</xsl:message>
<!-- create new cache entry using content URI as key -->
<ixsl:set-property name="{'`' || $block-uri || '`'}" select="ldh:new-object()" object="ixsl:get(ixsl:window(), 'LinkedDataHub.contents')"/>
Expand All @@ -1051,7 +1043,6 @@ exclude-result-prefixes="#all"
<xsl:with-param name="this" select="$this"/>
<xsl:with-param name="block" select="."/>
<xsl:with-param name="block-uri" select="$block-uri"/>
<!-- <xsl:with-param name="container" select="$container"/>-->
<xsl:with-param name="refresh-content" select="$refresh-content"/>
</xsl:apply-templates>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ WHERE

<!-- this has to go after <xsl:result-document href="#{$container-id}"> because otherwise new elements will be injected and the lookup will not work anymore -->
<!-- load content blocks -->
<xsl:for-each select="key('elements-by-class', 'content', ixsl:page())">
<xsl:for-each select="key('elements-by-class', 'row-fluid', ixsl:page())[@about][@typeof]">
<!-- container could be hidden server-side -->
<ixsl:set-style name="display" select="'block'"/>

Expand Down

0 comments on commit a369f15

Please sign in to comment.