<?xml version="1.0" encoding="UTF-8"?> 
<!--
          

        Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
        DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
-->
<!--
    This stylesheet outputs all constants definitions in form of C header file
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>
<xsl:output method="text"/>
<!-- for pretty printing the comments -->
<xsl:include href="prettyPrint.xsl"/>

<xsl:template match="/">
/**
 * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 * 
 * These are constant defines both in native and Java layers.
 * NOTE: DO NOT EDIT. THIS FILE IS GENERATED. If you want to 
 * edit it, you need to modify the corresponding XML files.
 *
 * Patent pending.
 */
#ifndef _MIDP_CONSTANT_CORE_H_
#define _MIDP_CONSTANT_CORE_H_

#include &lt;pcsl_string.h&gt;

/**
 * @file
 *
 * Constant defination file.
 * Automatic generated. Do not edit this file.
 */
<!-- for each constant_class -->
<xsl:for-each select="/configuration/constants/constant_class">
    <!-- 
        generate constants only when value of 'JavaOnly' 
        attribute isn't 'true'
    -->
    <xsl:if test="@JavaOnly!='true'">
        <xsl:apply-templates>
        </xsl:apply-templates>
    </xsl:if>
</xsl:for-each>
#endif /* _MIDP_CONSTANT_CORE_H_ */
</xsl:template>

<!-- template to generate constant definition -->
<xsl:template match="constant">
<xsl:if test="@JavaOnly!='true'">
/**
<xsl:call-template name="prettyPrint">
    <xsl:with-param name="outputString" select="normalize-space(@Comment)"/>
    <xsl:with-param name="indentString" select="' * '"/>
    <xsl:with-param name="maxWidth" select="75"/>
</xsl:call-template>
 *
 * Package: <xsl:value-of select="../@Name"/>
 */ <xsl:text>&#10;</xsl:text>
    <xsl:choose>
    <xsl:when test="@Type='String'">
	<xsl:text>extern const pcsl_string </xsl:text>
	<xsl:value-of select="@Name"/>
	<xsl:text>;</xsl:text>
    </xsl:when>
    <xsl:otherwise>
	<xsl:text>#define </xsl:text>
	<xsl:value-of select="@Name"/><xsl:text> </xsl:text>
	<xsl:choose>
	<xsl:when test="@Value='true'">
    	    <xsl:text>1</xsl:text>
    	</xsl:when>
        <xsl:when test="@Value='false'">
	    <xsl:text>0</xsl:text>
    	</xsl:when>
        <xsl:otherwise>
	    <xsl:value-of select="@Value"/>
    	</xsl:otherwise>
	</xsl:choose>
    </xsl:otherwise>
    </xsl:choose>
<xsl:text>
</xsl:text>
</xsl:if> <!-- JavaOnly -->
</xsl:template>

</xsl:stylesheet>
