Class: RDFObject::XMLParser
- Inherits:
-
Object
- Object
- RDFObject::XMLParser
- Defined in:
- lib/rdf_objects/parsers.rb
Class Method Summary collapse
Class Method Details
.parse(doc) ⇒ Object
131 132 133 134 135 136 137 138 139 |
# File 'lib/rdf_objects/parsers.rb', line 131 def self.parse(doc) xslt = Nokogiri::XSLT(open(File.dirname(__FILE__) + '/../xsl/rdf2nt.xsl')) xformed_doc = xslt.apply_to(doc) ntriples = xformed_doc.split("\n") if ntriples[0] =~ /^\<\?xml/ ntriples.delete_at(0) end return NTriplesParser.parse(ntriples) end |