Results 1 to 4 of 4

Thread: XML display problem in FireFox?

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    XML display problem in FireFox?

    Is this a problem with firefox?

    The following XML file (formatted with XSL) shows up properly in IE, but not in FF:

    http://www.w3schools.com/xml/simplexsl.xml

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    This is the page I got it from:
    http://www.w3schools.com/xml/xml_xsl.asp

    Or perhaps this is something proprietary in IE?

  3. #3
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    It doesn't work properly in Opera either.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  4. #4
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Try this as the simple.xsl:

    Code:
    <?xml version="1.0" encoding="utf-8"?> 
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="html" version="4.01" encoding="utf-8" />
      <xsl:template match="/">
      <html>
      <head>
      <title>Transformation!</title>
      </head>
      <body style="font-family:Arial,helvetica,sans-serif;font-size:12pt;         background-color:#EEEEEE">
    	<xsl:for-each select="breakfast_menu/food">
    	<div style="background-color:teal;color:white;padding:4px">
    	<span style="font-weight:bold;color:white">
    <xsl:value-of select="name"/>
    </span>
    <xsl:value-of select="price"/>
    </div>
    	<div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
    <xsl:value-of select="description"/>
    	<span style="font-style:italic">
    
              (
    <xsl:value-of select="calories"/>
     calories per serving)
            
    </span>
    </div>
    </xsl:for-each>
    </body>
      </html>
      </xsl:template>
    </xsl:stylesheet>
    Works in firefox.
    It's probably those lines that do the trick:
    Code:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="html" version="4.01" encoding="utf-8" />
    Check this out for more examples: http://www.sitepoint.com/forums/showthread.php?t=180363
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width