Subversion Repositories SmartDukaan

Rev

Rev 4056 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
<xsl:template match="/">
        <field name="ID" type="long" indexed="true" stored="true" multiValued="false" required="true"/>
        <field name="Name" type="string" indexed="true" stored="false" multiValued="false" required="true"/>
        <field name="Category" type="string" indexed="true" stored="false" multiValued="true" required="true"/>
        <field name="F_50039" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
        <xsl:apply-templates/>
</xsl:template>

<xsl:template match="Facet">
    <xsl:comment>
        <xsl:value-of select="Label"/>
    </xsl:comment>
    <xsl:text>

    </xsl:text>
    <field>
        <xsl:attribute name="name">
            <xsl:text>F_</xsl:text><xsl:value-of select="FacetDefinitionID"/>
        </xsl:attribute>

        <xsl:attribute name="type">
            <xsl:variable name="dt">
                <xsl:value-of select="Datatype"/>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="($dt = 'integer')">
                    <xsl:text>int</xsl:text>
                </xsl:when>
                <xsl:when test="($dt = 'decimal')">
                    <xsl:text>float</xsl:text>
                </xsl:when>
                <xsl:when test="($dt = 'string')">
                    <xsl:text>string</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>string</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>

        <xsl:attribute name="indexed"><xsl:text>true</xsl:text></xsl:attribute>

        <xsl:attribute name="stored"><xsl:text>false</xsl:text></xsl:attribute>

        <xsl:attribute name="multiValued">
            <xsl:value-of select="IsMultivalue"/>
        </xsl:attribute>

        <xsl:attribute name="required"><xsl:text>false</xsl:text></xsl:attribute>
    </field>
</xsl:template>

<xsl:template match="Property">
    <xsl:comment>
        <xsl:value-of select="@label"/>
    </xsl:comment>
    <xsl:text>

    </xsl:text>
    <field>
        <xsl:attribute name="name">
            <xsl:text>P_</xsl:text><xsl:value-of select="@ID"/>
        </xsl:attribute>

        <xsl:attribute name="type">
            <xsl:variable name="dt">
                <xsl:value-of select="@datatype"/>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="($dt = 'integer')">
                    <xsl:text>int</xsl:text>
                </xsl:when>
                <xsl:when test="($dt = 'decimal')">
                    <xsl:text>float</xsl:text>
                </xsl:when>
                <xsl:when test="($dt = 'string')">
                    <xsl:text>text</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>text</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>

        <xsl:attribute name="indexed"><xsl:text>true</xsl:text></xsl:attribute>

        <xsl:attribute name="stored"><xsl:text>false</xsl:text></xsl:attribute>

        <xsl:attribute name="multiValued">
            <xsl:value-of select="@isMultivalue"/>
        </xsl:attribute>

        <xsl:attribute name="required"><xsl:text>false</xsl:text></xsl:attribute>
    </field>
</xsl:template>
</xsl:stylesheet>