﻿<?xml version="1.0"?>
<!--
    Title: xmi-to-html.xsl
    Purpose: An XSL stylesheet for converting ArgoUML 0.80 XMI to HTML.

    Copyright (C) 1999-2001, Objects by Design, Inc. All Rights Reserved.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation. A copy of the license may be found at
    http://www.objectsbydesign.com/projects/gpl.txt

    Version:  March 5, 2006

    For HISTORY and CREDITS, please see the README file.
    
    Modified by Fillano Feng for convertion of Microsoft Word 2003 xml format from xmi format.
    Original filename is xmi-to-html.xsl. Now is xmi-to-xml.xsl
    Jan 15, 2008
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" 
                xmlns:o="urn:schemas-microsoft-com:office:office"
                xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
                xmlns:UML="org.omg.xmi.namespace.UML"
                version="1.0"
                exclude-result-prefixes="#default">
                
<xsl:output method="xml" indent="yes" />

<xsl:key
    name="classifier"
    match="//UML:Class|//UML:Interface|
           //UML:DataType"
    use="@xmi.id"/>

<xsl:key
    name="generalization"
    match="//UML:Generalization"
    use="@xmi.id"/>

<xsl:key
    name="abstraction"
    match="//UML:Abstraction"
    use="@xmi.id"/>

<xsl:key
    name="multiplicity"
    match="//UML:Multiplicity"
    use="@xmi.id"/>

<xsl:key
    name="tagdefinition"
    match="//UML:TagDefinition"
    use="@name"/>


