You've got the right technique regarding namespaces in the xslt, namely you must map the uri to a prefix as the "default namespace" doesn't apply to xpaths or template match expressions. The problem is that in your c:cmap
template you're doing
<xsl:apply-templates select="c:concept"/>
But the cmap
element doesn't have any direct children named concept
. Try
<xsl:apply-templates select="c:map/c:concept-list/c:concept"/>
or more generally (but potentially less efficient)
<xsl:apply-templates select=".//c:concept"/>
to find all descendant concept
elements rather than just immediate children.
Also, in the c:concept
template you will need to add xmlns="http://graphml.graphdrawing.org/xmlns"
to the <node>
element otherwise it will be output in no namespace (with xmlns=""
).