Skip to content

Commit

Permalink
Fixed $block-values expression?
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Nov 26, 2024
1 parent 99631b6 commit a4894cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -779,16 +779,6 @@ LIMIT 100

<!-- BODY -->

<!-- <xsl:template match="rdf:RDF[key('resources', ac:absolute-path(ldh:base-uri(.)))][$ac:mode = '&ldht;ObjectMode']" mode="xhtml:Body" priority="2">
<body class="embed">
<div>
<xsl:apply-templates select="." mode="bs2:Object">
<xsl:with-param name="show-controls" select="false()" tunnel="yes"/>
</xsl:apply-templates>
</div>
</body>
</xsl:template>-->

<xsl:template match="rdf:RDF | srx:sparql" mode="xhtml:Body">
<body>
<div id="visible-body">
Expand All @@ -811,8 +801,8 @@ LIMIT 100
<xsl:param name="classes" select="for $class-uri in $default-classes return key('resources', $class-uri, document(ac:document-uri($class-uri)))" as="element()*"/>
<xsl:param name="doc-types" select="key('resources', ac:absolute-path(ldh:base-uri(.)))/rdf:type/@rdf:resource[ . = ('&def;Root', '&dh;Container', '&dh;Item')]" as="xs:anyURI*"/>
<!-- take care not to load unnecessary documents over HTTP when the response is an error response -->
<xsl:param name="content-values" select="if exists($doc-types) then (if doc-available(resolve-uri('ns?query=ASK%20%7B%7D', $ldt:base))) then (ldh:query-result(map{}, resolve-uri('ns', $ldt:base), $template-query || ' VALUES $Type { ' || string-join(for $type in $doc-types return '&lt;' || $type || '&gt;', ' ') || ' }')//srx:binding[@name = 'content']/srx:uri/xs:anyURI(.)) else ()) else ()" as="xs:anyURI*"/>
<xsl:param name="has-content" select="key('resources', key('resources', ac:absolute-path(ldh:base-uri(.)))/rdf:*[starts-with(local-name(), '_')]/@rdf:resource) or exists($content-values)" as="xs:boolean"/>
<xsl:param name="block-values" select="if (exists($doc-types)) then (if (doc-available(resolve-uri('ns?query=ASK%20%7B%7D', $ldt:base))) then (ldh:query-result(map{}, resolve-uri('ns', $ldt:base), $template-query || ' VALUES $Type { ' || string-join(for $type in $doc-types return '&lt;' || $type || '&gt;', ' ') || ' }')//srx:binding[@name = 'content']/srx:uri/xs:anyURI(.)) else ()) else ()" as="xs:anyURI*"/>
<xsl:param name="has-content" select="key('resources', key('resources', ac:absolute-path(ldh:base-uri(.)))/rdf:*[starts-with(local-name(), '_')]/@rdf:resource) or exists($block-values)" as="xs:boolean"/>

<div>
<xsl:if test="$id">
Expand Down Expand Up @@ -846,7 +836,7 @@ LIMIT 100
<xsl:when test="(empty($ac:mode) and $has-content) or $ac:mode = '&ldh;ContentMode'">
<xsl:apply-templates select="." mode="ldh:ContentList"/>

<xsl:for-each select="$content-values">
<xsl:for-each select="$block-values">
<xsl:if test="doc-available(ac:document-uri(.))">
<xsl:apply-templates select="key('resources', ., document(ac:document-uri(.)))" mode="bs2:Row"/>
</xsl:if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,10 @@ extension-element-prefixes="ixsl"
<xsl:param name="typeof" select="rdf:type/@rdf:resource/xs:anyURI(.)" as="xs:anyURI*"/>
<xsl:param name="mode" as="xs:anyURI?"/>
<xsl:param name="style" as="xs:string?"/>
<xsl:variable name="content-values" select="if (exists($typeof) and doc-available(resolve-uri('ns?query=ASK%20%7B%7D', $ldt:base))) then (ldh:query-result(map{}, resolve-uri('ns', $ldt:base), $template-query || ' VALUES $Type { ' || string-join(for $type in $typeof return '&lt;' || $type || '&gt;', ' ') || ' }')//srx:binding[@name = 'content']/srx:uri/xs:anyURI(.)) else ()" as="xs:anyURI*" use-when="system-property('xsl:product-name') = 'SAXON'"/>
<xsl:variable name="block-values" select="if (exists($typeof)) then (if (doc-available(resolve-uri('ns?query=ASK%20%7B%7D', $ldt:base))) then (ldh:query-result(map{}, resolve-uri('ns', $ldt:base), $template-query || ' VALUES $Type { ' || string-join(for $type in $typeof return '&lt;' || $type || '&gt;', ' ') || ' }')//srx:binding[@name = 'block']/srx:uri/xs:anyURI(.)) else ()) else ()" as="xs:anyURI*" use-when="system-property('xsl:product-name') = 'SAXON'"/>

<xsl:choose>
<xsl:when test="exists($content-values)">
<xsl:when test="exists($block-values)">
<div class="row-fluid">
<div class="span12">
<xsl:next-match>
Expand All @@ -630,7 +630,7 @@ extension-element-prefixes="ixsl"
</xsl:next-match>

<!-- render contents attached to the types of this resource using ldh:template -->
<xsl:for-each select="$content-values" use-when="system-property('xsl:product-name') = 'SAXON'">
<xsl:for-each select="$block-values" use-when="system-property('xsl:product-name') = 'SAXON'">
<xsl:if test="doc-available(ac:document-uri(.))">
<xsl:apply-templates select="key('resources', ., document(ac:document-uri(.)))" mode="bs2:Row">
<xsl:with-param name="about" select="()"/> <!-- unset the @about -->
Expand Down

0 comments on commit a4894cd

Please sign in to comment.