2016-06-08 41 views
0

在创建RDF/XML,我得到一个错误:错误:“根元素之前的文档中的标记也必须是形成”

The markup in the document preceding the root element must be well-formed

有人可以请帮我这个错误?

<?xml version="1.0" encoding ="UTF-8"?> 
<"rdf:RDF"> 
"xmlns:g=“http://schema.org/gen” 
"xmlns:u=“http://schema.org/univ”> 
<rdf:Description about="http://thisisjohnsmith.org"> 
    <dc:Title> Personal Webpage </dc:Title> 
      <dc:Creator> John Smith </dc:Creator> 
</rdf:Description> 
<rdf:Person rdf:ID=“john”> 
    <g:name>John Smith</g:name> 
    <g:age>40</g:age> 
</rdf:Person> 
<rdf:Person rdf:ID=“peter”> 
    <g:name>Peter</g:name> 
</rdf:Person> 
<rdf:Lecturer rdf:ID=“john”> 
    <g:name>John Smith</g:name> 
</rdf:Lecturer> 
<rdf:Lecture rdf:ID=“john”> 
    <g:name>John Smith</g:name> 
    <g:status>crowded</g:status> 
    <g:student> 
    <g:name> Peter</g:name> 
    </g:student> 
</rdf:Lecture> 
</rdf:RDF> 
+1

有很多这里的问题;很多引号不属于他们。 “聪明”引号代替“哑”引号。等等如果你正在手动编写RDF,**不要**使用RDF/XML。像Turtle/N3这样的序列化要容易得多。 –

回答

0

有很多语法错误会阻止您的XML格式良好。

这是你的文件的清理后的副本现在合式:

<?xml version="1.0" encoding="UTF-8"?> 
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
     xmlns:dc="http://purl.org/dc/elements/1.1/" 
     xmlns:g="http://schema.org/gen"> 
    <rdf:Description rdf:about="http://thisisjohnsmith.org"> 
    <dc:Title> Personal Webpage </dc:Title> 
    <dc:Creator> John Smith </dc:Creator> 
    </rdf:Description> 
    <rdf:Person rdf:ID="john"> 
    <g:name>John Smith</g:name> 
    <g:age>40</g:age> 
    </rdf:Person> 
    <rdf:Person rdf:ID="peter"> 
    <g:name>Peter</g:name> 
    </rdf:Person> 
    <rdf:Lecturer rdf:ID="john"> 
    <g:name>John Smith</g:name> 
    </rdf:Lecturer> 
    <rdf:Lecture rdf:ID="john"> 
    <g:name>John Smith</g:name> 
    <g:status>crowded</g:status> 
    <g:student> 
     <g:name> Peter</g:name> 
    </g:student> 
    </rdf:Lecture> 
</rdf:RDF> 
+0

非常感谢! – bengalurean

相关问题