Subversion Repositories SmartDukaan

Rev

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