relpipe-data/makra/sparql-endpoint.xsl
branchv_0
changeset 310 aeda3cb4528d
equal deleted inserted replaced
309:71a627e72815 310:aeda3cb4528d
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <xsl:stylesheet version="2.0"
       
     3 				xmlns="http://www.w3.org/1999/xhtml"
       
     4 				xmlns:h="http://www.w3.org/1999/xhtml"
       
     5 				xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
       
     6 				xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
       
     7 				xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"
       
     8 				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       
     9 				xmlns:fn="http://www.w3.org/2005/xpath-functions"
       
    10 				xmlns:svg="http://www.w3.org/2000/svg"
       
    11 				xmlns:xs="http://www.w3.org/2001/XMLSchema"
       
    12 				exclude-result-prefixes="fn h s k m xs">
       
    13 	
       
    14 	<!--
       
    15 		SPARQL endpoint links
       
    16 		*********************
       
    17 		Inserts a listing of shell code to set the endpoint + link to the website.
       
    18 		Warning:
       
    19 			@url is not escaped and just pasted to the shell template; 
       
    20 		    it could not break the XHTML output or execute something, but the shell example inside <pre/> might be invalid.
       
    21 		*
       
    22 		@url URL of the SPARQL endpoint e.g. https://example.com/sparql
       
    23 		@website-url URL of the documentation or the organization publishing the data e.g. https://example.com/
       
    24 		@website-title human readable name for @website-url
       
    25 	-->
       
    26 	<xsl:template match="m:sparql-endpoint">
       
    27 		
       
    28 		<xsl:variable name="source">
       
    29 			<m:pre jazyk="shell">
       
    30 				<xsl:text>export RELPIPE_IN_SPARQL_ENDPOINT="</xsl:text>
       
    31 				<xsl:value-of select="@url"/>
       
    32 				<xsl:text>"</xsl:text>
       
    33 				<xsl:text>&#10;</xsl:text>
       
    34 				<xsl:text># or relpipe-in-sparql --endpoint "</xsl:text>
       
    35 				<xsl:value-of select="@url"/>
       
    36 				<xsl:text>"</xsl:text>
       
    37 			</m:pre>
       
    38 			<p>
       
    39 				Website:
       
    40 				<a href="{@website-url}">					
       
    41 					<xsl:value-of select="@website-title"/>
       
    42 				</a>
       
    43 			</p>
       
    44 		</xsl:variable>
       
    45 		
       
    46 		<xsl:apply-templates select="$source/*"/>
       
    47 		
       
    48 	</xsl:template>
       
    49 
       
    50 </xsl:stylesheet>
       
    51