I saw which nodes the default templates process in the debugger, but have been unable to solve the problem of unwanted output. The following code is what I'm working with. It's a transform that turns XML describing a set of XML tables into a tree. I tried overriding built-in template rules (see below), but have been unsuccessful. I think I may be missing something fundamental about how this all works.
The processor complains about template ambiguity, which is understandable, but I really don't get what's happening.
Here's the XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="/">
<root>
<xsl:apply-templates/>
</root>
</xsl:template>
<xsl:template match="text()|@*"/>
<xsl:template match="/root/customers/customer[@org='one']">
<xsl:element name="customer">
<xsl:attribute name="org"><xsl:value-of select="@org"/></xsl:attribute>
<xsl:call-template name="vlan">
<xsl:with-param name="customer" select="@org"/>
</xsl:call-template>
</xsl:element>
</xsl:template>
<xsl:template name="vlan">
<xsl:param name="customer"/>
<xsl:for-each select="/root/vlans/vlan[$customer='one']">
<xsl:element name="vlan">
<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
and the XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<customers>
<customer org="one"/>
<customer org="two"/>
</customers>
<servers>
<server name="svr1" customer="one"/>
<server name="svr2" customer="one"/>
<server name="svr3" customer="one"/>
</servers>
<ipaddresses>
<ipaddress addr="1.1.1.1" server="svr1"/>
<ipaddress addr="1.1.1.2" server="svr1"/>
<ipaddress addr="1.1.1.3" server="svr2"/>
<ipaddress addr="1.1.1.4" server="svr2"/>
<ipaddress addr="1.1.1.5" server="svr3"/>
<ipaddress addr="1.1.1.6" server="svr3"/>
</ipaddresses>
<vlans>
<vlan name="vlan1" customer="one"/>
<vlan name="vlan2" customer="one"/>
</vlans>
<subnets>
<subnet mask="176.255.255.0" vlan="vlan1"/>
<subnet mask="192.255.255.0" vlan="vlan2"/>
</subnets>
</root>
It sti