XML – Domains, protocols and ports do not match


I was trying to load an xml stylesheet called xsl and I kept getting the following errors:

on Chrome: Unsafe attempt to load URL chrome-extension: .xsl from frame with URL test.xml. Domains, protocols and ports must match.

on Firefox: Error loading stylesheet: An unknown error has occurred (805303f4)


Each browser has some security policies which do not allow access to different domains, protocols or ports are seen above.


Allow access using cross domain policy. There are two ways of doing so:

Create an xml file named crossdomain.xml and paste the following code:

<?xml version=”1.0″?>
<allow-access-from domain=”*” />

Open your current XML file and right after the root element paste the following:

<allow-access-from domain=”*” />

The second option should look like:

<?xml-stylesheet href=”styling.xsl” type=”text/xsl”?>


<allow-access-from domain=”*” />



<author> Ben </author>



<author> Ben </author>




<allow-access-from domain=”*” />

using the * means you will be giving access to all domains which is not suggested. If you have a specific domain specifiy as follows:

<allow-access-from domain=”www.mydomain.com” />

2 thoughts on “XML – Domains, protocols and ports do not match

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s