diff options
author | Herbert Duerr <hdu@apache.org> | 2012-07-04 14:53:01 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-07-06 20:29:10 +0100 |
commit | dafedde5ada872bf1a9e6249d4e592fdcaf7ffcd (patch) | |
tree | c7cb745f4f2e90d3b8524d6dffcc8985c64dc1f3 /unoxml | |
parent | 94d4e9eb01522e546e69b5fca32875052776d6f8 (diff) |
use custom ExtEnt loader for RDF import
from: http://svn.apache.org/viewvc?view=revision&revision=1230438
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/source/rdf/librdf_repository.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 764fa6aa4c1e..733b3132e0c4 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -32,6 +32,7 @@ #include <boost/bind.hpp> #include <libxslt/security.h> +#include <libxml/parser.h> #include <redland.h> @@ -871,6 +872,11 @@ bool formatNeedsBaseURI(::sal_Int16 i_Format) return true; } +xmlParserInputPtr myExtEntityLoader( const char* /*URL*/, const char* /*ID*/, xmlParserCtxtPtr /*context*/) +{ + return NULL; +} + //void SAL_CALL uno::Reference<rdf::XNamedGraph> SAL_CALL librdf_Repository::importGraph(::sal_Int16 i_Format, @@ -948,6 +954,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, "librdf_new_parser failed", *this); } + xmlExternalEntityLoader oldExtEntityLoader = xmlGetExternalEntityLoader(); + xmlSetExternalEntityLoader( myExtEntityLoader); + uno::Sequence<sal_Int8> buf; uno::Reference<io::XSeekable> xSeekable(i_xInStream, uno::UNO_QUERY); // UGLY: if only that redland junk could read streams... @@ -972,6 +981,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, "librdf_Repository::importGraph: " "librdf_model_context_add_statements failed", *this); } + + xmlSetExternalEntityLoader( oldExtEntityLoader); return getGraph(i_xGraphName); } |