<!-- Document Root -->
<xsl:template match="/">
<?mso-application progid="Word.Document"?>
<w:wordDocument 
    xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" 
    xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
    xmlns:w10="urn:schemas-microsoft-com:office:word" 
    xmlns:v="urn:schemas-microsoft-com:vml" 
    xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" 
    xmlns:aml="http://schemas.microsoft.com/aml/2001/core" 
    xmlns:o="urn:schemas-microsoft-com:office:office" 
    xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" 
    xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
    w:embeddedObjPresent="no" 
    xml:space="preserve">
    <!-- Model Name in window title -->
    <xsl:apply-templates select="//UML:Model[@xmi.id]" mode="head"/>

    <w:fonts>
        <w:defaultFonts w:cs="" w:fareast="" w:h-ansi="" w:ascii=""/>
        <w:font w:name="Tahoma1">
            <w:family w:val="System"/>
            <w:pitch w:val=""/>
        </w:font>
        <w:font w:name="宋体">
            <w:family w:val="System"/>
            <w:pitch w:val=""/>
        </w:font>
        <w:font w:name="Times New Roman">
            <w:family w:val="Roman"/>
            <w:pitch w:val="variable"/>
        </w:font>
        <w:font w:name="Arial">
            <w:family w:val="Swiss"/>
            <w:pitch w:val="variable"/>
        </w:font>
        <w:font w:name="Tahoma">
            <w:family w:val="System"/>
            <w:pitch w:val="variable"/>
        </w:font>
        <w:font w:name="新細明體">
            <w:family w:val="System"/>
            <w:pitch w:val="variable"/>
        </w:font>
    </w:fonts>
            
    <w:lists>
        <w:listDef w:listDefId="0">
            <w:lvl w:ilvl="0">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%1"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
            <w:lvl w:ilvl="1">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%2"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
            <w:lvl w:ilvl="2">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%3"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
            <w:lvl w:ilvl="3">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%4"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
            <w:lvl w:ilvl="4">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%5"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
            <w:lvl w:ilvl="5">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%6"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
            <w:lvl w:ilvl="6">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%7"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
            <w:lvl w:ilvl="7">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%8"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
            <w:lvl w:ilvl="8">
                <w:start w:val="1"/>
                <w:nfc w:val="255"/>
                <w:lvlText w:val="%9"/>
                <w:lvlJc w:val="left"/>
                <w:pPr>
                    <w:tabs>
                        <w:tab w:val="list" w:pos="366.027"/>
                    </w:tabs>
                    <w:ind w:hanging="0" w:left="0"/>
                </w:pPr>
            </w:lvl>
        </w:listDef>
        <w:list w:ilfo="1">
            <w:ilst w:val="0"/>
        </w:list>
    </w:lists>
            
    <w:styles>
        <w:style w:styleId="default-paragraph-style" w:type="paragraph" w:default="on">
            <w:name w:val="default-paragraph-style"/>
            <w:pPr>
                <w:adjustRightInd w:val="off"/>
                <w:spacing/>
                <w:ind/>
                <w:widowControl w:val="off"/>
                <w:pBdr/>
                <w:ind/>
            </w:pPr>
            <w:rPr>
                <w:rFonts w:ascii="Times New Roman" w:h-ansi="Times New Roman" w:fareast="新細明體" w:cs="Tahoma"/>
                <w:sz w:val="24"/>
                <w:lang w:val="en-US"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="default-table-style" w:type="table" w:default="on">
            <w:name w:val="default-table-style"/>
            <w:tblPr>
                <w:tblInd w:w="0" w:type="auto"/>
            </w:tblPr>
        </w:style>
        <w:style w:styleId="Standard" w:type="paragraph">
            <w:basedOn w:val="default-paragraph-style"/>
            <w:name w:val="Standard"/>
        </w:style>
        <w:style w:styleId="Heading" w:type="paragraph">
            <w:basedOn w:val="Standard"/>
            <w:name w:val="Heading"/>
            <w:next w:val="Text_20_body"/>
            <w:pPr>
                <w:adjustRightInd w:val="off"/>
                <w:spacing w:before="239.841" w:after="120.204"/>
                <w:ind/>
                <w:widowControl w:val="off"/>
                <w:pBdr/>
                <w:ind/>
            </w:pPr>
            <w:rPr>
                <w:rFonts w:ascii="Arial" w:h-ansi="Arial" w:fareast="新細明體" w:cs="Tahoma"/>
                <w:sz w:val="28"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="Text_20_body" w:type="paragraph">
            <w:basedOn w:val="Standard"/>
            <w:name w:val="Text_20_body"/>
            <w:pPr>
                <w:adjustRightInd w:val="off"/>
                <w:spacing w:before="0" w:after="120.204"/>
                <w:ind/>
                <w:widowControl w:val="off"/>
                <w:pBdr/>
                <w:ind/>
            </w:pPr>
        </w:style>
        <w:style w:styleId="List" w:type="paragraph">
            <w:basedOn w:val="Text_20_body"/>
            <w:name w:val="List"/>
            <w:rPr>
                <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="Tahoma1"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="Caption" w:type="paragraph">
            <w:basedOn w:val="Standard"/>
            <w:name w:val="Caption"/>
            <w:pPr>
                <w:adjustRightInd w:val="off"/>
                <w:spacing w:before="120.204" w:after="120.204"/>
                <w:ind/>
                <w:widowControl w:val="off"/>
                <w:supressLineNumbers/>
                <w:pBdr/>
                <w:ind/>
            </w:pPr>
            <w:rPr>
                <w:rFonts w:cs="Tahoma1"/>
                <w:sz w:val="24"/>
                <w:i/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="Index" w:type="paragraph">
            <w:basedOn w:val="Standard"/>
            <w:name w:val="Index"/>
            <w:pPr>
                <w:adjustRightInd w:val="off"/>
                <w:spacing/>
                <w:ind/>
                <w:widowControl w:val="off"/>
                <w:supressLineNumbers/>
                <w:pBdr/>
                <w:ind/>
            </w:pPr>
            <w:rPr>
                <w:rFonts w:cs="Tahoma1"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="Heading_20_1" w:type="paragraph">
            <w:basedOn w:val="Heading"/>
            <w:name w:val="Heading_20_1"/>
            <w:next w:val="Text_20_body"/>
            <w:rPr>
                <w:b/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="Table_20_Contents" w:type="paragraph">
            <w:basedOn w:val="Standard"/>
            <w:name w:val="Table_20_Contents"/>
            <w:pPr>
                <w:adjustRightInd w:val="off"/>
                <w:spacing/>
                <w:ind/>
                <w:widowControl w:val="off"/>
                <w:supressLineNumbers/>
                <w:pBdr/>
                <w:ind/>
            </w:pPr>
        </w:style>
        <w:style w:styleId="Table_20_Heading" w:type="paragraph">
            <w:basedOn w:val="Table_20_Contents"/>
            <w:name w:val="Table_20_Heading"/>
            <w:pPr>
                <w:adjustRightInd w:val="off"/>
                <w:jc w:val="center"/>
                <w:spacing/>
                <w:ind/>
                <w:widowControl w:val="off"/>
                <w:supressLineNumbers/>
                <w:pBdr/>
                <w:ind/>
            </w:pPr>
            <w:rPr>
                <w:b/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="表格1" w:type="table">
            <w:name w:val="表格1"/>
            <w:hidden w:val="on"/>
            <w:tblPr>
                <w:tblInd w:w="0" w:type="auto"/>
                <w:jc w:val="left"/>
                    <w:tblBorders>
                        <w:top w:val="double" w:sz="12" w:color="000000"/>
                        <w:bottom w:val="double" w:sz="12" w:color="000000"/>
                        <w:left w:val="double" w:sz="12" w:color="000000"/>
                        <w:right w:val="double" w:sz="12" w:color="000000"/>
                        <w:insideH w:val="none" w:sz="0"  w.color="000000"/>
                        <w:insideV w:val="none" w:sz="0"  w.color="000000"/>
                    </w:tblBorders>
            </w:tblPr>
        </w:style>
        <w:style w:styleId="表格2" w:type="table">
            <w:name w:val="表格2"/>
            <w:hidden w:val="on"/>
            <w:tblPr>
                <w:tblInd w:w="0" w:type="auto"/>
                <w:jc w:val="left"/>
                    <w:tblBorders>
                        <w:top w:val="none" w:sz="0" w:color="000000"/>
                        <w:bottom w:val="none" w:sz="0" w:color="000000"/>
                        <w:left w:val="none" w:sz="0" w:color="000000"/>
                        <w:right w:val="none" w:sz="0" w:color="000000"/>
                        <w:insideH w:val="single" w:sz="0"  w.color="000000"/>
                        <w:insideV w:val="single" w:sz="0"  w.color="000000"/>
                    </w:tblBorders>
                    <w:tblW w:w="50000" w:type="pct"/>
            </w:tblPr>
        </w:style>
        <w:style w:styleId="表格3" w:type="table">
            <w:name w:val="表格3"/>
            <w:hidden w:val="on"/>
            <w:tblPr>
                <w:tblInd w:w="0" w:type="auto"/>
                <w:jc w:val="left"/>
                    <w:tblBorders>
                        <w:top w:val="single" w:sz="0" w:color="000000"/>
                        <w:bottom w:val="none" w:sz="0" w:color="000000"/>
                        <w:left w:val="none" w:sz="0" w:color="000000"/>
                        <w:right w:val="none" w:sz="0" w:color="000000"/>
                        <w:insideH w:val="single" w:sz="0"  w.color="000000"/>
                        <w:insideV w:val="single" w:sz="0"  w.color="000000"/>
                    </w:tblBorders>
                    <w:tblW w:w="50000" w:type="pct"/>
            </w:tblPr>
        </w:style>
        <w:style w:styleId="P1" w:type="paragraph">
            <w:basedOn w:val="Heading_20_1"/>
            <w:name w:val="P1"/>
            <w:hidden w:val="on"/>
            <w:pPr>
                <w:adjustRightInd w:val="off"/>
                <w:jc w:val="center"/>
                <w:spacing/>
                <w:ind/>
                <w:widowControl w:val="off"/>
                <w:pBdr/>
                <w:ind/>
            </w:pPr>
        </w:style>
        <w:style w:styleId="P2" w:type="paragraph">
            <w:basedOn w:val="Table_20_Contents"/>
            <w:name w:val="P2"/>
            <w:hidden w:val="on"/>
            <w:rPr>
                <w:b/>
                <w:color w:val="ffffff"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="P3" w:type="paragraph">
            <w:basedOn w:val="Table_20_Contents"/>
            <w:name w:val="P3"/>
            <w:hidden w:val="on"/>
            <w:rPr>
                <w:i/>
                <w:b/>
                <w:color w:val="666699"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="P4" w:type="paragraph">
            <w:basedOn w:val="Table_20_Contents"/>
            <w:name w:val="P4"/>
            <w:hidden w:val="on"/>
            <w:rPr>
                <w:b/>
                <w:color w:val="666699"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="P5" w:type="paragraph">
            <w:basedOn w:val="Table_20_Contents"/>
            <w:name w:val="P5"/>
            <w:hidden w:val="on"/>
            <w:rPr>
                <w:color w:val="333366"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="P6" w:type="paragraph">
            <w:basedOn w:val="Table_20_Contents"/>
            <w:name w:val="P6"/>
            <w:hidden w:val="on"/>
            <w:rPr>
                <w:b/>
                <w:color w:val="333366"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="P7" w:type="paragraph">
            <w:basedOn w:val="Table_20_Contents"/>
            <w:name w:val="P7"/>
            <w:hidden w:val="on"/>
            <w:rPr>
                <w:color w:val="0000ff"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="T1" w:type="character">
            <w:name w:val="T1"/>
            <w:hidden w:val="on"/>
            <w:rPr>
                <w:b/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="Hyperlink" w:type="character">
            <w:name w:val="Hyperlink"/>
            <w:rsid w:val="006A55B0"/>
            <w:rPr>
                <w:color w:val="000080"/>
                <w:u w:val="single"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="FollowedHyperlink" w:type="character">
            <w:name w:val="FollowedHyperlink"/>
            <w:rsid w:val="006A55B0"/>
            <w:rPr>
                <w:color w:val="800000"/>
                <w:u w:val="single"/>
            </w:rPr>
        </w:style>
                
        <w:style w:styleId="CommentReference" w:type="character">
            <w:name w:val="annotation reference"/>
            <w:basedOn w:val="DefaultParagraphFont"/>
            <w:semiHidden/>
            <w:rsid w:val="007770B7"/>
            <w:rPr>
                <w:sz w:val="16"/>
                <w:sz-cs w:val="16"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="CommentText" w:type="paragraph">
            <w:name w:val="annotation text"/>
            <w:basedOn w:val="Normal"/>
            <w:semiHidden/>
            <w:rsid w:val="007770B7"/>
            <w:pPr>
                <w:pStyle w:val="CommentText"/>
            </w:pPr>
            <w:rPr>
                <w:sz w:val="20"/>
                <w:sz-cs w:val="20"/>
            </w:rPr>
        </w:style>
        <w:style w:styleId="CommentSubject" w:type="paragraph">
            <w:name w:val="annotation subject"/>
            <w:basedOn w:val="CommentText"/>
            <w:next w:val="CommentText"/>
            <w:semiHidden/>
            <w:rsid w:val="007770B7"/>
            <w:pPr>
                <w:pStyle w:val="CommentSubject"/>
            </w:pPr>
            <w:rPr>
                <w:b/>
                <w:b-cs/>
            </w:rPr>
        </w:style>
                
    </w:styles>
            
    <w:docPr>
        <w:displayBackgroundShape/>
        <w:view w:val="print"/>
        <w:zoom w:percent=""/>
        <w:defaultTabStop w:val="709.317"/>
        <w:docVars/>
    </w:docPr>

    <w:body>
   
    <!-- Model Name in document heading -->
    <xsl:apply-templates select="//UML:Model[@xmi.id]" mode="body"/>
         
    <!-- Interfaces -->
    <xsl:apply-templates select="//UML:Interface[@xmi.id]">
        <xsl:sort select="@name"/>
    </xsl:apply-templates>

    <!-- Classes -->
    <xsl:apply-templates select="//UML:Class[@xmi.id]">
        <xsl:sort select="@name"/>
    </xsl:apply-templates>

    </w:body>
