<xsl:template match="doc">
<ID NewID=...>
  <xsl:apply-templates select="pr"/>
</ID>
</xsl:template>

<xsl:template match="bool[.='false']">
  <xsl:attribute name="{@name}">0</xsl:attribute>
</xsl:template>

<xsl:template match="bool[.='true']">
  <xsl:attribute name="{@name}">1</xsl:attribute>
</xsl:template>

Note, if you find XSLT hard (which, unfortunately, is common), you might
find the Velocity response writer an easier, more conventional way to do
it. You will be generating XML, but you'll be treating it much more as
just text output.

Upayavira

On Thu, Jul 23, 2015, at 01:32 PM, Sreekant Sreedharan wrote:
> That worked for most of my attributes. I have only one issue to fix. How
> would I convert boolean values to integers? For example:
> 
> <doc>
>      ...
>     <bool name="pr">false</bool>
>     ....
> </doc>
> 
> 
> to
> 
> <ID pr="0">
> </ID>
> 
> 
> Is that possible as well?
> 
> On that note, what version of XSLT should I assume SOLR supports? XSLT
> 1.0
> or 2.0?
> Also, is it fair to assume that maps just don't work on SOLR?
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/XSLT-with-maps-tp4218518p4218783.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to