日期:2014-05-17  浏览次数:20421 次

求高手救我
学校毕业项目有个地方的要求比较特殊,要生成一个特殊的xml文件,xml内容是这样的,请高手不吝写一段代码给我,谢谢了!!
<?xml version="1.0" encoding="GBK"?>
<rdf:RDF
  xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#"
  xmlns="http://www.owl-ontologies.com/Ontology1255345223.owl#"
  xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
  xmlns:swrl="http://www.w3.org/2003/11/swrl#"
  xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:owl="http://www.w3.org/2002/07/owl#"
  xml:base="http://www.owl-ontologies.com/Ontology1255345223.owl">
  <owl:Ontology rdf:about=""/>
  <owl:Class rdf:ID="类与对象的属性与行为">
  <rdfs:subClassOf>
  <owl:Class rdf:ID="接口与包的概念与其特性"/>
  </rdfs:subClassOf>
  </owl:Class>
  <owl:Class rdf:ID="Java类库的常用类和接口">
  <rdfs:subClassOf rdf:resource="#类与对象的属性与行为"/>
  </owl:Class>
  <owl:Class rdf:about="#接口与包的概念与其特性">
  <rdfs:subClassOf>
  <owl:Class rdf:ID="对象和类的概念"/>
  </rdfs:subClassOf>
  </owl:Class>
  <owl:Class rdf:about="#对象和类的概念">
  <rdfs:subClassOf>
  <owl:Restriction>
  <owl:onProperty>
  <owl:TransitiveProperty rdf:ID="相互区别知识"/>
  </owl:onProperty>
  <owl:allValuesFrom rdf:resource="#接口与包的概念与其特性"/>
  </owl:Restriction>
  </rdfs:subClassOf>
  <rdfs:subClassOf>
  <owl:Class rdf:ID="面向对象编程的基本概念和特征"/>
  </rdfs:subClassOf>
  </owl:Class>
  <owl:Class rdf:ID="类的继承关系与层次结构">
  <rdfs:subClassOf rdf:resource="#Java类库的常用类和接口"/>
  </owl:Class>
  <owl:TransitiveProperty rdf:about="#相互区别知识">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
  </owl:TransitiveProperty>
</rdf:RDF>


------解决方案--------------------
XML本身没什么特殊的,就是多了个XNamespace 而已
------解决方案--------------------
xml基本操作参考:http://blog.csdn.net/amandag/article/details/2623322