</w:wordDocument>

</xsl:template>


<!-- Window Title -->
<xsl:template match="UML:Model" mode="head">
    
    <o:DocumentProperties>
	<!-- Name of the model -->
        <o:Title><xsl:value-of select="@name"/></o:Title>
    </o:DocumentProperties>

</xsl:template>


<!-- Document Heading -->
<xsl:template match="UML:Model" mode="body">
    
        <w:p>
            <w:pPr>
                <w:pStyle w:val="P1"/>
            </w:pPr>
            <w:r>
	<!-- Name of the model -->
                <w:t><xsl:value-of select="@name"/></w:t>
            </w:r>
        </w:p> 

</xsl:template>


<!-- Class -->
<xsl:template match="UML:Class">
    <xsl:variable name="element_name" 
         select="@name"/>

    <xsl:variable name="xmi_id" select="@xmi.id" />

        <w:tbl>
            <w:tblPr>
                <w:tblStyle w:val="表格1"/>
                <w:tblW w:w="9638.4332" w:type="dxa"/>
                <w:tblInd w:w="0" w:type="auto"/>
                <w:jc w:val="left"/>
            </w:tblPr>
            <w:tblGrid>
                <w:gridCol w:w="9638.4332"/>
            </w:tblGrid>
            <w:tr>
                <w:trPr/>
                <w:tc>
                    <w:tcPr>
                        <w:tcW w:type="dxa" w:w="9638.4332"/>
                        <w:tcMar>
                            <w:top w:w="0" w:type="dxa"/>
                            <w:left w:w="0" w:type="dxa"/>
                            <w:bottom w:w="0" w:type="dxa"/>
                            <w:right w:w="0" w:type="dxa"/>
                        </w:tcMar>
                    </w:tcPr>
