1

When I use XML with xsl stylesheet, Chrome, Edge shows blank page. When I remove the stylesheet information from the XML file, the data is shown in tree structure.

What setting do I need to change in Chrome so that when I double click on XML file, it shows the data formatted.

Note: XML and XSL are in the same folder.

My XML File

<?xml-stylesheet type="text/xsl" href="people.xsl"?>
<people>
    <husband employed="Yes">
        <name>Mark</name>
        <age>45</age>
        <wife>
            <wname>Janet</wname>
            <age>29</age>
        </wife>
    </husband>
    <husband employed="No">
        <name>Matt</name>
        <age>42</age>
        <wife>
            <wname>Annie</wname>
            <age>41</age>
        </wife>
    </husband>
</people> 

My XSL file

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    <xsl:template match="husband">
        <xsl:value-of select="name"/>
    </xsl:template>
</xsl:stylesheet>

I have installed Firefox also but it shows unformatted data.

Chrome Version : Version 122.0.6261.112 (Official Build) (64-bit)

Microsoft Edge Version: Version 122.0.2365.80 (Official build) (64-bit)

Firefox Version: 123.0.1 (64-bit)

I am on Windows 10 Pro

Shahid
  • 147

1 Answers1

1

Local references from XML to XSL style sheets are blocked by default in all browsers now. You may be able to overcome this security restriction locally by stopping all running Chrome processes and starting a new Chrome browser instance using the "--allow-file-access-from-files" flag.

Jeff
  • 111