473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Firefox and XSLT

Hello,

I am using Firefox 1.5.0.7 and when I display the following xml file, I get:

Alan
Turing
computer scientist
mathematician
cryptographer

Richard
P
Feynman
physicist
Playing the bongoes
The matching in the .xsl file does not seem to work. The matching should
change the first names to 'bob'. I tried it in IE6 (changed application/xsl
to text/xsl) and it worked fine. Any ideas why match does not work in
Firefox? The two files are:

~~~~~~~~~
people.xml
~~~~~~~~~
<?xml version="1.0"?>
<?xml-stylesheet type="application/xsl" href="people.xsl"?>
<people>
<person born="1912" died="1954">
<name>
<first_name>Alan</first_name>
<last_name>Turing</last_name>
</name>
<profession>computer scientist</profession>
<profession>mathematician</profession>
<profession>cryptographer</profession>
</person>
<person born="1918" died="1988">
<name>
<first_name>Richard</first_name>
<middle_initial>P</middle_initial>
<last_name>Feynman</last_name>
</name>
<profession>physicist</profession>
<hobby>Playing the bongoes</hobby>
</person>
</people>
~~~~~~~~
people.xsl
~~~~~~~~
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="first_name">Bob</xsl:template>
</xsl:stylesheet>
Oct 14 '06 #1
1 1371


Geoff wrote:
I am using Firefox 1.5.0.7 and when I display the following xml file, I get:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="first_name">Bob</xsl:template>
</xsl:stylesheet>
That stylesheet has XML output but no root element so with Mozilla
adding e.g.

<xsl:template match="/">
<root>
<xsl:apply-templates/>
</root>
</xsl:template>

should help so that the result tree has a root element and can be
rendered. That root element will then have the text content


Bob
Turing

computer scientist
mathematician
cryptographer

Bob
P
Feynman

physicist
Playing the bongoes

which seems to be what you want.
Or put in
<xsl:output method="text"/>
and your stylesheet will work without any additional template.

As for the MIME types, see the FAQ
<http://www.mozilla.org/projects/xslt/faq.html>.


--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: David Blickstein | last post by:
I have some XML documents that I want to open in a web browser and be automatically translated to HTML via XSLT. I'm using an xml-stylesheet processing command in a file called "girml.xml". ...
3
by: kiki | last post by:
Hello, I have the following code which works fine in IE, but can't get it to work in Firefox. (the idea is to get DB data without postback).. I would apreciate any ideas you might have on this.. ...
3
by: zakhan | last post by:
I have an XSL file that uses hiveware_enkoder javascript to hide an email address. This is a snippet from the xsl file: <script type="text/javascript"> //&lt;!]&gt; </script> This renders...
4
by: simon.a.hulbert | last post by:
Hi, I'm trying to view the following xslt transformation using firefox <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > <xsl:output method = "xml" indent =...
7
by: shaun roe | last post by:
Hi, I am using an XSLT to generate an SVG client-side in Firefox. The user opens an XML file in Firefox and sees a display. In doing so, I have to convert from cartesian to polar coordinates, so...
7
by: Zzzbla | last post by:
Hi all, anyone has a live example of loading an xml file from a server, an xslt file from the server, then transforming the xml using the xslt and outputing the results (preferably with...
1
by: David Henderson | last post by:
I know 'disable-output-escaping' has been discussed in the past, but I can't put my finger on any of the threads to see if my current problem is addressed. Sorry for re-asking the question if it...
2
by: willyWEB66 | last post by:
Hi everyone, I have this code in javascript where the XML file is loaded and displayed to an html using XSLT. It works fine in IE but not in Firefox. My problem is in the looping to the...
6
by: Dennis | last post by:
I am in the process of converting some program output from HTML to XML/XSLT. I have an XSL stylesheet that inserts some javascript in the output that gets called further down to pop up a window)....
1
by: shidhincr | last post by:
I have some doubts regarding XML and XSL transfornation using javascript.Hope SomeOne will help me for solving this problem. Actually i Created a javascript for transforming XML and XSL. i made...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.