<!-- table frame before end -->
<!-- table title start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格2"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="2089.395"/>
                            <w:gridCol w:w="7439.0401"/>
                        </w:tblGrid>
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2089.395"/>
                                    <w:shd w:color="9999cc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P2"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>类:</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="7439.0401"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P3"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t><xsl:value-of select="$element_name"/></w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2089.395"/>
                                    <w:shd w:color="9999cc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P2"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>说明:</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="7439.0401"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P3"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t> </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                    </w:tbl>
<!-- table title end -->

        <xsl:call-template name="specifications"/>

        <xsl:call-template name="realizations"/>

        <xsl:call-template name="supertypes"/>
        
        <xsl:call-template name="subtypes"/>
        
        <xsl:call-template name="associations">
            <xsl:with-param name="source" select="$xmi_id"/>
        </xsl:call-template>
        
        <xsl:call-template name="attributes"/>

        <xsl:call-template name="operations"/>

	<xsl:call-template name="documentation"/>

<!-- table frame after start -->
                <w:p />
                </w:tc>
            </w:tr>
        </w:tbl>
        <w:p/>
<!-- table frame after end -->

</xsl:template>


<!-- Interface -->
<xsl:template match="UML:Interface">
    <xsl:variable name="element_name" 
         select="@name"/>

<!-- table frame before start -->
        <w:tbl>
            <w:tblPr>
                <w:tblStyle w:val="表格1"/>
                <w:tblW w:w="9638.4332" w:type="dxa"/>
                <w:tblInd w:w="0" w:type="auto"/>
                <w:jc w:val="left"/>
            </w:tblPr>
            <w:tblGrid>
                <w:gridCol w:w="9638.4332"/>
            </w:tblGrid>
            <w:tr>
                <w:trPr/>
                <w:tc>
                    <w:tcPr>
                        <w:tcW w:type="dxa" w:w="9638.4332"/>
                        <w:tcMar>
                            <w:top w:w="0" w:type="dxa"/>
                            <w:left w:w="0" w:type="dxa"/>
                            <w:bottom w:w="0" w:type="dxa"/>
                            <w:right w:w="0" w:type="dxa"/>
                        </w:tcMar>
                    </w:tcPr>
<!-- table frame before end -->
<!-- table title start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格2"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="2089.395"/>
                            <w:gridCol w:w="7439.0401"/>
                        </w:tblGrid>
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2089.395"/>
                                    <w:shd w:color="9999cc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P2"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>接口:</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="7439.0401"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P3"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t><xsl:value-of select="$element_name"/></w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2089.395"/>
                                    <w:shd w:color="9999cc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P2"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>說明:</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="7439.0401"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P3"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t> </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                    </w:tbl>
<!-- table title end -->

        <xsl:call-template name="realizations"/>

        <xsl:call-template name="supertypes"/>
        
        <xsl:call-template name="subtypes"/>

        <xsl:call-template name="operations"/>

<!-- table frame after start -->
                <w:p />
                </w:tc>
            </w:tr>
        </w:tbl> 
        <w:p/>
<!-- table frame after end -->

</xsl:template>


