As most of us know, the new kicad distribution doesn’t generate ready to use BOM files anymore, the docs only give suggestions on how to set up xml/xsl transformation with xsltproc. ( https://answers.launchpad.net/kicad/+faq/2265 )
The xsltproc is linux-native and I’ve found it painful to install on windows where I do most of my kicad work.
So I did a little bit of research and came up with an alternative solution, using “saxon” xml engine as xsl processor.
Here are the steps necessary to make it work in recent kicad versions (about bzr5000 and upwards)
Thanks for the solution. What version of Kicad are you using? I’m on BZR-5228 and there doesn’t seem to be a BOM2CSV file anywhere in the installation folder - or in fact even a plugin folder. Is this part of a “standard install” (whatever a standard install might be ) or do I need to get this from somewhere else?
Hello, @crashbang_proto
If you build your Kicad from sources, the xsl files should be in the source tree at least, on my install it is in kicad-winbuilder-3.4\src\kicad\eeschema\plugins
If you install from the binary package downloaded from nosoftware.cz, this install, indeed, doesn’t have plugins bundled for whatever reason; in this case you can get them from official github mirror here:
Great, thanks @Dolganoff. I was indeed using the windows build off nosoftware.cz (so much faster to install than the build from source). Will check out the github link, thanks.
Is your bom2csv.xsl file actually there in the Plugins folder?
If yes and the command line still doesn’t work, I’d try to install saxon into folder without spaces in its name.
Thank you for your quick reply.
Yes the bom2csv file is in the plugin directory. I downloaded it from github and pasted it there.
I tried installing saxon to c:\saxon, again without success.
Ok, I reinstalled saxon just in c:\saxon
I also reinstalled KiCad in C:\KiCad so there are no spaces in directory names.
I finally got a screenshot.
Here is what I got from Saxon.
URIResolver.resolve href=“file:/c:/KiCad/bin/Plugins/bom2csv.xsl” base="null’
Using parser org.apache.xerces.jaxp.SAXParserImp1$JAXPSAXParser
Error on line 34 column 71 of bom2csv.xsl:
SXXP003: Error reported by XML parser: Attribute name “data-pjax-transient” associated with an element type “meta” must be followed by the ’ = ’ character.
Failed to compile stylesheet. 1 error detected.
Oh, this file isn’t an xsl at all, you’ve downloaded the html of the github page where the xsl file resides. To have the file, while in https://github.com/KiCad/kicad-source-mirror/tree/master/eeschema/plugins don’t do “save as” over the link because the file is not directly there but one step further. folow the link first and then click “Raw” button to download the original.
try to expand the command line with real file names and run the command from the command line outside of Kicad, to see what messages pop out.
On my windows station the command resolves to:
“c:\Saxon\bin\Transform.exe” -t “d:\temp\1\inLOOP New Pro_Comm Sound Board-.xml” -xsl:“d:\kicad-winbuilder-3.4\kicad\bin\plugins\bom2csv.xsl” -o:“inLOOP New Pro_Comm Sound Board-.csv”
Thanks Dolganoff for this tip and the detail of your explanation. Got it going first time in BZR5380, constructed using winbuilder. I found the bom2csv.xsl plugin hiding in kicad-winbuilder-3.4\src\kicad\eeschema\plugins.
I tried saxon, but it does not really work well for me, so I took some time ‘installing’ xsltproc.
I made a package with all necessary stuff and uploaded it to this forum, have a look at this post: BOM grouped by reference