lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@odoko.co.uk>
Subject Re: XSLT with maps
Date Wed, 22 Jul 2015 17:43:54 GMT
That's really simple, as I said earlier, it could just require:

<xsl:template match="doc">
  <ID NewID="{@id}" ... />
</xsl:template>

Upayavira

On Wed, Jul 22, 2015, at 11:59 AM, Sreekant Sreedharan wrote:
> Well I guess I oversimplified things. My goal is to transform a SOLR
> response
> that looks like:
> 
> <response>
>  ...
> <result name="response" numFound="202" start="0">
> <doc>
>    <str name="id">589587B2B1CA4C4683FC106967E7C326</str>
>     ....
> </doc>
> </result>
> </response>
> 
> into something that looks like
> 
> <IMAGES>
>    <ID NewID="589587B2B1CA4C4683FC106967E7C326"  .... />
> </IMAGES>
> 
> Where the SOLR field 'id' is mapped to an attribute 'NewID' in the
> expected
> result. Is there a simpler way to do this? I could only come up with
> something like:
> 
> ...
>   <xsl:template match="doc">
>     <ID>
>       <xsl:for-each select="*">
>         <xsl:attribute name="{"$vMap[@from = @name]/@to)}">
>           <xsl:value-of select="."/>
>         </xsl:attribute>
>       </xsl:for-each>
>     </ID>
>   </xsl:template>
> 
> 
> Which I think requires a map.
> 
> 
> Regards,
> Sreekant
> 
> 
> 
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/XSLT-with-maps-tp4218518p4218530.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message