Jump to content
Jacek Laskowski

XMLDocument and popup windows

Recommended Posts

I need to validate an XML file that has references to XSD files, I use TXMLDocument for that. But during this validation, which is done in a thread, the MSXML bni library displays me a window asking for permission, it looks like this:

 

image.thumb.png.4f95aa4fd0ead23eedb97044e2cf843a.png

 

The message in english is: "This page is accessing information that is not under its control. This poses a security risk. Do you want to continue?"

 

Is it possible to confirm this question from the code level or disable the message?

And I know it is hidden in the internet options of the system, but I do not have access to clients' computers and I have to bypass it in the code.

Share this post


Link to post

You should post the code you use to validate the XML document. Build a minimal program which reproduce the error you get.

 

 

Share this post


Link to post

Code:

var
  lXML: IXMLDocument;
begin
  lXML := TXMLDocument.Create(nil);
  lXML.ParseOptions := [poResolveExternals, poValidateOnParse];
  lXML.LoadFromFile('test_.xml');

and test file for load:

<?xml version="1.0" encoding="UTF-8"?>
<tns:JPK xmlns:tns="http://jpk.mf.gov.pl/wzor/2017/11/13/1113/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:etd="http://crd.gov.pl/xml/schematy/dziedzinowe/mf/2016/01/25/eD/DefinicjeTypy/" xsi:schemaLocation="http://jpk.mf.gov.pl/wzor/2017/11/13/1113/ http://www.mf.gov.pl/documents/764034/6145258/Schemat_JPK_VAT%283%29_v1-1.xsd">
  <tns:Naglowek>
    <tns:KodFormularza kodSystemowy="JPK_VAT (3)" wersjaSchemy="1-1">JPK_VAT</tns:KodFormularza>
    <tns:WariantFormularza>3</tns:WariantFormularza>
    <tns:CelZlozenia>0</tns:CelZlozenia>
    <tns:DataWytworzeniaJPK>2020-07-23T12:49:30.000Z</tns:DataWytworzeniaJPK>
    <tns:DataOd>2020-06-01</tns:DataOd>
    <tns:DataDo>2020-06-30</tns:DataDo>
    <tns:NazwaSystemu>test</tns:NazwaSystemu>
  </tns:Naglowek>
</tns:JPK>

 

Share this post


Link to post

Using your code with Delphi 10.4.1 and your test file, I cannot reproduce the issue!

Maybe something else in your application? Try with a simple project with only one button and your code in the OnClick event.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×