xml: Make pb_type attributes work in composition.

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32063e2..ec3c04a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,9 @@
 xsl_golden_test(NAME "composable-interconnect-implicit-parent")
 xsl_golden_test(NAME "composable-interconnect-pack_patterns")
 xsl_golden_test(NAME "composable-loc-implicit-parent")
+add_file_target(FILE "composable-pb_type-inner.xml" SCANNER_TYPE xml)
+add_file_target(FILE "composable-pb_type-middle.xml" SCANNER_TYPE xml)
+xsl_golden_test(NAME "composable-pb_type")
 xsl_golden_test(NAME "explicit-port")
 xsl_golden_test(NAME "pack_pattern-copy-direct-ports")
 xsl_golden_test(NAME "pack_pattern-merge-type-into-name")
diff --git a/composable-pb_type-inner.xml b/composable-pb_type-inner.xml
new file mode 100644
index 0000000..6d1d5b5
--- /dev/null
+++ b/composable-pb_type-inner.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<pb_type name="INNER" other_attribute="r">
+  <blif_model>.subckt random</blif_model>
+  <pb_class>lut</pb_class>
+  <other_tag/>
+</pb_type>
diff --git a/composable-pb_type-middle.xml b/composable-pb_type-middle.xml
new file mode 100644
index 0000000..d4f1f66
--- /dev/null
+++ b/composable-pb_type-middle.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<pb_type name="MIDDLE" xmlns:xi="http://www.w3.org/2001/XInclude">
+  <pb_type name="middle_inner" num_pb="1">
+    <xi:include href="composable-pb_type-inner.xml" xpointer="xpointer(pb_type/child::node())"/>
+  </pb_type>
+</pb_type>
diff --git a/composable-pb_type.golden.xml b/composable-pb_type.golden.xml
new file mode 100644
index 0000000..a128b5c
--- /dev/null
+++ b/composable-pb_type.golden.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<pb_type xmlns:xi="http://www.w3.org/2001/XInclude" name="top" num_pb="1">
+  <pb_type blif_model=".subckt random" class="lut" name="top_inner" num_pb="1">
+    <other_tag/>
+  </pb_type>
+  <pb_type name="middle" num_pb="1">
+    <pb_type blif_model=".subckt random" class="lut" name="middle_inner" num_pb="1">
+      <other_tag/>
+    </pb_type>
+  </pb_type>
+</pb_type>
diff --git a/composable-pb_type.xml b/composable-pb_type.xml
new file mode 100644
index 0000000..ede3b86
--- /dev/null
+++ b/composable-pb_type.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" ?>
+<pb_type name="top" num_pb="1" xmlns:xi="http://www.w3.org/2001/XInclude">
+  <pb_type name="top_inner" num_pb="1" >
+    <xi:include href="composable-pb_type-inner.xml" xpointer="xpointer(pb_type/child::node())"/>
+  </pb_type>
+  <pb_type name="middle" num_pb="1">
+    <xi:include href="composable-pb_type-middle.xml" xpointer="xpointer(pb_type/child::node())"/>
+  </pb_type>
+</pb_type>
diff --git a/full-test-inner.xml b/full-test-inner.xml
index 1c5ea86..575ddac 100644
--- a/full-test-inner.xml
+++ b/full-test-inner.xml
@@ -1,4 +1,5 @@
-<pb_type xmlns:xi="http://www.w3.org/2001/XInclude" name="ADDER" blif_model=".subckt adder" num_pb="1">
+<pb_type xmlns:xi="http://www.w3.org/2001/XInclude" name="ADDER" num_pb="1">
+  <blif_model>.subckt adder</blif_model>
   <input name="a" num_pins="1"/>
   <input name="b" num_pins="1"/>
   <input name="cin" num_pins="1"/>
diff --git a/full-test.xml b/full-test.xml
index ca3ef54..c5a31ef 100644
--- a/full-test.xml
+++ b/full-test.xml
@@ -7,10 +7,10 @@
   <input name="d" num_pins="4"/>
   <output name="cout" num_pins="1"/>
   <output name="sum" num_pins="8"/>
-  <pb_type blif_model=".subckt adder" name="comba" num_pb="4">
+  <pb_type name="comba" num_pb="4">
     <xi:include href="full-test-inner.xml" xpointer="xpointer(pb_type/child::node())"/>
   </pb_type>
-  <pb_type blif_model=".subckt adder" name="combb" num_pb="4">
+  <pb_type name="combb" num_pb="4">
     <xi:include href="full-test-inner.xml" xpointer="xpointer(pb_type/child::node())"/>
   </pb_type>
   <interconnect>