xml: Fix pb_type attribute Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
diff --git a/convert-pb_type-attributes.xsl b/convert-pb_type-attributes.xsl index 75f31c4..0f497ee 100644 --- a/convert-pb_type-attributes.xsl +++ b/convert-pb_type-attributes.xsl
@@ -3,24 +3,32 @@ <xsl:include href="identity.xsl" /> - <!-- - Convert - <pb_type><blif_model>XXX</blif_model></pb_type> - to - <pb_type blif_model="XXX"></pb_type> - --> - <xsl:template match="pb_type/blif_model"> - <xsl:attribute name="blif_model"><xsl:value-of select="text()"/></xsl:attribute> + <xsl:template match="pb_type"> + <xsl:copy> + <!-- + Convert + <pb_type><blif_model>XXX</blif_model></pb_type> + to + <pb_type blif_model="XXX"></pb_type> + --> + <xsl:if test="blif_model"> + <xsl:attribute name="blif_model"><xsl:value-of select="blif_model/text()"/></xsl:attribute> + </xsl:if> + <!-- + Convert + <pb_type><pb_class>XXX</pb_class></pb_type> + to + <pb_type class="XXX"></pb_type> + --> + <xsl:if test="pb_class"> + <xsl:attribute name="class"><xsl:value-of select="pb_class/text()"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates select="@*"/> + <xsl:apply-templates select="node()"/> + </xsl:copy> </xsl:template> - <!-- - Convert - <pb_type><pb_class>XXX</pb_class></pb_type> - to - <pb_type class="XXX"></pb_type> - --> - <xsl:template match="pb_type/pb_class"> - <xsl:attribute name="class"><xsl:value-of select="text()"/></xsl:attribute> - </xsl:template> + <xsl:template match="pb_type/blif_model"/> + <xsl:template match="pb_type/pb_class"/> </xsl:stylesheet>