Subversion Repositories SmartDukaan

Rev

Rev 323 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
84 naveen 1
<?xml version="1.0"?>
2
 
3
<xsl:stylesheet version="1.0"
4
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
 
6
<xsl:template match="/">
7
    <add>
8
        <xsl:apply-templates/>
9
    </add>
10
</xsl:template>
11
 
12
<xsl:template match="Entity">
13
    <doc>
14
        <field name="ID">
15
            <xsl:value-of select="@ID"/>
16
        </field>
17
        <field name="Category">
18
            <xsl:value-of select="Category"/>
19
        </field>
1914 rajveer 20
 
21
 
22
        <xsl:choose>
23
      		<xsl:when test="Boost &gt; 0">
24
        		<field name="Name" boost="5">
25
            		<xsl:value-of select="Title"/>
26
        		</field>
27
      		</xsl:when>
28
      		<xsl:otherwise>
29
        		<field name="Name">
30
            		<xsl:value-of select="Title"/>
31
        		</field>
32
      		</xsl:otherwise>
33
    	</xsl:choose>
34
 
35
 
84 naveen 36
        <xsl:apply-templates/>
37
    </doc>
38
</xsl:template>
39
 
40
<xsl:template match="Facet">
41
    <xsl:for-each select="Value">
42
        <field>
43
            <xsl:attribute name="name">
44
                <xsl:text>F_</xsl:text><xsl:value-of select="../@ID"/>
45
            </xsl:attribute>
46
            <xsl:value-of select="."/>
47
        </field>
48
    </xsl:for-each>
49
</xsl:template>
50
 
51
<xsl:template match="Property">
52
    <xsl:for-each select="Value">
53
        <field>
54
            <xsl:attribute name="name">
55
                <xsl:text>P_</xsl:text><xsl:value-of select="../@ID"/>
56
            </xsl:attribute>
57
            <xsl:value-of select="."/>
58
        </field>
59
    </xsl:for-each>
60
</xsl:template>
61
</xsl:stylesheet>