2011-03-02 11:03:06 +00:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
|
|
|
|
<!--XSL style sheet that takes EESCHEMA's Generic Netlist Format as input and
|
|
|
|
outputs a simple BOM in CSV format. Feel free to enhance this and submit
|
|
|
|
patches.
|
|
|
|
|
|
|
|
How to use:
|
|
|
|
Eeschema.pdf: chapter 14
|
|
|
|
-->
|
2014-12-03 16:22:06 +00:00
|
|
|
<!--
|
|
|
|
@package
|
2014-12-03 19:09:56 +00:00
|
|
|
Generate a comma separated value BOM list (csv file type).
|
2014-12-03 16:22:06 +00:00
|
|
|
Components are sorted by value
|
|
|
|
One component per line
|
|
|
|
Fields are
|
2014-12-03 19:09:56 +00:00
|
|
|
Quantity, 'Part name', Description, lib
|
2014-12-03 16:22:06 +00:00
|
|
|
-->
|
2011-03-02 11:03:06 +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"/>
|
|
|
|
|
|
|
|
<!-- for each component -->
|
|
|
|
<xsl:template match="libpart">
|
|
|
|
|
2014-12-03 16:22:06 +00:00
|
|
|
<!-- -->
|
|
|
|
<xsl:value-of select="count(//comp/libsource/@part[@part])"/><xsl:text>,"</xsl:text>
|
|
|
|
<xsl:value-of select="@part"/><xsl:text>","</xsl:text>
|
|
|
|
<xsl:value-of select="description"/><xsl:text>","</xsl:text>
|
2011-03-02 11:03:06 +00:00
|
|
|
<xsl:value-of select="@lib"/>
|
|
|
|
|
2014-12-03 16:22:06 +00:00
|
|
|
<xsl:text>"&nl;</xsl:text>
|
2011-03-02 11:03:06 +00:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
|
|
<xsl:template match="/export">
|
2014-12-03 16:22:06 +00:00
|
|
|
<xsl:text>Qty,partname,description,lib&nl;</xsl:text>
|
2011-03-02 11:03:06 +00:00
|
|
|
<xsl:apply-templates select="libparts/libpart"/>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|