[GME-commit] GMESRC/Paradigms/SF/xslt Basic2Primitive.xsl,NONE,1.1 Primitive2Basic.xsl,NONE,1.1 SFDemoWithMetaChanged.xme,NONE,1.1

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu May 13 21:00:09 CDT 2004


Update of /var/lib/gme/GMESRC/Paradigms/SF/xslt
In directory braindrain:/tmp/cvs-serv3614

Added Files:
	Basic2Primitive.xsl Primitive2Basic.xsl 
	SFDemoWithMetaChanged.xme 
Log Message:
Xslt example files and SFDemo with renamed kind added.


CVS User: zolmol

--- NEW FILE: Basic2Primitive.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="xml" omit-xml-declaration="no" doctype-system="mga.dtd" indent="yes"/>

<xsl:template match="/">
		<xsl:apply-templates/>
</xsl:template>


<xsl:template match="project">
		<project>
		<xsl:attribute name="guid"><xsl:value-of select="attribute::guid"/></xsl:attribute>
		<xsl:attribute name="cdate"><xsl:value-of select="attribute::cdate"/></xsl:attribute>
		<xsl:attribute name="mdate"><xsl:value-of select="attribute::mdate"/></xsl:attribute>
		<xsl:attribute name="metaguid"><xsl:value-of select="attribute::metaguid"/></xsl:attribute>
		<xsl:attribute name="metaname"><xsl:value-of select="attribute::metaname"/></xsl:attribute>
		<xsl:apply-templates/>
		</project>
</xsl:template>


<xsl:template match="folder">
		<folder>
		<xsl:attribute name="id"><xsl:value-of select="attribute::id"/></xsl:attribute>
		<xsl:attribute name="relid"><xsl:value-of select="attribute::relid"/></xsl:attribute>
		<xsl:attribute name="childrelidcntr"><xsl:value-of select="attribute::childrelidcntr"/></xsl:attribute>
		<xsl:attribute name="kind"><xsl:value-of select="attribute::kind"/></xsl:attribute>
		<xsl:apply-templates/>
		</folder>
</xsl:template>


<!-- =============================================================================== -->
<!--              This template will alter models with Basic kind                    -->
<!-- =============================================================================== -->
<xsl:template match="model[attribute::kind='Basic']">
		<model>
		<xsl:attribute name="id"><xsl:value-of select="attribute::id"/></xsl:attribute>
		<xsl:attribute name="kind">Primitive</xsl:attribute>
		
		<xsl:if test="@role='BasicParts'">
				<xsl:attribute name="role">PrimitiveParts</xsl:attribute>
		</xsl:if>
		
		<xsl:attribute name="relid"><xsl:value-of select="attribute::relid"/></xsl:attribute>
		
		<xsl:if test="@childrelidcntr">
				<xsl:attribute name="childrelidcntr"><xsl:value-of select="attribute::childrelidcntr"/></xsl:attribute>
		</xsl:if>
		
		<xsl:apply-templates/>
		
		</model>
</xsl:template>


<xsl:template match="model">
				<model>
				<xsl:attribute name="id"><xsl:value-of select="attribute::id"/></xsl:attribute>
				<xsl:attribute name="kind"><xsl:value-of select="attribute::kind"/></xsl:attribute>
				<xsl:if test="@role">
						<xsl:attribute name="role"><xsl:value-of select="attribute::role"/></xsl:attribute>
				</xsl:if>
				<xsl:attribute name="relid"><xsl:value-of select="attribute::relid"/></xsl:attribute>
				<xsl:if test="@childrelidcntr">
						<xsl:attribute name="childrelidcntr"><xsl:value-of select="attribute::childrelidcntr"/></xsl:attribute>
				</xsl:if>
				<xsl:apply-templates/>
				</model>
</xsl:template>


<xsl:template match="attribute | value | regnode | comment | author | name | atom | connection | set ">
		<xsl:copy-of select="."/>
</xsl:template>


</xsl:stylesheet>
--- NEW FILE: Primitive2Basic.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="xml" omit-xml-declaration="no" doctype-system="mga.dtd" indent="yes"/>

<xsl:template match="/">
		<xsl:apply-templates/>
</xsl:template>


<xsl:template match="project">
		<project>
		<xsl:attribute name="guid"><xsl:value-of select="attribute::guid"/></xsl:attribute>
		<xsl:attribute name="cdate"><xsl:value-of select="attribute::cdate"/></xsl:attribute>
		<xsl:attribute name="mdate"><xsl:value-of select="attribute::mdate"/></xsl:attribute>
		<xsl:attribute name="metaguid"><xsl:value-of select="attribute::metaguid"/></xsl:attribute>
		<xsl:attribute name="metaname"><xsl:value-of select="attribute::metaname"/></xsl:attribute>
		<xsl:apply-templates/>
		</project>
