changeset 4:d240adc2ac70

sync
author cin
date Thu, 01 Mar 2018 16:53:23 +0300
parents 437127ab6a12
children 6f67d3a6b950
files xslt/generator.csharp.xsl xslt/model.xsl xslt/preprocess.xsl
diffstat 3 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/xslt/generator.csharp.xsl	Wed Feb 28 02:10:29 2018 +0300
+++ b/xslt/generator.csharp.xsl	Thu Mar 01 16:53:23 2018 +0300
@@ -26,12 +26,15 @@
 	</xsl:template>
 	
 	<xsl:template match="m:entity" mode="entity">
+		<xsl:variable name="members">
+			<xsl:apply-templates mode="fiter-members"/>
+		</xsl:variable>
 		<cs:class modifiers="partial">
 			<xsl:attribute name="name">
 				<xsl:apply-templates select="." mode="class-name"/>
 			</xsl:attribute>
 			<xsl:apply-templates mode="class-attributes" />
-			<xsl:apply-templates mode="members" />
+			<xsl:apply-templates select="exsl:node-set($members)" mode="members" />
 		</cs:class>
 	</xsl:template>
 	
@@ -63,6 +66,12 @@
 		<xsl:apply-templates select="." mode="property"/>
 	</xsl:template>
 	
+	<xsl:template match="m:thisKey" mode="members">
+		<xsl:variable name="properties">
+			
+		</xsl:variable>
+	</xsl:template>
+	
 	<!-- hasA and hasMany doesn't generate members itself, they delegate this work to inner members -->
 	<xsl:template match="m:hasA | m:hasMany" mode="members">
 		<t:trace msg="{name()} {@name}" />
--- a/xslt/model.xsl	Wed Feb 28 02:10:29 2018 +0300
+++ b/xslt/model.xsl	Thu Mar 01 16:53:23 2018 +0300
@@ -173,7 +173,7 @@
 		<xsl:apply-templates mode="process-member"/>
 	</xsl:template>
 	
-	<xsl:template match="m:hasA[@type]/m:thisKey" mode="process-member">
+	<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"/>
--- a/xslt/preprocess.xsl	Wed Feb 28 02:10:29 2018 +0300
+++ b/xslt/preprocess.xsl	Thu Mar 01 16:53:23 2018 +0300
@@ -3,6 +3,7 @@
 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 	xmlns:m="http://implab.org/schemas/data-model.v1.xsd"
 	xmlns:exsl="http://exslt.org/common"
+	xmlns:msxsl="urn:schemas-microsoft-com:xslt"
 	xmlns:t="http://implab.org/schemas/temp"
 >
 	<!--
@@ -13,6 +14,13 @@
 	which is the result of applying templates in mode=preprocess  
 	-->
 	<xsl:output method="xml" indent="yes" />
+	
+	<msxsl:script language="JScript" implements-prefix="exsl">
+		this['node-set'] =  function (x) {
+			return x;
+		}
+	</msxsl:script>
+	
 	<xsl:variable name="preprocessResult">
 		<t:module>
 			<xsl:call-template name="preprocess" />