added some logic to xsltKeyFunction to set the transform context doc ptr
authorWilliam M. Brack <wbrack@src.gnome.org>
Tue, 13 Jul 2004 15:06:14 +0000 (15:06 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Tue, 13 Jul 2004 15:06:14 +0000 (15:06 +0000)
* libxslt/functions.c: added some logic to xsltKeyFunction
  to set the transform context doc ptr when the xpath context
  doc is different (bug 147445)
* tests/exslt/common/Makefile.am, tests/exslt/common/node-set.5*
  and tests/exslt/common/node-set.6*: added regression tests
  for bug 145547 (UNION and FILTER for RVT's)

ChangeLog
libxslt/functions.c
tests/exslt/common/Makefile.am
tests/exslt/common/node-set.5.out [new file with mode: 0644]
tests/exslt/common/node-set.5.xml [new file with mode: 0644]
tests/exslt/common/node-set.5.xsl [new file with mode: 0644]
tests/exslt/common/node-set.6.out [new file with mode: 0644]
tests/exslt/common/node-set.6.xml [new file with mode: 0644]
tests/exslt/common/node-set.6.xsl [new file with mode: 0644]

index 4bea36c..8b8f60e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Tue Jul 13 22:57:43 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/functions.c: added some logic to xsltKeyFunction
+         to set the transform context doc ptr when the xpath context
+         doc is different (bug 147445)
+       * tests/exslt/common/Makefile.am, tests/exslt/common/node-set.5*
+         and tests/exslt/common/node-set.6*: added regression tests
+         for bug 145547 (UNION and FILTER for RVT's)
+
 Mon Jul 12 08:28:07 HKT 2004 William Brack <wbrack@mmm.com.hk>
 
        * python/libxslt-python-api.xml: fixed type for doctypeSystem
index b068a1d..ad839cc 100644 (file)
@@ -348,7 +348,9 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
     xmlChar *key = NULL, *value;
     const xmlChar *keyURI;
     xsltTransformContextPtr tctxt;
-
+    xsltDocumentPtr oldDocumentPtr;
+    xmlDocPtr oldXPathDocPtr;
+    
     if (nargs != 2) {
        xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
                "key() : expects two arguments\n");
@@ -432,8 +434,19 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
        value = obj2->stringval;
 
        tctxt = xsltXPathGetTransformContext(ctxt);
-
+       oldDocumentPtr = tctxt->document;
+       oldXPathDocPtr = tctxt->xpathCtxt->doc;
+       if ((ctxt->context->doc != NULL) &&
+           (tctxt->document->doc != ctxt->context->doc)) {
+           tctxt->document = xsltFindDocument(tctxt, ctxt->context->doc);
+           if (tctxt->document == NULL)
+               tctxt->document = oldDocumentPtr;
+           else
+               tctxt->xpathCtxt->doc = ctxt->context->doc;
+       }
        nodelist = xsltGetKey(tctxt, key, keyURI, value);
+       tctxt->document = oldDocumentPtr;
+       tctxt->xpathCtxt->doc = oldXPathDocPtr;
        valuePush(ctxt, xmlXPathWrapNodeSet(
                        xmlXPathNodeSetMerge(NULL, nodelist)));
     }
index be7850c..7a1f612 100644 (file)
@@ -8,6 +8,8 @@ EXTRA_DIST =                                            \
        node-set.2.xml node-set.2.xsl node-set.2.out    \
        node-set.3.xml node-set.3.xsl node-set.3.out    \
        node-set.4.xml node-set.4.xsl node-set.4.out    \
+       node-set.5.xml node-set.5.xsl node-set.5.out    \
+       node-set.6.xml node-set.6.xsl node-set.6.out    \
        object-type.1.xml object-type.1.xsl object-type.1.out \
        import-test1a.imp import-test1b.imp import-test1.out \
        import-test1.xml import-test1.xsl
diff --git a/tests/exslt/common/node-set.5.out b/tests/exslt/common/node-set.5.out
new file mode 100644 (file)
index 0000000..6454ee6
--- /dev/null
@@ -0,0 +1,300 @@
+<?xml version="1.0"?>
+<document><metaproperties>
+       <source>Trudgill 1974:36</source>
+       <copyright/>
+       <title>Regional and caste differences in Kanarese</title>
+</metaproperties><horizontal><node heading="caste"><node heading="Brahmin">
+        <node heading="Dharwar"/><forms><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form></forms><node heading="Bangalore"/><forms><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form></forms>
+  </node><node heading="non-Brahmin">
+        <node heading="Dharwar"/><forms><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form></forms><node heading="Bangalore"/><forms><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form></forms>
+  </node></node></horizontal><vertical>
+        <node heading="'it is'"/><forms><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form></forms><node heading="'inside'"/><forms><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form></forms><node heading="infinitive affix"/><forms><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form></forms><node heading="participle affix"/><forms><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form></forms><node heading="'sit'"/><forms><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form></forms><node heading="reflexive"/><forms><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form></forms>
+  </vertical><cells>
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               
+                               a
+                               </cells></document>
diff --git a/tests/exslt/common/node-set.5.xml b/tests/exslt/common/node-set.5.xml
new file mode 100644 (file)
index 0000000..3f0fee5
--- /dev/null
@@ -0,0 +1,210 @@
+<?xml version="1.0"?>
+<document><metaproperties>
+       <source>Trudgill 1974:36</source>
+       <copyright/>
+       <title>Regional and caste differences in Kanarese</title>
+</metaproperties>
+
+
+<operator-stack>
+  <operator opcode="tabular" instruction="1">
+        <operand type="branch" arg="1">2</operand>
+        <operand type="branch" arg="2">4</operand>
+        <operand type="domain" arg="3">content</operand>
+  </operator>
+  <operator opcode="hierarchical" instruction="2">
+        <operand type="domain" arg="1">caste</operand>
+        <operand type="branch" arg="2">3</operand>
+  </operator>
+  <operator opcode="lookup" instruction="3">
+        <operand type="domain" arg="1">town</operand>
+  </operator>
+  <operator opcode="lookup" instruction="4">
+        <operand type="domain" arg="1">morpheme</operand>
+  </operator>
+</operator-stack>
+
+<attributes>
+  <name name="caste">
+    <value value="Brahmin"/>
+    <value value="non-Brahmin"/>
+  </name>
+  <name name="town">
+    <value value="Dharwar"/>
+    <value value="Bangalore"/>
+  </name>
+  <name name="morpheme">
+    <value value="'it is'"/>
+    <value value="'inside'"/>
+    <value value="infinitive affix"/>
+    <value value="participle affix"/>
+    <value value="'sit'"/>
+    <value value="reflexive"/>
+  </name>
+  <name name="content">
+    <value value="-a"/>
+    <value value="-aga"/>
+    <value value="-ak"/>
+    <value value="-alli"/>
+    <value value="-likke"/>
+    <value value="-o"/>
+    <value value="-ok"/>
+    <value value="-olage"/>
+    <value value="ayti"/>
+    <value value="ede"/>
+    <value value="ide"/>
+    <value value="ko"/>
+    <value value="kont-"/>
+    <value value="kunt-"/>
+    <value value="kut-"/> 
+  </name>
+</attributes>
+
+<paradigm>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form>
+  
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form>  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form>  
+
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form>
+  
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form>    
+</paradigm></document>
diff --git a/tests/exslt/common/node-set.5.xsl b/tests/exslt/common/node-set.5.xsl
new file mode 100644 (file)
index 0000000..f3a2393
--- /dev/null
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0" xmlns:exslt="http://exslt.org/common">
+
+
+       <xsl:output method="xml"/>
+  
+       <xsl:template match="document">
+               <xsl:element name="document">
+                       <xsl:copy-of select="/document/metaproperties"/>
+                       <xsl:apply-templates select="/document/operator-stack/operator[@instruction=1]">
+                               <xsl:with-param name="selection-criteria">
+                                       <xsl:copy-of select="/document/paradigm"/>
+                               </xsl:with-param>
+                       </xsl:apply-templates>
+               </xsl:element>
+       </xsl:template>
+       
+       <xsl:template match="operand[@type='domain']">
+               <xsl:param name="selection-criteria"/>
+               <xsl:variable name="butterfly"><xsl:value-of select="."/></xsl:variable>
+               <xsl:for-each select="/document/attributes/name[@name=$butterfly]/value">
+                       <xsl:variable name="koala"><xsl:value-of select="@value"/></xsl:variable>
+                       <xsl:variable name="pidgeon">
+                               <xsl:element name="paradigm">
+                                       <xsl:copy-of select="exslt:node-set($selection-criteria)/paradigm/form[./attribute[@name=$butterfly and @value=$koala]]"/>
+                               </xsl:element>
+                       </xsl:variable>
+                       <xsl:if test="count(exslt:node-set($selection-criteria)/paradigm/form[./attribute[@name=$butterfly and @value=$koala]]) &gt; 0">
+                               <xsl:element name="node">
+                                       <xsl:attribute name="heading"><xsl:value-of select="@value"/></xsl:attribute>
+                               </xsl:element>
+                               <xsl:element name="forms">
+                                       <xsl:copy-of select="exslt:node-set($pidgeon)/paradigm/form"/>
+                               </xsl:element>
+                       </xsl:if>       
+               </xsl:for-each>         
+       </xsl:template>
+       
+       <xsl:template match="operand[@type='branch']">
+               <xsl:param name="selection-criteria"/>
+               <xsl:variable name="catapilla"><xsl:value-of select="."/></xsl:variable>
+               <xsl:apply-templates select="/document/operator-stack/operator[@instruction=$catapilla]">
+                       <xsl:with-param name="selection-criteria">
+                               <xsl:copy-of select="$selection-criteria"/>
+                       </xsl:with-param>
+               </xsl:apply-templates>  
+       </xsl:template>
+
+       <xsl:template match="operator[@opcode='tabular']">
+               <xsl:param name="selection-criteria"/>
+               
+               <xsl:variable name="horizontal">
+                       <xsl:apply-templates select="operand[@arg='1']">
+                               <xsl:with-param name="selection-criteria">
+                                       <xsl:copy-of select="$selection-criteria"/>
+                               </xsl:with-param>
+                       </xsl:apply-templates>  
+               </xsl:variable>
+               
+               <xsl:variable name="vertical">
+                       <xsl:apply-templates select="operand[@arg='2']">
+                               <xsl:with-param name="selection-criteria">
+                                       <xsl:copy-of select="$selection-criteria"/>
+                               </xsl:with-param>
+                       </xsl:apply-templates>  
+               </xsl:variable>
+               
+                       
+               <xsl:element name="horizontal">
+                       <xsl:copy-of select="$horizontal"/>
+               </xsl:element>
+       
+               <xsl:element name="vertical">
+                       <xsl:copy-of select="$vertical"/>
+               </xsl:element>
+               
+               <xsl:element name="cells">
+                       <xsl:for-each select="exslt:node-set($horizontal)//forms">
+                               <xsl:variable name="horizontal-forms">
+                                       <xsl:copy-of select="form"/>
+                               </xsl:variable>
+                               <xsl:for-each select="exslt:node-set($vertical)//forms">
+                                       <xsl:variable name="vertical-forms">
+                                               <xsl:copy-of select="form"/>
+                                       </xsl:variable>
+                                       <xsl:variable name="pidgeon">
+                                               <xsl:element name="paradigm">
+                                                       <xsl:copy-of select="exslt:node-set($horizontal-forms)[./form = exslt:node-set($vertical-forms)/form]"/>
+                                               </xsl:element>
+                                       </xsl:variable>
+                               a
+                               <!--
+                                       <xsl:copy-of select="pidgeon"/>
+                               -->
+                               </xsl:for-each>
+                       </xsl:for-each>
+               </xsl:element>
+               
+       </xsl:template>
+       
+       <xsl:template match="operator[@opcode='hierarchical']">
+               <xsl:param name="selection-criteria"/>
+               <xsl:variable name="horse"><xsl:value-of select="@instruction"/></xsl:variable>
+               <xsl:element name="node">
+                       <xsl:attribute name="heading"><xsl:value-of select="operand[@arg='1']"/></xsl:attribute>
+                       <xsl:variable name="grub"><xsl:value-of select="operand[@arg='1']"/></xsl:variable>
+                       
+                       <xsl:for-each select="/document/attributes/name[@name=$grub]/value">
+                               <xsl:variable name="koala"><xsl:value-of select="@value"/></xsl:variable>
+                               <xsl:variable name="pidgeon">
+                                       <xsl:element name="paradigm">
+                                               <xsl:copy-of select="exslt:node-set($selection-criteria)/paradigm/form[./attribute[@name=$grub and @value=$koala]]"/>
+                                       </xsl:element>
+                               </xsl:variable>
+                               
+                               <xsl:if test="count(exslt:node-set($selection-criteria)/paradigm/form[./attribute[@name=$grub and @value=$koala]]) &gt; 0">
+                                       <xsl:element name="node">
+                                               <xsl:attribute name="heading"><xsl:value-of select="@value"/></xsl:attribute>
+                                               <xsl:apply-templates select="/document/operator-stack/operator[@instruction=$horse]/operand[@arg='2']">
+                                                       <xsl:with-param name="selection-criteria">
+                                                               <xsl:copy-of select="$pidgeon"/>
+                                                       </xsl:with-param>
+                                               </xsl:apply-templates>  
+                                       </xsl:element>
+                               </xsl:if>
+                       </xsl:for-each> 
+                       
+               </xsl:element>
+       </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/common/node-set.6.out b/tests/exslt/common/node-set.6.out
new file mode 100644 (file)
index 0000000..b8073a4
--- /dev/null
@@ -0,0 +1,1206 @@
+<?xml version="1.0"?>
+<document><metaproperties>
+       <source>Trudgill 1974:36</source>
+       <copyright/>
+       <title>Regional and caste differences in Kanarese</title>
+</metaproperties><cells><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><paradigm/><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form><paradigm/></cells></document>
diff --git a/tests/exslt/common/node-set.6.xml b/tests/exslt/common/node-set.6.xml
new file mode 100644 (file)
index 0000000..3f0fee5
--- /dev/null
@@ -0,0 +1,210 @@
+<?xml version="1.0"?>
+<document><metaproperties>
+       <source>Trudgill 1974:36</source>
+       <copyright/>
+       <title>Regional and caste differences in Kanarese</title>
+</metaproperties>
+
+
+<operator-stack>
+  <operator opcode="tabular" instruction="1">
+        <operand type="branch" arg="1">2</operand>
+        <operand type="branch" arg="2">4</operand>
+        <operand type="domain" arg="3">content</operand>
+  </operator>
+  <operator opcode="hierarchical" instruction="2">
+        <operand type="domain" arg="1">caste</operand>
+        <operand type="branch" arg="2">3</operand>
+  </operator>
+  <operator opcode="lookup" instruction="3">
+        <operand type="domain" arg="1">town</operand>
+  </operator>
+  <operator opcode="lookup" instruction="4">
+        <operand type="domain" arg="1">morpheme</operand>
+  </operator>
+</operator-stack>
+
+<attributes>
+  <name name="caste">
+    <value value="Brahmin"/>
+    <value value="non-Brahmin"/>
+  </name>
+  <name name="town">
+    <value value="Dharwar"/>
+    <value value="Bangalore"/>
+  </name>
+  <name name="morpheme">
+    <value value="'it is'"/>
+    <value value="'inside'"/>
+    <value value="infinitive affix"/>
+    <value value="participle affix"/>
+    <value value="'sit'"/>
+    <value value="reflexive"/>
+  </name>
+  <name name="content">
+    <value value="-a"/>
+    <value value="-aga"/>
+    <value value="-ak"/>
+    <value value="-alli"/>
+    <value value="-likke"/>
+    <value value="-o"/>
+    <value value="-ok"/>
+    <value value="-olage"/>
+    <value value="ayti"/>
+    <value value="ede"/>
+    <value value="ide"/>
+    <value value="ko"/>
+    <value value="kont-"/>
+    <value value="kunt-"/>
+    <value value="kut-"/> 
+  </name>
+</attributes>
+
+<paradigm>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ede"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-olage"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-likke"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form>
+  
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ide"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-alli"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ok"/>
+  </form>  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-o"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kut-"/>
+  </form>
+  <form>
+    <attribute name="caste" value="Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="ko"/>
+  </form>  
+
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Dharwar"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form>
+  
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'it is'"/>    
+    <attribute name="content" value="ayti"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'inside'"/>    
+    <attribute name="content" value="-aga"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="infinitive affix"/>    
+    <attribute name="content" value="-ak"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="participle affix"/>    
+    <attribute name="content" value="-a"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="'sit'"/>    
+    <attribute name="content" value="kunt-"/>
+  </form>
+  <form>
+    <attribute name="caste" value="non-Brahmin"/>
+    <attribute name="town" value="Bangalore"/>
+    <attribute name="morpheme" value="reflexive"/>    
+    <attribute name="content" value="kont-"/>
+  </form>    
+</paradigm></document>
diff --git a/tests/exslt/common/node-set.6.xsl b/tests/exslt/common/node-set.6.xsl
new file mode 100644 (file)
index 0000000..a0ace66
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 
+                                        xmlns:exslt="http://exslt.org/common"
+                                        xmlns:set="http://exslt.org/sets"
+                extension-element-prefixes="set">
+
+
+       <xsl:output method="xml"/>
+  
+       <xsl:template match="document">
+               <xsl:element name="document">
+                       <xsl:copy-of select="/document/metaproperties"/>
+                       <xsl:apply-templates select="/document/operator-stack/operator[@instruction=1]">
+                               <xsl:with-param name="selection-criteria">
+                                       <xsl:copy-of select="/document/paradigm"/>
+                               </xsl:with-param>
+                       </xsl:apply-templates>
+               </xsl:element>
+       </xsl:template>
+       
+       <xsl:template match="operand[@type='domain']">
+               <xsl:param name="selection-criteria"/>
+               <xsl:variable name="butterfly"><xsl:value-of select="."/></xsl:variable>
+               <xsl:for-each select="/document/attributes/name[@name=$butterfly]/value">
+                       <xsl:variable name="koala"><xsl:value-of select="@value"/></xsl:variable>
+                       <xsl:variable name="pidgeon">
+                               <xsl:element name="paradigm">
+                                       <xsl:copy-of select="exslt:node-set($selection-criteria)/paradigm/form[./attribute[@name=$butterfly and @value=$koala]]"/>
+                               </xsl:element>
+                       </xsl:variable>
+                       <xsl:if test="count(exslt:node-set($selection-criteria)/paradigm/form[./attribute[@name=$butterfly and @value=$koala]]) &gt; 0">
+                               <xsl:element name="node">
+                                       <xsl:attribute name="heading"><xsl:value-of select="@value"/></xsl:attribute>
+                               </xsl:element>
+                               <xsl:element name="forms">
+                                       <xsl:copy-of select="exslt:node-set($pidgeon)/paradigm/form"/>
+                               </xsl:element>
+                       </xsl:if>       
+               </xsl:for-each>         
+       </xsl:template>
+       
+       <xsl:template match="operand[@type='branch']">
+               <xsl:param name="selection-criteria"/>
+               <xsl:variable name="catapilla"><xsl:value-of select="."/></xsl:variable>
+               <xsl:apply-templates select="/document/operator-stack/operator[@instruction=$catapilla]">
+                       <xsl:with-param name="selection-criteria">
+                               <xsl:copy-of select="$selection-criteria"/>
+                       </xsl:with-param>
+               </xsl:apply-templates>  
+       </xsl:template>
+
+       <xsl:template match="operator[@opcode='tabular']">
+               <xsl:param name="selection-criteria"/>
+               
+               <xsl:variable name="horizontal">
+                       <xsl:apply-templates select="operand[@arg='1']">
+                               <xsl:with-param name="selection-criteria">
+                                       <xsl:copy-of select="$selection-criteria"/>
+                               </xsl:with-param>
+                       </xsl:apply-templates>  
+               </xsl:variable>
+               
+               <xsl:variable name="vertical">
+                       <xsl:apply-templates select="operand[@arg='2']">
+                               <xsl:with-param name="selection-criteria">
+                                       <xsl:copy-of select="$selection-criteria"/>
+                               </xsl:with-param>
+                       </xsl:apply-templates>  
+               </xsl:variable>
+               
+               <!--    
+               <xsl:element name="horizontal">
+                       <xsl:copy-of select="$horizontal"/>
+               </xsl:element>
+       
+               <xsl:element name="vertical">
+                       <xsl:copy-of select="$vertical"/>
+               </xsl:element>
+               -->
+
+               <xsl:element name="cells">
+                       <xsl:for-each select="exslt:node-set($horizontal)//forms">
+                               <xsl:variable name="horizontal-forms">
+                                       <xsl:copy-of select="./form"/>
+                               </xsl:variable>
+                               
+                               <xsl:for-each select="exslt:node-set($vertical)//forms">
+                                       <xsl:variable name="vertical-forms">
+                                               <xsl:copy-of select="./form"/>
+                                       </xsl:variable>
+                                       <xsl:copy-of select="exslt:node-set($horizontal-forms)/form | exslt:node-set($vertical-forms)/form"/>
+                                       <xsl:variable name="pidgeon">
+                                               <xsl:element name="paradigm">
+                                                       <!--<xsl:copy-of select="$horizontal-forms[count(.|$vertical-forms)=count($vertical-forms)]"/>-->
+                                                       <!--<xsl:copy-of select="set:intersection($horizontal-forms, $vertical-forms)"/>-->
+                                                       <!--
+                                                       <xsl:call-template name="set:intersection">
+                                                          <xsl:with-param name="nodes1" select="$horizontal-forms" />
+                                                               <xsl:with-param name="nodes2" select="$vertical-forms" />
+                                                       </xsl:call-template>
+                                                       -->
+                                               </xsl:element>
+                                       </xsl:variable>
+                                       <xsl:copy-of select="$pidgeon"/>
+                               </xsl:for-each>
+                       </xsl:for-each>
+               </xsl:element>
+               
+       </xsl:template>
+       
+       <xsl:template match="operator[@opcode='hierarchical']">
+               <xsl:param name="selection-criteria"/>
+               <xsl:variable name="horse"><xsl:value-of select="@instruction"/></xsl:variable>
+               <xsl:element name="node">
+                       <xsl:attribute name="heading"><xsl:value-of select="operand[@arg='1']"/></xsl:attribute>
+                       <xsl:variable name="grub"><xsl:value-of select="operand[@arg='1']"/></xsl:variable>
+                       
+                       <xsl:for-each select="/document/attributes/name[@name=$grub]/value">
+                               <xsl:variable name="koala"><xsl:value-of select="@value"/></xsl:variable>
+                               <xsl:variable name="pidgeon">
+                                       <xsl:element name="paradigm">
+                                               <xsl:copy-of select="exslt:node-set($selection-criteria)/paradigm/form[./attribute[@name=$grub and @value=$koala]]"/>
+                                       </xsl:element>
+                               </xsl:variable>
+                               
+                               <xsl:if test="count(exslt:node-set($selection-criteria)/paradigm/form[./attribute[@name=$grub and @value=$koala]]) &gt; 0">
+                                       <xsl:element name="node">
+                                               <xsl:attribute name="heading"><xsl:value-of select="@value"/></xsl:attribute>
+                                               <xsl:apply-templates select="/document/operator-stack/operator[@instruction=$horse]/operand[@arg='2']">
+                                                       <xsl:with-param name="selection-criteria">
+                                                               <xsl:copy-of select="$pidgeon"/>
+                                                       </xsl:with-param>
+                                               </xsl:apply-templates>  
+                                       </xsl:element>
+                               </xsl:if>
+                       </xsl:for-each> 
+                       
+               </xsl:element>
+       </xsl:template>
+
+</xsl:stylesheet>
+