Subversion Repositories SmartDukaan

Rev

Rev 4056 | 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
        <field name="ID" type="long" indexed="true" stored="true" multiValued="false" required="true"/>
8
        <field name="Name" type="string" indexed="true" stored="false" multiValued="false" required="true"/>
9
        <field name="Category" type="string" indexed="true" stored="false" multiValued="true" required="true"/>
12130 amit.gupta 10
        <field name="F_50039" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
84 naveen 11
        <xsl:apply-templates/>
12
</xsl:template>
13
 
14
<xsl:template match="Facet">
15
    <xsl:comment>
16
        <xsl:value-of select="Label"/>
17
    </xsl:comment>
18
    <xsl:text>
19
 
20
    </xsl:text>
21
    <field>
22
        <xsl:attribute name="name">
23
            <xsl:text>F_</xsl:text><xsl:value-of select="FacetDefinitionID"/>
24
        </xsl:attribute>
25
 
26
        <xsl:attribute name="type">
27
            <xsl:variable name="dt">
28
                <xsl:value-of select="Datatype"/>
29
            </xsl:variable>
30
            <xsl:choose>
31
                <xsl:when test="($dt = 'integer')">
32
                    <xsl:text>int</xsl:text>
33
                </xsl:when>
34
                <xsl:when test="($dt = 'decimal')">
35
                    <xsl:text>float</xsl:text>
36
                </xsl:when>
37
                <xsl:when test="($dt = 'string')">
38
                    <xsl:text>string</xsl:text>
39
                </xsl:when>
40
                <xsl:otherwise>
41
                    <xsl:text>string</xsl:text>
42
                </xsl:otherwise>
43
            </xsl:choose>
44
        </xsl:attribute>
45
 
46
        <xsl:attribute name="indexed"><xsl:text>true</xsl:text></xsl:attribute>
47
 
48
        <xsl:attribute name="stored"><xsl:text>false</xsl:text></xsl:attribute>
49
 
50
        <xsl:attribute name="multiValued">
51
            <xsl:value-of select="IsMultivalue"/>
52
        </xsl:attribute>
53
 
54
        <xsl:attribute name="required"><xsl:text>false</xsl:text></xsl:attribute>
55
    </field>
56
</xsl:template>
57
 
58
<xsl:template match="Property">
59
    <xsl:comment>
60
        <xsl:value-of select="@label"/>
61
    </xsl:comment>
62
    <xsl:text>
63
 
64
    </xsl:text>
65
    <field>
66
        <xsl:attribute name="name">
67
            <xsl:text>P_</xsl:text><xsl:value-of select="@ID"/>
68
        </xsl:attribute>
69
 
70
        <xsl:attribute name="type">
71
            <xsl:variable name="dt">
72
                <xsl:value-of select="@datatype"/>
73
            </xsl:variable>
74
            <xsl:choose>
75
                <xsl:when test="($dt = 'integer')">
76
                    <xsl:text>int</xsl:text>
77
                </xsl:when>
78
                <xsl:when test="($dt = 'decimal')">
79
                    <xsl:text>float</xsl:text>
80
                </xsl:when>
81
                <xsl:when test="($dt = 'string')">
82
                    <xsl:text>text</xsl:text>
83
                </xsl:when>
84
                <xsl:otherwise>
85
                    <xsl:text>text</xsl:text>
86
                </xsl:otherwise>
87
            </xsl:choose>
88
        </xsl:attribute>
89
 
90
        <xsl:attribute name="indexed"><xsl:text>true</xsl:text></xsl:attribute>
91
 
92
        <xsl:attribute name="stored"><xsl:text>false</xsl:text></xsl:attribute>
93
 
94
        <xsl:attribute name="multiValued">
95
            <xsl:value-of select="@isMultivalue"/>
96
        </xsl:attribute>
97
 
98
        <xsl:attribute name="required"><xsl:text>false</xsl:text></xsl:attribute>
99
    </field>
100
</xsl:template>
101
</xsl:stylesheet>