Mercurial > pub > ModelGenerator
diff xslt/model.xsl @ 6:1f4009d4afb6
working on model to csharp transform
author | cin |
---|---|
date | Mon, 05 Mar 2018 10:37:47 +0300 |
parents | d240adc2ac70 |
children | 3fe157be5141 |
line wrap: on
line diff
--- a/xslt/model.xsl Fri Mar 02 18:34:19 2018 +0300 +++ b/xslt/model.xsl Mon Mar 05 10:37:47 2018 +0300 @@ -75,7 +75,7 @@ </xsl:call-template> </xsl:variable> - <xsl:variable name="members" select="exsl:node-set($scopeMembers)/*[not($memberName) or @name='$memberName']"/> + <xsl:variable name="members" select="exsl:node-set($scopeMembers)/*[not($memberName) or @name=$memberName]"/> <xsl:choose> <xsl:when test="$members"> @@ -92,7 +92,7 @@ <xsl:otherwise> <xsl:call-template name="warn"> <xsl:with-param name="msg"> - <t:trace msg="failed to resolve {$member}"/> + <t:trace msg="failed to resolve {$memberName}, scope={$scope}"/> <t:trace msg="inspected classes"> <xsl:for-each select="$seen | $self"> <t:trace msg="{name()} {@name}"/> @@ -113,7 +113,7 @@ <xsl:apply-templates mode="filter-members"/> </xsl:when> <xsl:when test="$scope='keys'"> - <xsl:apply-template mode="filter-keys"/> + <xsl:apply-templates mode="filter-keys"/> </xsl:when> <xsl:when test="$scope='properties'"> <xsl:apply-templates mode="fiflter-properties"/> @@ -163,33 +163,8 @@ <xsl:param name="type" /> <xsl:call-template name="getMembers"> <xsl:with-param name="type" select="$type"/> - <xsl:with-param name="scope" select="keys"/> + <xsl:with-param name="scope" select="'keys'"/> </xsl:call-template> </xsl:template> - <xsl:template match="*|text()" mode="process-member"/> - - <xsl:template match="m:hasA" mode="process-member"> - <xsl:apply-templates mode="process-member"/> - </xsl:template> - - <xsl:template match="m:hasA[@type]/m:thisKey" mode="foreign-key"> - <xsl:variable name="foreignPrimaryKey"> - <xsl:call-template name="getPrimaryKey"> - <xsl:with-param name="type" select="../@type"/> - </xsl:call-template> - </xsl:variable> - <m:property type="{exsl:node-set($foreignPrimaryKey)[1]/@type}"> - <xsl:copy-of select="@*"/> - </m:property> - </xsl:template> - - <xsl:template match="m:primaryKey" mode="process-member"> - <m:property> - <xsl:copy-of select="@*"/> - <xsl:copy-of select="*"/> - </m:property> - </xsl:template> - - </xsl:stylesheet>