<!-- The following template is designed to be called for Abstractions with the "realize"
     stereotype, i.e. Realization relationships.  It formats the name of the supplier of the
     Abstraction dependency, i.e. the class or interface specifying the behaviour of the
     client in the dependency.
-->
<!-- Specifications (interface or class) -->
<xsl:template name="specifications">

    <!-- Abstractions identify specifications -->
    <xsl:variable name="specifications" 
         select="UML:ModelElement.clientDependency/
                 UML:Abstraction"/>

    <xsl:if test="count($specifications) > 0">
<!-- table content start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格3"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="1728.216"/>
                            <w:gridCol w:w="1808.163"/>
                            <w:gridCol w:w="2009.448"/>
                            <w:gridCol w:w="3982.6081"/>
                        </w:tblGrid>
<!-- Property title row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="12" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P4"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>规格:</w:t>
                                        <w:br/>
                                        <w:t>(Specifications)</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:gridSpan w:val="3"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="12" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:r>
                                        <w:t>
            <xsl:for-each select="$specifications">
            
                <!-- get the supplier in the abstraction -->
                <xsl:variable name="abstraction"
                     select="key('abstraction', ./@xmi.idref)" />
                <xsl:variable name="target"
                     select="$abstraction/
                            UML:Dependency.supplier/
                            */@xmi.idref" /> 

                <xsl:call-template name="classify">
                    <xsl:with-param name="target" select="$target"/>
                </xsl:call-template>
                
                <xsl:if test="position() != last()">
                    <xsl:text>,  </xsl:text>
                </xsl:if>
            </xsl:for-each>
                                       </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                    </w:tbl>
    </xsl:if>  
        
</xsl:template>


<!-- The following template is designed to be called for Abstractions with the "realize"
     stereotype, i.e. Realization relationships.  It formats the name of the client of the
     Abstraction dependency, i.e. the class realizing the specification defined by the
     supplier in the dependency.
-->
<!-- Realizations (of interface) -->
<xsl:template name="realizations">

    <xsl:variable name="classid" select="@xmi.id"/>

    <!-- Abstractions identify realizations -->
    <xsl:variable name="realizations" 
         select="//UML:Abstraction[UML:Dependency.supplier/*/@xmi.idref=$classid]"/>

    <xsl:if test="count($realizations) > 0">
<!-- table content start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格3"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="1728.216"/>
                            <w:gridCol w:w="1808.163"/>
                            <w:gridCol w:w="2009.448"/>
                            <w:gridCol w:w="3982.6081"/>
                        </w:tblGrid>
<!-- Property title row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="12" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P4"/>
                                    </w:pPr>
                                    <w:r>
                                         <w:t>实现(Realizations):</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:gridSpan w:val="3"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="12" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:r>
                                        <w:t>
            <xsl:for-each select="$realizations">
            
                <!-- get the client in the abstraction -->
                <xsl:variable name="target"
                     select="UML:Dependency.client/
                            */@xmi.idref" /> 
                <xsl:call-template name="classify">
                    <xsl:with-param name="target" select="$target"/>
                </xsl:call-template>
                
                <xsl:if test="position() != last()">
                    <xsl:text>,  </xsl:text>
                </xsl:if>
            </xsl:for-each>
                                       </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                    </w:tbl>
    </xsl:if>  
        
</xsl:template>



<!-- Supertypes (inheritance) -->
<xsl:template name="supertypes">
    
    <!-- Generalizations identify supertypes -->
    <xsl:variable name="generalizations" 
         select="UML:GeneralizableElement.generalization/
                 UML:Generalization"/>

    <xsl:if test="count($generalizations) > 0">
<!-- table content start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格3"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="1728.216"/>
                            <w:gridCol w:w="1808.163"/>
                            <w:gridCol w:w="2009.448"/>
                            <w:gridCol w:w="3982.6081"/>
                        </w:tblGrid>
<!-- Property title row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="0" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P4"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>父类(Supertypes):</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:gridSpan w:val="3"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="0" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:r>
                                        <w:t>
             <xsl:for-each select="$generalizations">
            
                <!-- get the parent in the generalization -->
                <xsl:variable name="generalization"
                     select="key('generalization', ./@xmi.idref)" />
                <xsl:variable name="target"
                     select="$generalization/
                            UML:Generalization.parent/
                            */@xmi.idref" /> 
                <xsl:call-template name="classify">
                    <xsl:with-param name="target" select="$target"/>
                </xsl:call-template>
                
                <xsl:if test="position() != last()">
                    <xsl:text>,  </xsl:text>
                </xsl:if>
            </xsl:for-each>
                                       </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                    </w:tbl>
    </xsl:if>  
</xsl:template>


<!-- Subtypes (inheritance) -->
<xsl:template name="subtypes">

    <xsl:variable name="classid" select="@xmi.id"/>

    <!-- Specializations identify subtypes -->
    <xsl:variable name="specializations" 
         select="//UML:Generalization[UML:Generalization.parent/UML:Class/@xmi.idref=$classid]"/>

    <xsl:if test="count($specializations) > 0">
<!-- table content start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格3"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="1728.216"/>
                            <w:gridCol w:w="1808.163"/>
                            <w:gridCol w:w="2009.448"/>
                            <w:gridCol w:w="3982.6081"/>
                        </w:tblGrid>
