0

I am trying to format an xml file using xslt and css. When I open it in IE it displays the text within my tag. Chrome displays nothing, and firefox displays it correctly how I styled it.

Here is a clip of the xml I wish to style.

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="devices.xsl" ?>
<mpreader>
    <heading>Example</heading>
    <firmware>Firmware.134</firmware>
    <sn>123455</sn>
    <devices>
        <device id="01">
            <category>sim</category>
            <description>sim</description>
            <readable>yes</readable>
            <code size="00 18" crc="053F">test</code>
            <atr>4566</atr>

Here is my xsl file.

<xsl:template match="/">
    <html>
    <head>
    <style type="text/css">h1{color:red;}</style>
    </head>
    <body style="text-align:left;">
        <h1>
            <xsl:value-of select="mpreader/heading"/>
        </h1>
        <h1>
            <xsl:value-of select="mpreader/firmware"/>
        </h1>
        <h1>
            <xsl:value-of select="mpreader/sn"/>
        </h1>
        <h1>
        </h1>
        <div>
            <xsl:value-of select="mpreader/devices/device/category"/>
            <xsl:value-of select="mpreader/devices/device/description"/>
            <xsl:value-of select="mpreader/devices/device/readable"/>
            <xsl:value-of select="mpreader/devices/device/code"/>
            <xsl:value-of select="mpreader/devices/device/atr"/>
        </div>
    </body>
    </html>
</xsl:template> 

</xsl:stylesheet>

1 Answer 1

1

This is an issue directly related to Chrome security policy.

Can Chrome be made to perform an XSL transform on a local file?

Sign up to request clarification or add additional context in comments.

2 Comments

it is version 11 @ahkar5
Ok im not quite sure how but it seems to have fixed itself. It now displays just fine in internet explorer as well as firefox. Thank you for the information on chrome.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.