Escaping control characters in SPARQL/XML or, why doesn't SPARQL/XML use XML 1.1?

Suppose I have a triple-store containing like

   <http://a> <http://b> "Hi \u001A is control-Z” .

What should the SPARQL/XML output be for this query:

    SELECT ?o { ?s ?p ?o } 

If I use Apache Jena 2.13.0 and ask for JSON, I get:

{
  "head": {
    "vars": [ "o" ]
  } ,
  "results": {
    "bindings": [
      {
        "o": { "type": "literal" , "value": "Hi \u001A is control-Z" }
      }
    ]
  }
}

Asking for XML, however, gives me:

<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="o"/>
  </head>
  <results>
    <result>
      <binding name="o">
        <literal>Hi  is control-Z</literal>
      </binding>
    </result>
  </results>
</sparql>

Where the control-Z character has disappeared. 

AFAIK, XML 1.0 cannot encode these control characters, whereas an XML 1.1 output could use &#x1a;. I also see that the RDF validator (http://www.w3.org/RDF/Validator/) is perfectly happy with the results whereas it seems as if it should not be?

thoughts?

thanks,
--
Gary Warren King, metabang.com 
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM * gwking on twitter

Received on Monday, 20 July 2015 19:29:56 UTC