| 1 |
<!-- must define a prefix for default namespace (fml) as soon as there is another prefix defined |
|---|
| 2 |
otherwise XPath expressions don't treat default namespace --> |
|---|
| 3 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|---|
| 4 |
xmlns:fml="http://neuralensemble.org/FacetsML" |
|---|
| 5 |
xmlns:class="http://neuralensemble.org/FacetsML/cellclass" |
|---|
| 6 |
xmlns:rand="http://neuralensemble.org/FacetsML/randomNumberGenerator" |
|---|
| 7 |
version="1.0"> |
|---|
| 8 |
|
|---|
| 9 |
<xsl:strip-space elements="*"/> |
|---|
| 10 |
<xsl:output method="text" indent="no" omit-xml-declaration="yes"/> |
|---|
| 11 |
<xsl:template match="/"> |
|---|
| 12 |
|
|---|
| 13 |
<xsl:apply-templates/> |
|---|
| 14 |
|
|---|
| 15 |
</xsl:template> |
|---|
| 16 |
|
|---|
| 17 |
<xsl:template match="class:*">{ <xsl:call-template name="dumpCellparams"/>} |
|---|
| 18 |
</xsl:template> |
|---|
| 19 |
|
|---|
| 20 |
<xsl:template match="class:NonStandardCellType">{ <xsl:apply-templates select="class:cellparams"/> } |
|---|
| 21 |
</xsl:template> |
|---|
| 22 |
|
|---|
| 23 |
<xsl:template match="class:cellparams"><xsl:call-template name="dumpDictParam"/> |
|---|
| 24 |
</xsl:template> |
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
<!-- |
|---|
| 29 |
functions to dump attributes as label="aLabel" or label=aLabel or just aLabel |
|---|
| 30 |
--> |
|---|
| 31 |
<xsl:template match="@*"><xsl:value-of select="local-name()"/>="<xsl:value-of select="current()"/>", </xsl:template> |
|---|
| 32 |
|
|---|
| 33 |
<xsl:template match="@*" mode="object"><xsl:value-of select="local-name()"/>=<xsl:value-of select="current()"/>, </xsl:template> |
|---|
| 34 |
|
|---|
| 35 |
<xsl:template match="@*" mode="value"><xsl:value-of select="current()"/>, </xsl:template> |
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
<!-- |
|---|
| 39 |
dump generic parameters as : <methodParameter name="p_connect" value="0.005"/> |
|---|
| 40 |
--> |
|---|
| 41 |
<xsl:template name="dumpDictParam">'<xsl:value-of select="@name"/>': <xsl:value-of select="@value"/>, </xsl:template> |
|---|
| 42 |
|
|---|
| 43 |
<!-- |
|---|
| 44 |
generically dump attributes as a dict : |
|---|
| 45 |
<class:IF_cond_exp tau_m="20." tau_syn_E="5." tau_syn_I="10." |
|---|
| 46 |
v_rest="-60." v_reset="-60." v_thresh="-50." |
|---|
| 47 |
cm="1." tau_refrac="5." e_rev_E="0." |
|---|
| 48 |
e_rev_I="-80."/> |
|---|
| 49 |
|
|---|
| 50 |
-> |
|---|
| 51 |
|
|---|
| 52 |
'tau_m': 20., 'tau_syn_E': 5., 'tau_syn_I': 10., 'v_rest': -60., 'v_reset': -60., 'v_thresh': -50., 'cm': 1., 'tau_refrac': 5., 'e_rev_E': 0., 'e_rev_I': -80., |
|---|
| 53 |
--> |
|---|
| 54 |
<xsl:template name="dumpCellparams"><xsl:for-each select="attribute::*">'<xsl:value-of select="local-name()"/>': <xsl:value-of select="current()"/>, </xsl:for-each> |
|---|
| 55 |
</xsl:template> |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
</xsl:stylesheet> |
|---|