</xsl:template>


<xsl:template match="folder">
		<folder>
		<xsl:attribute name="id"><xsl:value-of select="attribute::id"/></xsl:attribute>
		<xsl:attribute name="relid"><xsl:value-of select="attribute::relid"/></xsl:attribute>
		<xsl:attribute name="childrelidcntr"><xsl:value-of select="attribute::childrelidcntr"/></xsl:attribute>
		<xsl:attribute name="kind"><xsl:value-of select="attribute::kind"/></xsl:attribute>
		<xsl:apply-templates/>
		</folder>
</xsl:template>


<!-- =============================================================================== -->
<!--                 This template will alter models with Primitive kind             -->
<!-- =============================================================================== -->
<xsl:template match="model[attribute::kind='Primitive']">
		<model>
			<xsl:attribute name="id"><xsl:value-of select="attribute::id"/></xsl:attribute>
			<xsl:attribute name="kind">Basic</xsl:attribute>
			
			<xsl:if test="@role='PrimitiveParts'">
					<xsl:attribute name="role">BasicParts</xsl:attribute>
			</xsl:if>
			
			<xsl:attribute name="relid"><xsl:value-of select="attribute::relid"/></xsl:attribute>

			<xsl:if test="@childrelidcntr">
					<xsl:attribute name="childrelidcntr"><xsl:value-of select="attribute::childrelidcntr"/></xsl:attribute>
			</xsl:if>

		<xsl:apply-templates/>
			
		</model>
</xsl:template>


<xsl:template match="model">
		<model>
		<xsl:attribute name="id"><xsl:value-of select="attribute::id"/></xsl:attribute>
		<xsl:attribute name="kind"><xsl:value-of select="attribute::kind"/></xsl:attribute>
		<xsl:if test="@role">
				<xsl:attribute name="role"><xsl:value-of select="attribute::role"/></xsl:attribute>
		</xsl:if>
		<xsl:attribute name="relid"><xsl:value-of select="attribute::relid"/></xsl:attribute>
		<xsl:if test="@childrelidcntr">
				<xsl:attribute name="childrelidcntr"><xsl:value-of select="attribute::childrelidcntr"/></xsl:attribute>
		</xsl:if>
		<xsl:apply-templates/>
		</model>
</xsl:template>


<xsl:template match="attribute | value | regnode | comment | author | name | atom | connection | set ">
		<xsl:copy-of select="."/>
</xsl:template>


</xsl:stylesheet>
--- NEW FILE: SFDemoWithMetaChanged.xme ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project SYSTEM "mga.dtd">

<project guid="{00000000-0000-0000-0000-000000000000}" cdate="Wed May 12 16:48:21 2004" mdate="Wed May 12 16:48:21 2004" metaguid="{694EB0C1-DEAD-BEEF-FEED-DAD000000001}" metaname="SF">
	<name>SFDemo</name>
	<comment></comment>
	<author></author>
	<folder id="id-006a-00000001" relid="0x1" childrelidcntr="0x1" kind="RootFolder">
		<name>sf-demo</name>
		<model id="id-0065-00000001" kind="Compound" relid="0x1" childrelidcntr="0x68">
			<name>System</name>
			<model id="id-0065-00000002" kind="Basic" role="BasicParts" relid="0x34" childrelidcntr="0x6">
				<name>LPFilter2</name>
				<regnode name="PartRegs" isopaque="yes">
					<value></value>
					<regnode name="ParameterAspect" isopaque="yes">
						<value></value>
						<regnode name="Position" isopaque="yes">
							<value>441,343</value>
[...3489 lines suppressed...]
				<connpoint role="src" target="id-0066-00000074"/>
			</connection>
			<connection id="id-0068-0000004e" kind="DataflowConn" role="DFC" relid="0x2d">
				<name>DFC</name>
				<connpoint role="src" target="id-0066-00000006"/>
				<connpoint role="dst" target="id-0066-0000000e"/>
			</connection>
			<connection id="id-0068-0000004f" kind="DataflowConn" role="DFC" relid="0x1a">
				<name>DFC</name>
				<connpoint role="dst" target="id-0066-00000023"/>
				<connpoint role="src" target="id-0066-00000066"/>
			</connection>
			<connection id="id-0068-00000050" kind="ParameterConn" role="PC" relid="0x1b">
				<name>PC</name>
				<connpoint role="dst" target="id-0066-00000038"/>
				<connpoint role="src" target="id-0066-00000073"/>
			</connection>
		</model>
	</folder>
</project>



More information about the GME-commit mailing list