Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

loading XML with stylesheet

Post Reply
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: loading XML with stylesheet

Post by salvadordf »

Hi,

TChromium.LoadString has some issues. Use the SchemeRegistrationBrowser demo.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: loading XML with stylesheet

Post by salvadordf »

Do NOT use TChromium.LoadString.

The SchemeRegistrationBrowser demo shows you how to register an scheme to load custom contents. Those contents can include other local and remote resources.

That demo registers the 'hello' scheme in the GlobalCEFApp.OnRegCustomSchemes event and calls CefRegisterSchemeHandlerFactory to use THelloScheme when the browser loads a URL with the 'hello' scheme.

The CEF3 code comments for GlobalCEFApp.OnRegCustomSchemes are here :
https://bitbucket.org/chromiumembedded/ ... ew-default

Code: Select all

  ///
  // Provides an opportunity to register custom schemes. Do not keep a reference
  // to the |registrar| object. This function is called on the main thread for
  // each process and the registered schemes should be the same across all
  // processes.
  ///
The CEF3 code comments for CefRegisterSchemeHandlerFactory are here :
https://bitbucket.org/chromiumembedded/ ... ew-default

Code: Select all

///
// Register a scheme handler factory with the global request context. An NULL
// |domain_name| value for a standard scheme will cause the factory to match all
// domain names. The |domain_name| value will be ignored for non-standard
// schemes. If |scheme_name| is a built-in scheme and no handler is returned by
// |factory| then the built-in scheme handler factory will be called. If
// |scheme_name| is a custom scheme then you must also implement the
// cef_app_t::on_register_custom_schemes() function in all processes. This
// function may be called multiple times to change or remove the factory that
// matches the specified |scheme_name| and optional |domain_name|. Returns false
// (0) if an error occurs. This function may be called on any thread in the
// browser process. Using this function is equivalent to calling cef_request_tCo
// ntext::cef_request_context_get_global_context()->register_scheme_handler_fact
// ory().
///
THelloScheme is a subclass of TCefResourceHandlerOwn and the CEF3 code comments for that class are here :
https://bitbucket.org/chromiumembedded/ ... ew-default
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: loading XML with stylesheet

Post by salvadordf »

I tried to find some XML/XSL samples but I couldn't find anything that works in the official CEF3 sample application using the 'file' scheme.

Can you post some simple XML/XSL files to do some tests?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: loading XML with stylesheet

Post by salvadordf »

I'm glad you solved it! :)

It shouldn't be necessary with a custom scheme but I think GlobalCefApp.DisableWebSecurity is what fixed your problem.
Post Reply