Blocked entity "%entity_file" whose target has a different protocol than the file where it was declared

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
ganem2
Posts: 20
Joined: Wed Jun 29, 2022 8:49 am

Blocked entity "%entity_file" whose target has a different protocol than the file where it was declared

Post by ganem2 »

Hi Team,
I am unable to open xml with <!ENTITY > markup in web author. below is the error I got on load.
Document could not be loaded
Details:
Blocked entity "%entity_file" whose target has a different protocol than the file where it was declared.
From network log in developer toolbar load request returned http 400 with Json response "{"type": "io_error","message":"Blocked entity \"%entity_file\" whose target has a different protocol than the file where it was declared."}"

Sample XML File.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xampex [
<!ENTITY % entity_file SYSTEM "http://localhost/jwblinks/schema/allchars-numeric.ent"> %entity_file;]>
<xampex source="WDA.TDIPHOQ.C12.F2657.Z.O" xmlns="http://localhost/legal/xampex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://localhost/legal/xampex http://localhost/legal/xampex/schema/xampex.tco.xsd">
    <cs>WL TRIALORDER</cs>
    <orgid>ARIZSUPER.C20153480.PIMA.002.LBLX055_TO.PDF</orgid>
    <tndx>GUID-38:0147.If7080f30186a11e7924d9f2715c3d365</tndx>
    <ct>McArthur v. Carondelet Health Network</ct>
    <note>OCR, Chrisian Inc., F662657</note>
    <lbl>Trial Order</lbl>
    <lblx>LBLX055</lblx>
    <st>AZ</st>
</xampex>
From oxygen logs also I could not find anything meaning full. please take a look at below log. hope this could be useful.
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.j - Detected indexes, psl 2, psc 1, el 3, ec 103
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.j - Before root <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xampex [
<!ENTITY % entity_file SYSTEM "http://localhost/jwblinks/schema/allchars-numeric.ent"> %entity_file;]>
<fakeRoot/>
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.j - Possible doctype <!DOCTYPE xampex [
<!ENTITY % entity_file SYSTEM "http://localhost/jwblinks/schema/allchars-numeric.ent"> %entity_file;]>
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.j - Extracted doctype <!DOCTYPE xampex [
<!ENTITY % entity_file SYSTEM "http://localhost/jwblinks/schema/allchars-numeric.ent"> %entity_file;]>
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.basic.xml.ProxyNamespaceMapping - Add proxy namespace mapping: '' - ''
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.catalogresolver.m - Resolve entity PUBLIC: null SYSTEM: http://localhost/jwblinks/schema/allchars-numeric.ent
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.catalogresolver.CatalogResolverFactory - resolver: ro.sync.xml.catalogresolver.f@4a24b65c
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.catalogresolver.f - Could not resolve PublicID: [null] SystemID: [http://localhost/jwblinks/schema/allchars-numeric.ent]
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.catalogresolver.m - resolved to: null
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.xml.catalogresolver.CatalogResolverFactory - resolve with editor manager null
2023-02-21 15:32:34,186 DEBUG [ http-nio-8205-exec-5 ] ro.sync.net.protocol.http.WebdavHttpURLConnection - Disconnecting


Please let know if I am missing something here while loading xml.
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: Blocked entity "%entity_file" whose target has a different protocol than the file where it was declared

Post by mihaela »

Hello,

There is an option called block.cross.protocol.system.entities [1] that, when it is set to true (the default), blocks the XML external entities if their target URL does not have the same protocol as the URL of the file where the entity is declared (from what I see in the logs your document is opened from a webdav server).
You can set the option to false [2] if you want to change this behavior.

[1] https://www.oxygenxml.com/doc/versions/ ... 2x_dzv_brb
[2] https://www.oxygenxml.com/doc/versions/ ... tions.html

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
ganem2
Posts: 20
Joined: Wed Jun 29, 2022 8:49 am

Re: Blocked entity "%entity_file" whose target has a different protocol than the file where it was declared

Post by ganem2 »

Hi Team,
Thanks for reply. Yes, this option resolved this issue.
Post Reply