Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2010, 01:32 AM
Authorized User
 
Join Date: Mar 2010
Posts: 28
Thanks: 3
Thanked 0 Times in 0 Posts
Default display xslt in mozilla firefox

Respected Sir,

I have an XSLT file which is display perfectly in IE but not able to display in Mozilla Firefox for Linux OS and Windows.

Can anyone help me to solve this problem?

Thanks,
Dhrumil
 
Old April 16th, 2010, 04:05 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

My telepathic skills are only line-of-site, can you show a small example of a transform that only works in IE?

It may be that you're using an older version of transformations or a Microsoft specific extension such as msxsl:script.
__________________
Joe
http://joe.fawcett.name/
 
Old April 16th, 2010, 04:48 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Yes, if you describe the problem then someone can help you to solve it.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 17th, 2010, 05:12 PM
Authorized User
 
Join Date: Mar 2010
Posts: 28
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Respected Sir,
Here is my XML file and style-sheet.. which is working perfectly in IE but not working well in Mozilla Firefox.
Is there any mistake in this code?
Please suggest me.

XML File:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="try.xsl" type="text/xsl"?>
<def>
	<Lineage>3</Lineage>
</def>
<Lineage>
	<sample_001>
		<time>06:03:09.750000</time>
		<date>2009/05/26</date>
		<X>4025.0784</X>
		<Y>4488.9818</Y>
		<Z>3925.5985</Z>
		<X1>3.6739</X1>
		<Y1>2.0819</Y1>
		<Z1>+6.1319</Z1>
		<R>0.0015</R>
		<P>+0.0035</P>
		<Ya>3.2564</Ya>
		<side_angle>334.7379</side_angle>
	</sample_001>
	<sample_002>
		<time>06:03:09.875000</time>
		<date>2009-05-26</date>
		<X>4025.5376</X>
		<Y>4489.2420</Y>
		<Z>3924.8320</Z>
		<X1>3.6734</X1>
		<Y1>2.0813</Y1>
		<Z1>-6.1324</Z1>
		<R>0.0015</R>
		<P>-0.0035</P>
		<Ya>3.2567</Ya>
		<side_angle>334.7384</side_angle>
	</sample_002>
	<sample_003>
		<time>06:03:10.000000</time>
		<date>2009-05-26</date>
		<X>4025.9967</X>
		<Y>4489.5021</Y>
		<Z>3924.0654</Z>
		<X1>3.6728</X1>
		<Y1>2.0807</Y1>
		<Z1>-6.1329</Z1>
		<R>0.0015</R>
		<P>-0.0034</P>
		<Ya>3.2570</Ya>
		<side_angle>334.7389</side_angle>
	</sample_003>
</Lineage>
Code:
XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40">
 
<xsl:template match = "/">
<html>
 <head>
  <style type="text/css">
  .entete { color: #fff; font-style: italic; font-weight: bolder; font-size: 13px; font-family: Georgia, "Times New Roman" }
  .new { font-size: 8px; font-family: Verdana, Arial; }
  </style>
 </head>
 <body bgcolor="#dddddd">
 <div>
 <xsl:if test="//Lineage">
 <table border="3" bordercolor="#A9AB87" cellpadding="0" cellspacing="0" width="80%" bgcolor="#eeeeee">
  <tr>
   <td valign="middle" align="center"><br/>
    <table border="3" cellpadding="0" cellspacing="0" width="95%">
     <tr>
      <td valign="top">
      <table border="0" cellpadding="0" cellspacing="2" width="100%" bgcolor="#A9AB87">
      <tr>
       <td>
        <p><span class="entete">Lineage</span></p>
       </td>
      </tr>
      </table>
      <br/>
      <table border="0" cellpadding="0" cellspacing="0" bgcolor="#A9AB99"> 
      <tr>
       <td align="left" width="2">
        <p><span class="entete">No.</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">Time</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">Date</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">X</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">Y</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">Z</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">X'</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">Y'</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">Z'</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">Raw</span></p>
       </td>
       <td align="center" width="200">
        <p><span class="entete">Pitch</span></p>
       </td>
       <td align="center" widhth="200">
        <p><span class="entete">Yaw</span></p>
       </td>
       <td align="right" width="150">
        <p><span class="entete">SiderealAngle</span></p>
       </td>
      </tr>
      </table>
      <div style="height:200px; overflow:auto;">
      <table border="0" cellpadding="0" cellspacing="0">
      <xsl:for-each select="//Lineage/*">
      <tr>
       <td valign="top">
        <p class="intitule"><xsl:value-of select="position()"/></p>
       </td>
       <td  width="200">
        <div class="new"><xsl:value-of select="time"/></div> 
       </td>
       <td width="200">
        <div class="new"><xsl:value-of select="date"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="X"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="Y"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="Z"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="X1"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="Y1"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="Z1"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="R"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="P"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="Ya"/></div>
       </td>
       <td>
        <div class="new"><xsl:value-of select="side_angle"/></div>
       </td>
      </tr>
      </xsl:for-each>
      </table>
      </div>
      </td>
     </tr>
    </table>
   </td>
  </tr>
 </table>
 </xsl:if>
 </div>
 </body>
</html>
</xsl:template>
</xsl:stylesheet>
Thanks,
Dhrumil
 
Old April 17th, 2010, 05:28 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I tried this in both IE and Opera. They both reject your XML file with a perfectly clear error message, saying it is not well-formed because there is more than one top-level element.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 18th, 2010, 11:20 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Take out the
Code:
xmlns="http://www.w3.org/TR/REC-html40"
it does not make sense as HTML 4 is an SGML application that does not know any namespaces.
If you want the stylesheet to create a HTML 4 output document then don't use any namespace at all. If you want to create a XHTML 1.0 output document then use
Code:
xmlns="http://www.w3.org/1999/xhtml"
With IE you might get lucky that it feeds the transformation result to its HTML parser which simply ignores the xmlns="http://www.w3.org/TR/REC-html40" but Mozilla will create an XML result document tree and then does not recognize the namespace of all the elements as it is not defined.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
xslt in Mozilla Browser. dhrumil XSLT 3 April 16th, 2010 01:40 AM
german characters not displayed in Mozilla Firefox crmpicco HTML Code Clinic 1 November 22nd, 2007 08:23 AM
Line Break Gap / Mozilla Firefox SolarEnergy BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 4 April 15th, 2007 10:20 AM
Having problems on Mozilla firefox (not able to se viral612 XSLT 0 March 12th, 2007 11:53 PM
firefox/mozilla crash: javascript in XSLT stekker XSLT 4 May 3rd, 2006 04:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.