<!-- Property title row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="0" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P4"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>子类(Subtypes):</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:gridSpan w:val="3"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="0" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:r>
                                        <w:t>
            <xsl:for-each select="$specializations">
            
                <!-- get the child in the generalization -->
                <xsl:variable name="target"
                     select="UML:Generalization.child/
                            */@xmi.idref" /> 
                <xsl:call-template name="classify">
                    <xsl:with-param name="target" select="$target"/>
                </xsl:call-template>
                
                <xsl:if test="position() != last()">
                    <xsl:text>,  </xsl:text>
                </xsl:if>
            </xsl:for-each>
                                       </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                    </w:tbl>
    </xsl:if>  
</xsl:template>


<!-- Associations -->
<xsl:template name="associations">
    <xsl:param name="source"/>
    
    <xsl:variable name="association_ends" 
         select="//UML:AssociationEnd
                 [UML:AssociationEnd.participant/*/
                  @xmi.idref=$source]" />

    <xsl:if test="count($association_ends) > 0">
<!-- table content start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格3"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="1728.216"/>
                            <w:gridCol w:w="1808.163"/>
                            <w:gridCol w:w="2009.448"/>
                            <w:gridCol w:w="3982.6081"/>
                        </w:tblGrid>
<!-- Property title row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:gridSpan w:val="4"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="0" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P4"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>关联(Associations):</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
<!-- Property table header begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>可视范围</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1808.163"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>类型</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2009.448"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>性质</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="3982.6081"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>说明</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>

        <xsl:for-each select="$association_ends">
            <xsl:for-each select="preceding-sibling::UML:AssociationEnd |
                                  following-sibling::UML:AssociationEnd">

                <xsl:call-template name="association_end" />
            
            </xsl:for-each>
        </xsl:for-each>
                    </w:tbl>
    </xsl:if>  
</xsl:template>


<!-- Association End -->
<xsl:template name="association_end">
    <!-- Visibility -->
<!-- first row begin -->
                        <w:tr>
                            <w:trPr/>
<!-- first cell -->
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P5"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t><xsl:variable name="visibility"
             select="@visibility" />
        <xsl:choose>
            <xsl:when test="string-length($visibility) > 0">
                <xsl:value-of select="$visibility"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
            </xsl:otherwise>
        </xsl:choose>        
</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>

    <!-- Type -->
<!-- second cell -->
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1808.163"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P7"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t><xsl:variable name="target"
             select="UML:AssociationEnd.participant/*/@xmi.idref" />
        <xsl:call-template name="classify">
            <xsl:with-param name="target" select="$target"/>
        </xsl:call-template>
</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
    
    <!-- Properties -->
<!-- third cell -->
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2009.448"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="Table_20_Contents"/>
                                    </w:pPr>
         <xsl:variable name="rolename" 
             select="@name"/>
                                   <w:r>
                                        <w:rPr>
                                            <w:rStyle w:val="T1"/>
                                        </w:rPr>
                                        <w:t>Rolename:</w:t>
                                    </w:r>
                                    <w:r>
        <xsl:choose>
            <xsl:when test="string-length($rolename) > 0">
                <w:t><xsl:value-of select="$rolename"/></w:t>
            </xsl:when>
            <xsl:otherwise><w:t>(none)</w:t></xsl:otherwise>
        </xsl:choose>
                                    </w:r>
        <!-- Multiplicity -->
        <xsl:apply-templates select=".//UML:Multiplicity" />
    
        <!-- Navigable -->
        <xsl:variable name="navigable" 
             select="@isNavigable"/>
        <xsl:if test="string-length($navigable) > 0">
                                   <w:r>
                                        <w:rPr>
                                            <w:rStyle w:val="T1"/>
                                        </w:rPr>
                                        <w:br w:type="text-wrapping" w:clear="none"/>
                                        <w:t>Navigable: </w:t>
                                    </w:r> 
                                    <w:r>
                                        <w:t><xsl:value-of select="$navigable"/></w:t>
                                    </w:r>
        </xsl:if>
        <!-- Ordering -->
        <xsl:variable name="ordering" 
             select="@ordering"/>
        <xsl:if test="string-length($ordering) > 0">
                                   <w:r>
                                        <w:rPr>
                                            <w:rStyle w:val="T1"/>
                                        </w:rPr>
                                        <w:br w:type="text-wrapping" w:clear="none"/>
                                        <w:t>Ordering: </w:t>
                                    </w:r>
                                    <w:r>
                                        <w:t><xsl:value-of select="$ordering"/></w:t>
                                    </w:r>
        </xsl:if>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="3982.6081"/>
                                     <w:vmerge w:val="restart"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="Table_20_Contents"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t> </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
</xsl:template>


<!-- Multiplicity (definition) -->
<xsl:template match="UML:Multiplicity[@xmi.id]">
                                   <w:r>
                                        <w:rPr>
                                            <w:rStyle w:val="T1"/>
                                        </w:rPr>
                                        <w:br w:type="text-wrapping" w:clear="none"/>
                                        <w:t>Multiplicity: </w:t> 
                                    </w:r>
    
    <xsl:variable name="lower" 
         select=".//@lower"/>
	 
    <xsl:variable name="upper" 
         select=".//@upper"/>
                                     <w:r><w:t>
    <xsl:value-of select="$lower" />
    <xsl:if test="$upper != $lower">
        <xsl:text>..</xsl:text>
	<xsl:if test="$upper!='-1'">
        	<xsl:value-of select="$upper" />
	</xsl:if>
	<xsl:if test="$upper='-1'">*</xsl:if>
    </xsl:if>
                                    </w:t></w:r>    
</xsl:template>

<!-- Multiplicity (reference) -->
<xsl:template match="UML:Multiplicity[@xmi.idref]">
    <xsl:apply-templates
        select="key('multiplicity', @xmi.idref)" />
</xsl:template>

<!-- Attributes -->
<xsl:template name="attributes">
<!-- table content start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格3"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="1728.216"/>
                            <w:gridCol w:w="1808.163"/>
                            <w:gridCol w:w="2009.448"/>
                            <w:gridCol w:w="3982.6081"/>
                        </w:tblGrid>
<!-- Property title row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:gridSpan w:val="4"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="12" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P4"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>字段(Attributes):</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
    <xsl:choose>
        <xsl:when test="count(UML:Classifier.feature/UML:Attribute) > 0">
<!-- Property table header begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>可视范围</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1808.163"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>类型</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2009.448"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>名字</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="3982.6081"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>说明</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                        <xsl:apply-templates select="UML:Classifier.feature/UML:Attribute" />
        </xsl:when>
        <xsl:otherwise>
                        <w:tr>
                            <w:tc>
                                <w:tcPr> 
                                    <w:gridSpan w:val="4"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P7"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t> none </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr> 
        </xsl:otherwise>
    </xsl:choose>
                    </w:tbl>
</xsl:template>


<xsl:template match="UML:Attribute">
    <xsl:variable name="target"
         select='UML:StructuralFeature.type/*/@xmi.idref'/>

                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P5"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t><xsl:value-of select="@visibility"/></w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>

                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1808.163"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P7"/>
                                    </w:pPr>
                                    <w:r>
        <w:t><xsl:call-template name="classify">
            <xsl:with-param name="target" select="$target" />
        </xsl:call-template></w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>

                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2009.448"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="Table_20_Contents"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:rPr>
                                            <w:rStyle w:val="T1"/>
                                        </w:rPr>
        <w:t><xsl:value-of select="@name"/></w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="3982.6081"/>
                                     <w:vmerge w:val="restart"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="Table_20_Contents"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t> </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
</xsl:template>



<!-- Operations -->
<xsl:template name="operations">
 <!-- table content start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格3"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="1728.216"/>
                            <w:gridCol w:w="1808.163"/>
                            <w:gridCol w:w="2009.448"/>
                            <w:gridCol w:w="3982.6081"/>
                        </w:tblGrid>
<!-- Property title row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:gridSpan w:val="4"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="0" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P4"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>操作(Operations):</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>

    <xsl:choose>
        <xsl:when test="count(UML:Classifier.feature/UML:Operation) > 0">
<!-- Property table header begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>可视范围</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1808.163"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>返回</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2009.448"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>名字</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="3982.6081"/>
                                    <w:shd w:color="ffffcc" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P6"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>说明</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>

            <xsl:apply-templates select="UML:Classifier.feature/UML:Operation" />
        </xsl:when>
        <xsl:otherwise>
                        <w:tr>
                            <w:tc>
                                <w:tcPr> 
                                    <w:gridSpan w:val="4"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P7"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t> none </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
        </xsl:otherwise>
    </xsl:choose>
                    </w:tbl>
</xsl:template>


<xsl:template match="UML:Operation">
    <xsl:variable name="parameters"
         select="UML:BehavioralFeature.parameter/
         UML:Parameter
	 [@name!='return']" />
	 
    <xsl:variable name="return"
         select="UML:BehavioralFeature.parameter/
         UML:Parameter
	 [@kind='return']" />
		  
    <xsl:variable name="target"
         select="$return/UML:Parameter.type/*/@xmi.idref" />

<!-- first row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P5"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t><xsl:value-of select="@visibility" /></w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>

                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1808.163"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P7"/>
                                    </w:pPr>
                                    <w:r>

        <xsl:choose>
            <xsl:when test="string-length($target) = 0">
                                        <w:t><xsl:text>void</xsl:text></w:t>
            </xsl:when>

            <xsl:otherwise>
                <xsl:call-template name="classify">
                    <xsl:with-param name="target" select="$target" />
                </xsl:call-template>
            </xsl:otherwise>
        </xsl:choose>

                                    </w:r>
                                </w:p>
                            </w:tc>

                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="2009.448"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="Table_20_Contents"/>
                                    </w:pPr>
                                    <w:r>                                    
                                        <w:t><xsl:value-of select="@name"/></w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="3982.6081"/>
                                     <w:vmerge w:val="restart"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="single" w:sz="12" w:color="auto"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="Table_20_Contents"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t> </w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>

    <xsl:variable name="parameter-count" select="count($parameters)" />

    <xsl:if test="not(normalize-space($parameter-count)='0')">
<!-- second row begin -->

                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="none" w:sz="0" w:color="auto"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P5"/>
                                    </w:pPr>
                                    <w:r>
                                         <w:t>参数:</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1808.163"/>
                                    <w:gridSpan w:val="2"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="none" w:sz="0" w:color="auto"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="Table_20_Contents"/>
                                    </w:pPr>
                                    <w:r>
                <xsl:apply-templates select="$parameters" />
                                    </w:r>
                               </w:p>
                            </w:tc>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="3982.6081"/>
                                     <w:vmerge w:val="conitue"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="0" w:color="auto"/>
                                        <w:bottom w:val="none" w:sz="0" w:color="auto"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="Table_20_Contents"/>
                                    </w:pPr>
                                    <w:r>
                                         <w:t>none</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
    </xsl:if >
</xsl:template>



<!-- Parameter -->
<xsl:template match="UML:Parameter">
    <xsl:variable name="target" 
         select="UML:Parameter.type/*/@xmi.idref" />
                                        <w:t><xsl:call-template name="classify">
                                            <xsl:with-param name="target" select="$target" />
                                        </xsl:call-template></w:t>
                                        <w:tab/>
                                        <w:t><xsl:value-of select="@name"/></w:t>
                                        <w:br w:type="text-wrapping" w:clear="none"/>
</xsl:template>


<!-- Classification -->
<xsl:template name="classify">

    <xsl:param name="target"/>

    <xsl:variable name="classifier"
         select="key('classifier', $target)" />
                  
    <xsl:variable name="classifier_name"
         select="$classifier/@name" />

    <xsl:variable name="type" select="name($classifier)" />

    <!-- Get the type of the classifier (class, interface, datatype) -->
    <xsl:variable name="classifier_type">
    <xsl:choose>
        <xsl:when test="$type='UML:Class'">classifier</xsl:when>
        <xsl:when test="$type='UML:Interface'">interface</xsl:when>
        <xsl:when test="$type='UML:DataType'">datatype</xsl:when>
        <xsl:otherwise>classifier</xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    
    <xsl:choose>
        <!-- Datatypes don't have hyperlinks -->
        <xsl:when test="$type='UML:DataType'">
            <!--<span class="datatype">-->
                <w:t><xsl:value-of select="$classifier_name"/></w:t>
            <!--</span>-->
        </xsl:when>
        
        <!-- Classes and Interfaces have hyperlinks -->
        <!-- The classifier type is used to style appropriately -->
        <xsl:otherwise>
            <xsl:if test="string-length($classifier_name) > 0">
                <!--<a class="{$classifier_type}" href="#{$classifier_name}">-->
                <w:t><xsl:value-of select="$classifier_name"/></w:t>
                <!--</a>-->
            </xsl:if>
        </xsl:otherwise>
    </xsl:choose>

</xsl:template>

<xsl:template name="documentation">
    <xsl:variable name="doctag"
	select="key('tagdefinition', 'documentation')/@xmi.id" />

    <xsl:variable name="documentation"
        select="UML:ModelElement.taggedValue/UML:TaggedValue
                                  [UML:TaggedValue.type/UML:TagDefinition/@xmi.idref=$doctag]/
                                  UML:TaggedValue.dataValue"/>
    <xsl:if test="string-length($documentation)>0">
<!-- table content start -->
                    <w:tbl>
                        <w:tblPr>
                            <w:tblStyle w:val="表格3"/>
                            <w:tblW w:w="9528.4352" w:type="dxa"/>
                            <w:tblInd w:w="0" w:type="auto"/>
                            <w:jc w:val="left"/>
                        </w:tblPr>
                        <w:tblGrid>
                            <w:gridCol w:w="1728.216"/>
                            <w:gridCol w:w="1808.163"/>
                            <w:gridCol w:w="2009.448"/>
                            <w:gridCol w:w="3982.6081"/>
                        </w:tblGrid>
<!-- Property title row begin -->
                        <w:tr>
                            <w:trPr/>
                            <w:tc>
                                <w:tcPr>
                                    <w:tcW w:type="dxa" w:w="1728.216"/>
                                    <w:gridSpan w:val="4"/>
                                    <w:shd w:color="e6e6ff" w:val="solid"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                    <w:tcBorders>
                                        <w:top w:val="none" w:sz="12" w:color="000000"/>
                                        <w:bottom w:val="single" w:sz="0" w:color="000000"/>
                                    </w:tcBorders>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P4"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t>文档:</w:t>
                                        <w:br/>
                                        <w:t>(Documentations)</w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                        <w:tr>
                            <w:tc>
                                <w:tcPr> 
                                    <w:gridSpan w:val="4"/>
                                    <w:tcMar>
                                        <w:top w:w="50" w:type="dxa"/>
                                        <w:left w:w="50" w:type="dxa"/>
                                        <w:bottom w:w="50" w:type="dxa"/>
                                        <w:right w:w="50" w:type="dxa"/>
                                    </w:tcMar>
                                </w:tcPr>
                                <w:p>
                                    <w:pPr>
                                        <w:pStyle w:val="P7"/>
                                    </w:pPr>
                                    <w:r>
                                        <w:t><xsl:value-of select="$documentation"/></w:t>
                                    </w:r>
                                </w:p>
                            </w:tc>
                        </w:tr>
                    </w:tbl>
    </xsl:if>
</xsl:template>

</xsl:stylesheet>