<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      用 XSLT 將 PowerDesign 9.5 的 cdm 文件直接轉化為源代碼

      用 XSLT 將 PowerDesign 9.5 的 cdm 文件直接轉化為源代碼

      工作中發現一旦項目中使用powerdesign進行建模之后,最后進行編碼的時候幾乎還需要自己手工做一遍,因為架構不同,使用powerdesign生成的C#源代碼幾乎不能使用。所以沒辦法只能自己來做這個轉換。

      第一版轉換程序用的C#編的程序,一旦要修改,就要重新編譯,不爽。所以這次用純的XSLT來做這個轉換。因為cdm文件比較復雜,作第一版的時候曾經嘗試過用XSLT,但是最后因為自己xslt功力不夠,只好轉用代碼實現。

      經過半天奮戰,半成品如下。我會根據工作進度及時修改的

      <?xml version="1.0" encoding="gb2312"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
          
      <xsl:output method="text" encoding="UTF-8" indent="yes"/>
          
          
      <xsl:template match="/">
              
      <html>
                  
      <head>
                      
      <title>C# source from CDM file</title>
                  
      </head>
                  
      <body>
                      
      <xsl:apply-templates/>
                  
      </body>
              
      </html>
          
      </xsl:template>
          
      <!-- 覆蓋缺省的文字處理過程 -->
          
      <xsl:template match="text()|@*">
          
      </xsl:template>

          
      <!-- /Model -->
          
      <xsl:template match="Model">
              
      <xsl:apply-templates/>
          
      </xsl:template>
          
          
      <!-- /Model/o:RootObject -->
          
      <xsl:template match="o:RootObject">
              
      <xsl:apply-templates/>
          
      </xsl:template>
          
          
      <!-- /Model/o:RootObject/c:Children -->
          
      <xsl:template match="c:Children">
              
      <xsl:apply-templates/>
          
      </xsl:template>
          
          
      <!-- /Model/o:RootObject/c:Children/o:Model -->
          
      <xsl:template match="o:Model">
              
      <xsl:apply-templates/>
          
      </xsl:template>
          
          
      <!-- o:Model/o:Packages -->
          
      <xsl:template match="c:Packages">
              
      <xsl:apply-templates/>
          
      </xsl:template>
          
          
      <!-- o:Model/o:Packages/o:Package -->
          
      <xsl:template match="o:Package">
              // 
      <xsl:value-of select="a:Name" />
              namespace 
      <xsl:value-of select="a:Code" />
              {
                  
      <xsl:apply-templates/>
              } // namespace 
      <xsl:value-of select="a:Code" />
              
          
      </xsl:template>

          
      <xsl:template match="c:ConceptualDiagrams">
          
      </xsl:template>

          
      <xsl:template match="c:Relationships">
          
      </xsl:template>    
          
          
      <xsl:template match="c:Domains">
          
      </xsl:template>    
          
          
      <xsl:template match="c:ChildExtendedDependencies">
          
      </xsl:template>    
          
          
      <xsl:template match="c:TargetModels">
          
      </xsl:template>    
          
          
      <!-- o:Model/o:Packages/o:Package/c:Entities -->
          
      <xsl:template match="c:Entities">
              
      <xsl:apply-templates/>
          
      </xsl:template>
          
          
      <!-- o:Model/o:Packages/o:Package/c:Entities/o:Entity -->
          
      <xsl:template match="o:Entity">
              // class 
      <xsl:value-of select="a:Name" />
              public class 
      <xsl:value-of select="a:Code" />
              {
                  
      <xsl:apply-templates/>
              }// class 
      <xsl:value-of select="a:Code" />
              
          
      </xsl:template>

          
      <xsl:template match="c:Identifiers">
          
      </xsl:template>
          
          
      <xsl:template match="c:PrimaryIdentifier">
          
      </xsl:template>
          
          
      <!-- o:Model/o:Packages/o:Package/c:Entities/o:Entity/c:Attributes -->
          
      <xsl:template match="c:Attributes">
              
      <xsl:apply-templates />
          
      </xsl:template>
          
          
      <!-- 開始寫入數據字段定義和初始值 -->
          
      <!-- o:Model/o:Packages/o:Package/c:Entities/o:Entity/c:Attributes/o:EntityAttribute -->
          
      <xsl:template match="o:EntityAttribute">
              
      <xsl:apply-templates mode="FieldRefer" select="c:DataItem" /><xsl:if test="a:Mandatory=0"> = null</xsl:if>;
          
      </xsl:template>

          
      <!-- o:Model/o:Packages/o:Package/c:Entities/o:Entity/c:Attributes/o:EntityAttribute/c:DataItem -->
          
      <!-- 根據DataItem中的子元素,分別定向到 DataItem 或 Shortcut 中 -->
          
      <xsl:template match="c:DataItem" mode="FieldRefer">
              
      <xsl:apply-templates mode="FieldJump" />
          
      </xsl:template>
          
          
      <!-- o:Model/o:Packages/o:Package/c:Entities/o:Entity/c:Attributes/o:EntityAttribute/c:DataItem/o:DataItem -->
          
      <xsl:template match="o:DataItem" mode="FieldJump">
              
      <!-- 跳到 o:Model/o:Packages/o:Package/c:DataItems/o:DataItem -->
              
      <xsl:variable name="ref" select="@Ref" />        
              
      <xsl:apply-templates mode="Field" select="../../../../../../c:DataItems/o:DataItem[@Id=$ref]" />
          
      </xsl:template>

          
      <!-- o:Model/o:Packages/o:Package/c:Entities/o:Entity/c:Attributes/o:EntityAttribute/c:DataItem/o:Shortcut -->
          
      <xsl:template match="o:Shortcut" mode="FieldJump">
              
      <!-- 取得 o:Model/o:Packages/o:Package/c:Entities/o:Shortcut 信息并跳到 DataItem -->
              
      <xsl:variable name="ref" select="@Ref" /> 
              
      <xsl:variable name="tag" select="http://o:Shortcut[@Id=$ref]/a:TargetID" />
              
      <xsl:apply-templates mode="Field" select="http://c:DataItems/o:DataItem[a:ObjectID=$tag]" />
          
      </xsl:template>

          
      <!-- o:Model/o:Packages/o:Package/c:DataItems/o:DataItem -->
          
      <!-- 顯示字段的類型:如果沒有domain則解釋映射dataType的值 -->
          
      <xsl:template match="o:DataItem" mode="Field">
              
      <xsl:variable name="domainId" select="c:Domain/o:Domain/@Ref" />
              [XmlElement("
      <xsl:value-of select="a:Code" />")] public <xsl:if test="string-length($domainId) != 0" >
                  
      <xsl:apply-templates mode="FieldType" select="http://c:Domains/o:Domain[@Id=$domainId]" />
              
      </xsl:if><xsl:if test="string-length($domainId) = 0" >
                  
      <xsl:call-template name="SqlType2CsType">
                      
      <xsl:with-param name="type" select="a:DataType" />
                      
      <xsl:with-param name="len" select="a:Length" />
                  
      </xsl:call-template>
              
      </xsl:if> m_<xsl:value-of select="a:Code" />
          
      </xsl:template>
          
          
      <!-- o:Model/c:Domains/o:Domain -->
          
      <!-- 顯示類型 -->
          
      <xsl:template match="o:Domain" mode="FieldType"><xsl:value-of select="a:Code" />Type</xsl:template>
          
          
      <!-- 轉換 SQL 類型到 C# 類型 -->
          
      <xsl:template name="SqlType2CsType">
              
      <xsl:param name="type" />
              
      <xsl:param name="len" />
              
      <xsl:choose>
                  
      <xsl:when test="$type='VA'">string</xsl:when>
              
      </xsl:choose>
          
      </xsl:template>

          
      <!-- o:Model/o:Packages/o:Package/c:Relationships/ -->
          
      <!-- 將實體之間關系轉化為字段 -->
          
      <xsl:template match="c:Relationships" mode="Field">
          
      </xsl:template>

          
      <!-- o:Model/o:Packages/o:Package/c:Relationships/ -->
          
      <!-- 將實體之間關系轉化為字段 -->
          
      <xsl:template match="o:Relationship" mode="Field">
          
      </xsl:template>
          
      </xsl:stylesheet>

      posted on 2004-09-29 17:57  老翅寒暑  閱讀(1248)  評論(0)    收藏  舉報

      導航

      主站蜘蛛池模板: 少妇高潮喷水正在播放| 免费看欧美全黄成人片| 国产精品美女免费无遮挡| 午夜高清福利在线观看| 99久久精品美女高潮喷水| 亚洲精品成人综合色在线| 亚洲人午夜精品射精日韩| 极品少妇xxxx| 成人无码视频| 深夜宅男福利免费在线观看| 激情综合五月网| 香蕉久久久久久久av网站| 伊人成人在线视频免费| 欧洲精品色在线观看| 国精品午夜福利视频| 国产激情文学亚洲区综合| 四虎影视库国产精品一区| 欧美18videosex性欧美tube1080| 国产乱人伦av在线无码| 国产精品一码在线播放| 国产麻豆一区二区精彩视频| 亚洲国产日韩a在线亚洲| 亚洲精品无码高潮喷水A| 亚洲综合伊人久久大杳蕉| 四虎成人精品永久网站| 亚洲国产欧美一区二区好看电影| 国产AV国片精品有毛| 久久青草国产精品一区| 精品一二三四区在线观看| 欧美日本国产va高清cabal| 欧美一区二区三区欧美日韩亚洲| 日本精品不卡一二三区| 国产最新精品系列第三页| 成人片黄网站色大片免费毛片| 久久精品国产99久久6| 免费国产拍久久受拍久久| 成人无码特黄特黄AV片在线 | 韩国无码av片在线观看| 国产免费午夜福利在线播放| 国产欧美精品aaaaaa片| 亚洲中文欧美在线视频|