rdftemplate

Library for generating XML documents from RDF data using templates
git clone https://code.djc.id.au/git/rdftemplate/
commit 47000e7b3810ad6b8c3fdecfcc18a1786bac2823
parent baa52718bdb343980370b95a1185ffccae2681fc
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sun, 11 Oct 2009 18:01:49 +1000

mostly complete journal and author HTML templates; representations framework for RDF

Diffstat:
Msrc/main/java/au/com/miskinhill/rdftemplate/TemplateInterpolator.java | 8++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/main/java/au/com/miskinhill/rdftemplate/TemplateInterpolator.java b/src/main/java/au/com/miskinhill/rdftemplate/TemplateInterpolator.java
@@ -268,10 +268,8 @@ public class TemplateInterpolator {
                 } else {
                     throw new UnsupportedOperationException("Not a literal: " + replacementNode);
                 }
-            } else if (replacement instanceof String) {
-                replacementValue = (String) replacement;
             } else {
-                throw new UnsupportedOperationException("Not an RDFNode: " + replacement);
+                replacementValue = replacement.toString();
             }
             
             matcher.appendReplacement(substituted, replacementValue.replace("$", "\\$"));
@@ -312,14 +310,12 @@ public class TemplateInterpolator {
             } else {
                 throw new UnsupportedOperationException("Not a literal: " + replacementNode);
             }
-        } else if (replacement instanceof String) {
-            writer.add(eventFactory.createCharacters((String) replacement));
         } else if (replacement instanceof XMLStream) {
             for (XMLEvent event: (XMLStream) replacement) {
                 writer.add(event);
             }
         } else {
-            throw new UnsupportedOperationException("Not an RDFNode: " + replacement);
+            writer.add(eventFactory.createCharacters(replacement.toString()));
         }
     }