【发布时间】:2013-02-15 10:13:10
【问题描述】:
我有一个 Java sevlet,它创建了一个 RDF/XML-ABBREV 模型。我的问题是响应不包含 xml 版本标记。
目前的回应:
<rdf:RDF
xmlns:myNS="http://www.sap.de/research/BusinessObjectOntology#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<myNS:Resource rdf:about="http://localhost/myResource">
...
</myNS:Resource>
</rdf:RDF>
但我需要在模型开头使用 <?xml version="1.0"?>。
我是否必须在我的代码中添加一些内容,或者为什么 xml 版本标签不显示?
resp.setCharacterEncoding(CHARSET);
resp.setContentType("application/rdf+xml");
resp.setStatus(HttpStatus.OK_200);
model.write(resp.getWriter(), "RDF/XML-ABBREV");
谢谢
【问题讨论】: