XML Tutorials - Herong's Tutorial Examples - v5.25, by Herong Yang
Web Browser Errors on Local XSL File
This section provides examples of Web browser errors on loading local XSL files from local XML documents. Newer versions of Chrome, Firefox and Safari consider this as security risks.
Old versions of Web browsers can be used as XML XSL processors to apply XSL transformations included in local XML documents and display transformed outputs.
But new versions of Web browsers restrict XML XSL processing functionalities for remote files with "http:" protocol only.
It is considered as security risks to perform XML XSL transformations on local files with "file:" protocol. If you try it, you will get errors.
So if you want to use Web browsers as XML XSL processors, you have to create a local Web server and move your XML documents and their XSL documents to the Web server to apply XSL transformations and view transformed results.
Google Chrome Error on Local XSL Files
If you open "hello_xsl.xml" in Google Chrome, you will see nothing in the output window.
But if you click "... > More Tools > Developer Tools" menu, you will see an error in the console:
Unsafe attempt to load URL file:///Users/herong/hello.xsl from frame with URL file:///Users/herong/hello_xsl.xml. 'file:' URLs are treated as unique security origins.
Mozilla Firefox Error on Local XSL Files
If you open "hello_xsl.xml" in Mozilla Firefox, you will see "Hello world!" in the output window.
But if you click "... > More Tools > Web Developer Tools" menu, you will see an error in the console:
Cross-Origin Request Blocked: The Same Origin Policy disallow reading the remote resource at file:///Users/herong/hello.xsl. (Reason: CORS request not http)
Apple Safari Error on Local XSL Files
If you open "hello_xsl.xml" in Apple Safari, you will see nothing in the output window.
But if you click "Develop > Open Source Code" menu, you will see an error in the console:
Unsafe attempt to load URL file:///Users/herong/hello.xsl from origin null. Domains, protocols and ports must match.
Table of Contents
Introduction of XML (eXtensible Markup Language)
DOM (Document Object Model) Programming Interface
SAX (Simple API for XML) Programming Interface
DTD (Document Type Definition) Introduction
Validating an XML Document against the Specified DTD Document Type
XSD (XML Schema Definition) Introduction
Validating XML Documents Against Specified XML Schemas
►XSL (Extensible Stylesheet Language) Introduction
What Is XSL (Extensible Stylesheet Language)
"Hello world!" Example of XSLT
►Web Browser Errors on Local XSL File
XSLT (XSL Transformations) Introduction
XSLT Elements as Programming Statements
Control and Generate XML Element in the Result
PHP Extensions for XML Manipulation
Processing XML with Python Scripts
XML Tools Plugin for Notepad++
XML Plugin Packages for Atom Editor