Strabon

changeset 555:f67a9a3cb248

Changed HTML writer in order to answer queries where a variable is not bound. Addresses to ticket #13.
author stella
date Mon Sep 17 19:28:45 2012 +0300 (2012-09-17)
parents e3967795041b
children 28812d96cfa5
files resultio/src/main/java/org/openrdf/query/resultio/sparqlhtml/stSPARQLResultsHTMLWriter.java
line diff
     1.1 --- a/resultio/src/main/java/org/openrdf/query/resultio/sparqlhtml/stSPARQLResultsHTMLWriter.java	Sun Sep 16 22:41:09 2012 +0300
     1.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/sparqlhtml/stSPARQLResultsHTMLWriter.java	Mon Sep 17 19:28:45 2012 +0300
     1.3 @@ -109,11 +109,14 @@
     1.4  			xmlWriter.startTag(TABLE_ROW_TAG);
     1.5  			for (String bindingName : bindingNames) {
     1.6  				Binding binding = bindingSet.getBinding(bindingName);
     1.7 -				value.append(binding.getValue().stringValue());
     1.8 +				if(binding != null)
     1.9 +				{	
    1.10 +					value.append(binding.getValue().stringValue());
    1.11  				
    1.12 -				if (binding.getValue() instanceof BNode) {
    1.13 -					value.insert(0, "_:");
    1.14 -				}
    1.15 +					if (binding.getValue() instanceof BNode) {
    1.16 +						value.insert(0, "_:");
    1.17 +					}
    1.18 +				}	
    1.19  				xmlWriter.setAttribute(STYLE, TABLE_DATA_CLASS);
    1.20  				xmlWriter.textElement(TABLE_DATA_TAG, value.toString());
    1.21