Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Fixed a namespace issue with complex types #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Framework/src/odatagen/objc_headers.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
</xsl:for-each>
- (id) init;
- (id) initWithUri:(NSString*)anUri credential:(id)acredential;
<xsl:for-each select="schema_1_0:FunctionImport | schema_1_1:FunctionImport | schema_1_2:FunctionImport">- (<xsl:choose><xsl:when test="contains(@ReturnType, 'Collection')">NSArray *</xsl:when><xsl:when test="contains(@ReturnType, 'Edm.')">NSString *</xsl:when><xsl:when test="contains(@ReturnType, @ComplexType)"><xsl:choose><xsl:when test="contains(@ReturnType,$service_namespace)"><xsl:value-of select="substring-after(@ReturnType, concat($service_namespace, '.'))"/> *</xsl:when><xsl:otherwise><xsl:value-of select="@ReturnType"/> *</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="contains(@ReturnType, @EntityType)"><xsl:choose><xsl:when test="contains(@ReturnType,$service_namespace)"><xsl:value-of select="substring-after(@ReturnType, concat($service_namespace, '.'))"/> *</xsl:when><xsl:otherwise><xsl:value-of select="@ReturnType"/> *</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>NSString *</xsl:otherwise></xsl:choose>) <xsl:value-of select="@Name"/><xsl:if test="schema_1_0:Parameter | schema_1_1:Parameter | schema_1_2:Parameter">With<xsl:for-each select="schema_1_0:Parameter | schema_1_1:Parameter | schema_1_2:Parameter"><xsl:value-of select="translate(@Name, $uppercase, $smallcase)"/>:(<xsl:if test="@Type = 'Edm.String'">NSString *</xsl:if><xsl:if test="@Type = 'Edm.Int32'">NSNumber *</xsl:if><xsl:if test="@Type = 'Edm.Int16'">NSNumber *</xsl:if><xsl:if test="@Type = 'Edm.Int64'">NSNumber *</xsl:if>
<xsl:for-each select="schema_1_0:FunctionImport | schema_1_1:FunctionImport | schema_1_2:FunctionImport">- (<xsl:choose><xsl:when test="contains(@ReturnType, 'Collection')">NSArray *</xsl:when><xsl:when test="contains(@ReturnType, 'Edm.')">NSString *</xsl:when><xsl:when test="contains(@ReturnType, @ComplexType)"><xsl:choose><xsl:when test="contains(@ReturnType,$service_namespace)"><xsl:value-of select="$modified_service_namespace"/>_<xsl:value-of select="substring-after(@ReturnType, concat($service_namespace, '.'))"/> *</xsl:when><xsl:otherwise><xsl:value-of select="@ReturnType"/> *</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="contains(@ReturnType, @EntityType)"><xsl:choose><xsl:when test="contains(@ReturnType,$service_namespace)"><xsl:value-of select="substring-after(@ReturnType, concat($service_namespace, '.'))"/> *</xsl:when><xsl:otherwise><xsl:value-of select="@ReturnType"/> *</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>NSString *</xsl:otherwise></xsl:choose>) <xsl:value-of select="@Name"/><xsl:if test="schema_1_0:Parameter | schema_1_1:Parameter | schema_1_2:Parameter">With<xsl:for-each select="schema_1_0:Parameter | schema_1_1:Parameter | schema_1_2:Parameter"><xsl:value-of select="translate(@Name, $uppercase, $smallcase)"/>:(<xsl:if test="@Type = 'Edm.String'">NSString *</xsl:if><xsl:if test="@Type = 'Edm.Int32'">NSNumber *</xsl:if><xsl:if test="@Type = 'Edm.Int16'">NSNumber *</xsl:if><xsl:if test="@Type = 'Edm.Int64'">NSNumber *</xsl:if>
<xsl:if test="@Type = 'Edm.Binary'">NSData *</xsl:if>
<xsl:if test="@Type = 'Edm.Decimal'">NSDecimalNumber *</xsl:if>
<xsl:if test="@Type = 'Edm.Boolean'">ODataBool *</xsl:if>
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/odatagen/objc_implementation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<xsl:for-each select="schema_1_0:FunctionImport | schema_1_1:FunctionImport | schema_1_2:FunctionImport">/*
* Method for service operation
*/
- (<xsl:choose><xsl:when test="contains(@ReturnType, 'Collection')">NSArray *</xsl:when><xsl:when test="contains(@ReturnType, 'Edm.')">NSString *</xsl:when><xsl:when test="contains(@ReturnType, @ComplexType)"><xsl:choose><xsl:when test="contains(@ReturnType,$service_namespace)"><xsl:value-of select="substring-after(@ReturnType, concat($service_namespace, '.'))"/> *</xsl:when><xsl:otherwise><xsl:value-of select="@ReturnType"/> *</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="contains(@ReturnType, @EntityType)"><xsl:choose><xsl:when test="contains(@ReturnType,$service_namespace)"><xsl:value-of select="substring-after(@ReturnType, concat($service_namespace, '.'))"/> *</xsl:when><xsl:otherwise><xsl:value-of select="@ReturnType"/> *</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>NSString *</xsl:otherwise></xsl:choose>) <xsl:value-of select="@Name"/><xsl:if test="schema_1_0:Parameter | schema_1_1:Parameter | schema_1_2:Parameter">With<xsl:for-each select="schema_1_0:Parameter | schema_1_1:Parameter | schema_1_2:Parameter"><xsl:value-of select="translate(@Name, $uppercase, $smallcase)"/>:(<xsl:if test="@Type = 'Edm.String'">NSString *</xsl:if><xsl:if test="@Type = 'Edm.Int32'">NSNumber *</xsl:if><xsl:if test="@Type = 'Edm.Int16'">NSNumber *</xsl:if><xsl:if test="@Type = 'Edm.Int64'">NSNumber *</xsl:if>
- (<xsl:choose><xsl:when test="contains(@ReturnType, 'Collection')">NSArray *</xsl:when><xsl:when test="contains(@ReturnType, 'Edm.')">NSString *</xsl:when><xsl:when test="contains(@ReturnType, @ComplexType)"><xsl:choose><xsl:when test="contains(@ReturnType,$service_namespace)"><xsl:value-of select="$modified_service_namespace"/>_<xsl:value-of select="substring-after(@ReturnType, concat($service_namespace, '.'))"/> *</xsl:when><xsl:otherwise><xsl:value-of select="@ReturnType"/> *</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="contains(@ReturnType, @EntityType)"><xsl:choose><xsl:when test="contains(@ReturnType,$service_namespace)"><xsl:value-of select="substring-after(@ReturnType, concat($service_namespace, '.'))"/> *</xsl:when><xsl:otherwise><xsl:value-of select="@ReturnType"/> *</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>NSString *</xsl:otherwise></xsl:choose>) <xsl:value-of select="@Name"/><xsl:if test="schema_1_0:Parameter | schema_1_1:Parameter | schema_1_2:Parameter">With<xsl:for-each select="schema_1_0:Parameter | schema_1_1:Parameter | schema_1_2:Parameter"><xsl:value-of select="translate(@Name, $uppercase, $smallcase)"/>:(<xsl:if test="@Type = 'Edm.String'">NSString *</xsl:if><xsl:if test="@Type = 'Edm.Int32'">NSNumber *</xsl:if><xsl:if test="@Type = 'Edm.Int16'">NSNumber *</xsl:if><xsl:if test="@Type = 'Edm.Int64'">NSNumber *</xsl:if>
<xsl:if test="@Type = 'Edm.Binary'">NSData *</xsl:if>
<xsl:if test="@Type = 'Edm.Decimal'">NSDecimalNumber *</xsl:if>
<xsl:if test="@Type = 'Edm.Boolean'">ODataBool *</xsl:if>
Expand Down