From bd3352847e96250a0b8de20450848f57fcd182e3 Mon Sep 17 00:00:00 2001
From: Raff Viglianti <raffaeleviglianti@gmail.com>
Date: Tue, 5 Nov 2024 11:09:53 -0500
Subject: [PATCH 1/4] passing rng declarations through to a JSON object as
 string literal

---
 odds/odd2json.xsl | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/odds/odd2json.xsl b/odds/odd2json.xsl
index f6e4c5edb..cf0b01165 100644
--- a/odds/odd2json.xsl
+++ b/odds/odd2json.xsl
@@ -4,6 +4,7 @@
     xmlns:math="http://www.w3.org/2005/xpath-functions/math"
     xmlns:tei="http://www.tei-c.org/ns/1.0"
     xmlns:j="http://www.w3.org/2005/xpath-functions"
+    xmlns:rng="http://relaxng.org/ns/structure/1.0"
     exclude-result-prefixes="xs math"
     version="3.0">
     
@@ -142,7 +143,7 @@
                 <xsl:sequence select="$source"/>
             </xsl:otherwise>
         </xsl:choose>
-    </xsl:function>    
+    </xsl:function>
     
     <xsl:function name="tei:getClassType" as="xs:string">
         <xsl:param name="context"/>
@@ -421,6 +422,13 @@
                             </xsl:for-each>
                         </j:array>
                     </xsl:when>
+                    <xsl:when test="self::rng:*">
+                        <!-- RNG elements are not converted to JSON, just serialized -->
+                        <j:string key="type">rng</j:string>
+                        <j:string key="rngContent">
+                            <xsl:value-of select="serialize(.)" />
+                        </j:string>
+                    </xsl:when>
                     <xsl:otherwise>
                         <j:string key="type"><xsl:value-of select="local-name()"/></j:string>
                     </xsl:otherwise>
@@ -498,7 +506,14 @@
                                     </xsl:when>
                                     <xsl:otherwise>1</xsl:otherwise>
                                 </xsl:choose>
-                            </j:string>                            
+                            </j:string>             
+                            <xsl:for-each select="rng:*">
+                                <!-- RNG elements are not converted to JSON, just serialized -->
+                                <j:string key="type">rng</j:string>
+                                <j:string key="rngContent">
+                                    <xsl:value-of select="serialize(.)" />
+                                </j:string>
+                            </xsl:for-each>
                             <xsl:for-each select="tei:dataRef">
                                 <j:map key="dataRef">
                                     <xsl:call-template name="getDataRef"/>

From d3c2d658ec778edfc07d59458f25955bb80138ba Mon Sep 17 00:00:00 2001
From: Raff Viglianti <raffaeleviglianti@gmail.com>
Date: Tue, 5 Nov 2024 11:40:00 -0500
Subject: [PATCH 2/4] updated test

---
 Test/expected-results/test33.json | 215 +++++++++++++++---------------
 1 file changed, 111 insertions(+), 104 deletions(-)

diff --git a/Test/expected-results/test33.json b/Test/expected-results/test33.json
index 95f5377f7..d6a84f2a7 100644
--- a/Test/expected-results/test33.json
+++ b/Test/expected-results/test33.json
@@ -1,122 +1,129 @@
 
