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
121 122 123 124 125 126 127 128 129 |
# File 'lib/rdf_objects/parsers.rb', line 121 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 |