mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-03-11 13:21:11 -04:00
try i.e. http://localhost:8090/solr/select?q=*:*&start=0&rows=10&wt=xslt&tr=json.xsl - added servlet-side mime-type configuration for streamed servlets. this is used for the result formatters in solr result formats
26 lines
909 B
XML
26 lines
909 B
XML
<?xml version='1.0' encoding='UTF-8'?>
|
|
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
|
|
<xsl:output media-type="application/json" encoding="UTF-8" method="text"/>
|
|
|
|
<xsl:template match='/'>
|
|
<xsl:text>[</xsl:text>
|
|
<xsl:for-each select="response/result/doc">
|
|
<xsl:if test="position()>1"><xsl:text>,</xsl:text></xsl:if>
|
|
<xsl:apply-templates select="."/>
|
|
</xsl:for-each>
|
|
<xsl:text>]</xsl:text>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="doc">
|
|
<xsl:text>{"id":"</xsl:text><xsl:apply-templates select="str[@name='id']"/>
|
|
<xsl:text>","url":"</xsl:text><xsl:apply-templates select="str[@name='sku']"/>
|
|
<xsl:text>","title":"</xsl:text><xsl:apply-templates select="str[@name='title']"/>
|
|
<xsl:text>"}</xsl:text>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="str">
|
|
<xsl:value-of select="translate(.,'"','"')"/>
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet>
|