2010-08-05 14:38:20 +00:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<!--XSL style sheet to EESCHEMA Generic Netlist Format to PADS netlist format
|
|
|
|
Copyright (C) 2010, SoftPLC Corporation.
|
|
|
|
GPL v2.
|
2010-08-19 14:02:49 +00:00
|
|
|
|
|
|
|
How to use:
|
|
|
|
https://lists.launchpad.net/kicad-developers/msg05157.html
|
2010-08-05 14:38:20 +00:00
|
|
|
-->
|
|
|
|
|
|
|
|
<!DOCTYPE xsl:stylesheet [
|
|
|
|
<!ENTITY nl "
"> <!--new line CR, LF -->
|
|
|
|
]>
|
|
|
|
|
|
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
|
|
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
|
|
|
|
|
2010-08-11 19:52:44 +00:00
|
|
|
<xsl:template match="/export">
|
2010-08-05 14:38:20 +00:00
|
|
|
<xsl:text>*PADS-PCB*&nl;*PART*&nl;</xsl:text>
|
|
|
|
<xsl:apply-templates select="components/comp"/>
|
|
|
|
<xsl:text>&nl;*NET*&nl;</xsl:text>
|
|
|
|
<xsl:apply-templates select="nets/net"/>
|
2010-08-20 13:41:36 +00:00
|
|
|
<xsl:text>*END*&nl;</xsl:text>
|
2010-08-05 14:38:20 +00:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<!-- for each component -->
|
|
|
|
<xsl:template match="comp">
|
2010-08-11 15:32:44 +00:00
|
|
|
<xsl:text> </xsl:text>
|
2010-08-05 14:38:20 +00:00
|
|
|
<xsl:value-of select="@ref"/>
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<xsl:choose>
|
2010-08-11 15:32:44 +00:00
|
|
|
<xsl:when test = "footprint != '' ">
|
|
|
|
<xsl:apply-templates select="footprint"/>
|
2010-08-05 14:38:20 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2010-08-11 15:32:44 +00:00
|
|
|
<xsl:text>unknown</xsl:text>
|
2010-08-05 14:38:20 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>&nl;</xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<!-- for each net -->
|
|
|
|
<xsl:template match="net">
|
2010-08-20 13:41:36 +00:00
|
|
|
<!-- nets are output only if there is more than one pin in net -->
|
|
|
|
<xsl:if test="count(node)>1">
|
|
|
|
<xsl:text>*SIGNAL* </xsl:text>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test = "@name != '' ">
|
|
|
|
<xsl:value-of select="@name"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:text>N-</xsl:text>
|
|
|
|
<xsl:value-of select="@code"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>&nl;</xsl:text>
|
|
|
|
<xsl:apply-templates select="node"/>
|
|
|
|
</xsl:if>
|
2010-08-05 14:38:20 +00:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<!-- for each node -->
|
|
|
|
<xsl:template match="node">
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<xsl:value-of select="@ref"/>
|
|
|
|
<xsl:text>.</xsl:text>
|
|
|
|
<xsl:value-of select="@pin"/>
|
|
|
|
<xsl:text>&nl;</xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|