-  { "title" : "Namespace Test",
-    "edition" : "",
-    "generator" : "odd2json3",
-    
-    "modules" : 
+{ "title" : "Namespace Test",
+"edition" : "",
+"generator" : "odd2json3",
+"date" : "2024-11-05T16:39:16Z",
+"modules" : 
+[  ],
+"moduleRefs" : 
+[ 
+  { "key" : "core",
+    "desc" : 
     [  ],
-    "moduleRefs" : 
+    "shortDesc" : "",
+    "gloss" : 
+    [  ] },
+  
+  { "key" : "header",
+    "desc" : 
+    [  ],
+    "shortDesc" : "",
+    "gloss" : 
+    [  ] },
+  
+  { "key" : "linking",
+    "desc" : 
+    [  ],
+    "shortDesc" : "",
+    "gloss" : 
+    [  ] },
+  
+  { "key" : "tei",
+    "desc" : 
+    [  ],
+    "shortDesc" : "",
+    "gloss" : 
+    [  ] },
+  
+  { "key" : "textstructure",
+    "desc" : 
+    [  ],
+    "shortDesc" : "",
+    "gloss" : 
+    [  ] } ],
+"elements" : 
+[ 
+  { "ident" : "cit",
+    "ns" : "http:\/\/foo.foo\/foo",
+    "type" : "elementSpec",
+    "module" : "",
+    "desc" : 
+    [ "<desc>\n            This element encodes a citation according to the foo standard.\n          <\/desc>" ],
+    "shortDesc" : "\n            This element encodes a citation according to the foo standard.\n          ",
+    "gloss" : 
+    [  ],
+    "altIdent" : 
+    [  ],
+    "classes" : 
+    { "model" : 
+      [ "model.quoteLike" ],
+      "atts" : 
+      [  ],
+      "unknown" : 
+      [  ] },
+    "attributes" : 
     [ 
-      { "key" : "core",
+      { "onElement" : true,
+        "ident" : "q",
+        "mode" : "add",
+        "ns" : "",
+        "usage" : "def",
         "desc" : 
         [  ],
         "shortDesc" : "",
         "gloss" : 
-        [  ] },
-      
-      { "key" : "header",
-        "desc" : 
         [  ],
-        "shortDesc" : "",
-        "gloss" : 
-        [  ] },
-      
-      { "key" : "linking",
-        "desc" : 
+        "altIdent" : 
         [  ],
-        "shortDesc" : "",
-        "gloss" : 
-        [  ] },
-      
-      { "key" : "tei",
-        "desc" : 
+        "valDesc" : 
         [  ],
-        "shortDesc" : "",
-        "gloss" : 
-        [  ] },
+        "datatype" : 
+        { "min" : "1",
+          "max" : "1",
+          "type" : "rng",
+          "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } },
       
-      { "key" : "textstructure",
+      { "onElement" : true,
+        "ident" : "r",
+        "mode" : "add",
+        "ns" : "http:\/\/blah.blah\/blah",
+        "usage" : "def",
         "desc" : 
         [  ],
         "shortDesc" : "",
         "gloss" : 
-        [  ] } ],
-    "elements" : 
-    [ 
-      { "ident" : "cit",
-        "ns" : "http:\/\/foo.foo\/foo",
-        "type" : "elementSpec",
-        "module" : "",
-        "desc" : 
-        [ "<desc>\n            This element encodes a citation according to the foo standard.\n          <\/desc>" ],
-        "shortDesc" : "\n            This element encodes a citation according to the foo standard.\n          ",
-        "gloss" : 
         [  ],
         "altIdent" : 
         [  ],
-        "classes" : 
-        { "model" : 
-          [ "model.quoteLike" ],
-          "atts" : 
-          [  ],
-          "unknown" : 
-          [  ] },
-        "attributes" : 
-        [ 
-          { "onElement" : true,
-            "ident" : "q",
-            "mode" : "add",
-            "ns" : "",
-            "usage" : "def",
-            "desc" : 
-            [  ],
-            "shortDesc" : "",
-            "gloss" : 
-            [  ],
-            "altIdent" : 
-            [  ],
-            "valDesc" : 
-            [  ],
-            "datatype" : 
-            { "min" : "1",
-              "max" : "1" } },
-          
-          { "onElement" : true,
-            "ident" : "r",
-            "mode" : "add",
-            "ns" : "http:\/\/blah.blah\/blah",
-            "usage" : "def",
-            "desc" : 
-            [  ],
-            "shortDesc" : "",
-            "gloss" : 
-            [  ],
-            "altIdent" : 
-            [  ],
-            "valDesc" : 
-            [  ],
-            "datatype" : 
-            { "min" : "1",
-              "max" : "1" } } ],
-        "content" : 
-        [ 
-          { "type" : "ref" },
-          
-          { "type" : "oneOrMore" },
-          
-          { "type" : "text" } ] } ],
-    "classes" : 
-    { "models" : 
-      [  ],
-      "attributes" : 
-      [  ] },
-    "elementRefs" : 
-    [  ],
-    "classRefs" : 
-    [  ],
-    "macros" : 
-    [  ],
-    "datatypes" : 
-    [  ],
-    "macroRefs" : 
-    [  ] }
\ No newline at end of file
+        "valDesc" : 
+        [  ],
+        "datatype" : 
+        { "min" : "1",
+          "max" : "1",
+          "type" : "rng",
+          "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } } ],
+    "content" : 
+    [ 
+      { "type" : "rng",
+        "rngContent" : "<rng:ref xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" name=\"ref\"\/>" },
+      
+      { "type" : "rng",
+        "rngContent" : "<rng:oneOrMore xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\">\n              <rng:ref name=\"macro.specialPara\"\/>\n            <\/rng:oneOrMore>" },
+      
+      { "type" : "rng",
+        "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } ] } ],
+"classes" : 
+{ "models" : 
+  [  ],
+  "attributes" : 
+  [  ] },
+"elementRefs" : 
+[  ],
+"classRefs" : 
+[  ],
+"macros" : 
+[  ],
+"datatypes" : 
+[  ],
+"macroRefs" : 
+[  ] }
\ No newline at end of file

From 1da5fbccc8822db7695fb4d0dc1a6178a2affb7c Mon Sep 17 00:00:00 2001
From: Raff Viglianti <raffaeleviglianti@gmail.com>
Date: Tue, 5 Nov 2024 11:57:20 -0500
Subject: [PATCH 3/4] updated test again

---
 Test/expected-results/test33.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Test/expected-results/test33.json b/Test/expected-results/test33.json
index d6a84f2a7..e651cd301 100644
--- a/Test/expected-results/test33.json
+++ b/Test/expected-results/test33.json
@@ -2,7 +2,7 @@
 { "title" : "Namespace Test",
 "edition" : "",
 "generator" : "odd2json3",
-"date" : "2024-11-05T16:39:16Z",
+
 "modules" : 
 [  ],
 "moduleRefs" : 

From 50473aa07aeb75190c4367e2efe836fced1e7ee7 Mon Sep 17 00:00:00 2001
From: Raff Viglianti <raffaeleviglianti@gmail.com>
Date: Tue, 5 Nov 2024 12:19:07 -0500
Subject: [PATCH 4/4] more test fixes

---
 Test/expected-results/test33.json          | 222 ++++++++++-----------
 Test/expected-results/test34.combined.json |  27 ++-
 Test/expected-results/test34.json          |  27 ++-
 3 files changed, 147 insertions(+), 129 deletions(-)

diff --git a/Test/expected-results/test33.json b/Test/expected-results/test33.json
index e651cd301..d57355f68 100644
--- a/Test/expected-results/test33.json
+++ b/Test/expected-results/test33.json
@@ -1,129 +1,129 @@
 
-{ "title" : "Namespace Test",
-"edition" : "",
-"generator" : "odd2json3",
-
-"modules" : 
-[  ],
-"moduleRefs" : 
-[ 
-  { "key" : "core",
-    "desc" : 
-    [  ],
-    "shortDesc" : "",
-    "gloss" : 
-    [  ] },
-  
-  { "key" : "header",
-    "desc" : 
-    [  ],
-    "shortDesc" : "",
-    "gloss" : 
-    [  ] },
-  
-  { "key" : "linking",
-    "desc" : 
-    [  ],
-    "shortDesc" : "",
-    "gloss" : 
-    [  ] },
-  
-  { "key" : "tei",
-    "desc" : 
-    [  ],
-    "shortDesc" : "",
-    "gloss" : 
-    [  ] },
-  
-  { "key" : "textstructure",
-    "desc" : 
+  { "title" : "Namespace Test",
+    "edition" : "",
+    "generator" : "odd2json3",
+    
+    "modules" : 
     [  ],
-    "shortDesc" : "",
-    "gloss" : 
-    [  ] } ],
-"elements" : 
-[ 
-  { "ident" : "cit",
-    "ns" : "http:\/\/foo.foo\/foo",
-    "type" : "elementSpec",
-    "module" : "",
-    "desc" : 
-    [ "<desc>\n            This element encodes a citation according to the foo standard.\n          <\/desc>" ],
-    "shortDesc" : "\n            This element encodes a citation according to the foo standard.\n          ",
-    "gloss" : 
-    [  ],
-    "altIdent" : 
-    [  ],
-    "classes" : 
-    { "model" : 
-      [ "model.quoteLike" ],
-      "atts" : 
-      [  ],
-      "unknown" : 
-      [  ] },
-    "attributes" : 
+    "moduleRefs" : 
     [ 
-      { "onElement" : true,
-        "ident" : "q",
-        "mode" : "add",
-        "ns" : "",
-        "usage" : "def",
+      { "key" : "core",
         "desc" : 
         [  ],
         "shortDesc" : "",
         "gloss" : 
+        [  ] },
+      
+      { "key" : "header",
+        "desc" : 
         [  ],
-        "altIdent" : 
+        "shortDesc" : "",
+        "gloss" : 
+        [  ] },
+      
+      { "key" : "linking",
+        "desc" : 
         [  ],
-        "valDesc" : 
+        "shortDesc" : "",
+        "gloss" : 
+        [  ] },
+      
+      { "key" : "tei",
+        "desc" : 
         [  ],
-        "datatype" : 
-        { "min" : "1",
-          "max" : "1",
-          "type" : "rng",
-          "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } },
+        "shortDesc" : "",
+        "gloss" : 
+        [  ] },
       
-      { "onElement" : true,
-        "ident" : "r",
-        "mode" : "add",
-        "ns" : "http:\/\/blah.blah\/blah",
-        "usage" : "def",
+      { "key" : "textstructure",
         "desc" : 
         [  ],
         "shortDesc" : "",
         "gloss" : 
+        [  ] } ],
+    "elements" : 
+    [ 
+      { "ident" : "cit",
+        "ns" : "http:\/\/foo.foo\/foo",
+        "type" : "elementSpec",
+        "module" : "",
+        "desc" : 
+        [ "<desc>\n            This element encodes a citation according to the foo standard.\n          <\/desc>" ],
+        "shortDesc" : "\n            This element encodes a citation according to the foo standard.\n          ",
+        "gloss" : 
         [  ],
         "altIdent" : 
         [  ],
-        "valDesc" : 
-        [  ],
-        "datatype" : 
-        { "min" : "1",
-          "max" : "1",
-          "type" : "rng",
-          "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } } ],
-    "content" : 
-    [ 
-      { "type" : "rng",
-        "rngContent" : "<rng:ref xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" name=\"ref\"\/>" },
-      
-      { "type" : "rng",
-        "rngContent" : "<rng:oneOrMore xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\">\n              <rng:ref name=\"macro.specialPara\"\/>\n            <\/rng:oneOrMore>" },
-      
-      { "type" : "rng",
-        "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } ] } ],
-"classes" : 
-{ "models" : 
-  [  ],
-  "attributes" : 
-  [  ] },
-"elementRefs" : 
-[  ],
-"classRefs" : 
-[  ],
-"macros" : 
-[  ],
-"datatypes" : 
-[  ],
-"macroRefs" : 
-[  ] }
\ No newline at end of file
+        "classes" : 
+        { "model" : 
+          [ "model.quoteLike" ],
+          "atts" : 
+          [  ],
+          "unknown" : 
+          [  ] },
+        "attributes" : 
+        [ 
+          { "onElement" : true,
+            "ident" : "q",
+            "mode" : "add",
+            "ns" : "",
+            "usage" : "def",
+            "desc" : 
+            [  ],
+            "shortDesc" : "",
+            "gloss" : 
+            [  ],
+            "altIdent" : 
+            [  ],
+            "valDesc" : 
+            [  ],
+            "datatype" : 
+            { "min" : "1",
+              "max" : "1",
+              "type" : "rng",
+              "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } },
+          
+          { "onElement" : true,
+            "ident" : "r",
+            "mode" : "add",
+            "ns" : "http:\/\/blah.blah\/blah",
+            "usage" : "def",
+            "desc" : 
+            [  ],
+            "shortDesc" : "",
+            "gloss" : 
+            [  ],
+            "altIdent" : 
+            [  ],
+            "valDesc" : 
+            [  ],
+            "datatype" : 
+            { "min" : "1",
+              "max" : "1",
+              "type" : "rng",
+              "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } } ],
+        "content" : 
+        [ 
+          { "type" : "rng",
+            "rngContent" : "<rng:ref xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" name=\"ref\"\/>" },
+          
+          { "type" : "rng",
+            "rngContent" : "<rng:oneOrMore xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\">\n              <rng:ref name=\"macro.specialPara\"\/>\n            <\/rng:oneOrMore>" },
+          
+          { "type" : "rng",
+            "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } ] } ],
+    "classes" : 
+    { "models" : 
+      [  ],
+      "attributes" : 
+      [  ] },
+    "elementRefs" : 
+    [  ],
+    "classRefs" : 
+    [  ],
+    "macros" : 
+    [  ],
+    "datatypes" : 
+    [  ],
+    "macroRefs" : 
+    [  ] }
\ No newline at end of file
diff --git a/Test/expected-results/test34.combined.json b/Test/expected-results/test34.combined.json
index 25c7122a3..d0401e420 100644
--- a/Test/expected-results/test34.combined.json
+++ b/Test/expected-results/test34.combined.json
@@ -2300,11 +2300,14 @@
         [  ],
         "content" : 
         [ 
-          { "type" : "ref" },
+          { "type" : "rng",
+            "rngContent" : "<ref xmlns=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\" name=\"ref\"\/>" },
           
-          { "type" : "oneOrMore" },
+          { "type" : "rng",
+            "rngContent" : "<oneOrMore xmlns=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\"><ref name=\"macro.specialPara\"\/><\/oneOrMore>" },
           
-          { "type" : "text" } ] },
+          { "type" : "rng",
+            "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\"\/>" } ] },
       
       { "ident" : "cit",
         "ns" : "http:\/\/blah.blah\/bar",
@@ -2328,11 +2331,14 @@
         [  ],
         "content" : 
         [ 
-          { "type" : "ref" },
+          { "type" : "rng",
+            "rngContent" : "<ref xmlns=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\" name=\"ref\"\/>" },
           
-          { "type" : "oneOrMore" },
+          { "type" : "rng",
+            "rngContent" : "<oneOrMore xmlns=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\"><ref name=\"macro.specialPara\"\/><\/oneOrMore>" },
           
-          { "type" : "text" } ] },
+          { "type" : "rng",
+            "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\"\/>" } ] },
       
       { "ident" : "citeData",
         "ns" : "http:\/\/foo.foo\/foo",
@@ -8983,11 +8989,14 @@
         [  ],
         "content" : 
         [ 
-          { "type" : "ref" },
+          { "type" : "rng",
+            "rngContent" : "<ref xmlns=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\" name=\"ref\"\/>" },
           
-          { "type" : "oneOrMore" },
+          { "type" : "rng",
+            "rngContent" : "<oneOrMore xmlns=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\"><ref name=\"macro.specialPara\"\/><\/oneOrMore>" },
           
-          { "type" : "text" } ] },
+          { "type" : "rng",
+            "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" xmlns:teix=\"http:\/\/www.tei-c.org\/ns\/Examples\"\/>" } ] },
       
       { "ident" : "quotation",
         "ns" : "http:\/\/foo.foo\/foo",
diff --git a/Test/expected-results/test34.json b/Test/expected-results/test34.json
index 1d4b206c1..be017f00e 100644
--- a/Test/expected-results/test34.json
+++ b/Test/expected-results/test34.json
@@ -65,11 +65,14 @@
         [  ],
         "content" : 
         [ 
-          { "type" : "ref" },
+          { "type" : "rng",
+            "rngContent" : "<rng:ref xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" name=\"ref\"\/>" },
           
-          { "type" : "oneOrMore" },
+          { "type" : "rng",
+            "rngContent" : "<rng:oneOrMore xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\">\n              <rng:ref name=\"macro.specialPara\"\/>\n            <\/rng:oneOrMore>" },
           
-          { "type" : "text" } ] },
+          { "type" : "rng",
+            "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } ] },
       
       { "ident" : "cit",
         "ns" : "http:\/\/blah.blah\/bar",
@@ -93,11 +96,14 @@
         [  ],
         "content" : 
         [ 
-          { "type" : "ref" },
+          { "type" : "rng",
+            "rngContent" : "<rng:ref xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" name=\"ref\"\/>" },
           
-          { "type" : "oneOrMore" },
+          { "type" : "rng",
+            "rngContent" : "<rng:oneOrMore xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\">\n              <rng:ref name=\"macro.specialPara\"\/>\n            <\/rng:oneOrMore>" },
           
-          { "type" : "text" } ] },
+          { "type" : "rng",
+            "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } ] },
       
       { "ident" : "q",
         "ns" : "http:\/\/blah.blah\/blah",
@@ -121,11 +127,14 @@
         [  ],
         "content" : 
         [ 
-          { "type" : "ref" },
+          { "type" : "rng",
+            "rngContent" : "<rng:ref xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\" name=\"ref\"\/>" },
           
-          { "type" : "oneOrMore" },
+          { "type" : "rng",
+            "rngContent" : "<rng:oneOrMore xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\">\n              <rng:ref name=\"macro.specialPara\"\/>\n            <\/rng:oneOrMore>" },
           
-          { "type" : "text" } ] } ],
+          { "type" : "rng",
+            "rngContent" : "<rng:text xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\" xmlns:bar=\"http:\/\/blah.blah\/bar\" xmlns:blah=\"http:\/\/blah.blah\/blah\" xmlns:rng=\"http:\/\/relaxng.org\/ns\/structure\/1.0\"\/>" } ] } ],
     "classes" : 
     { "models" : 
       [  ],