473,408 Members | 2,734 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,408 software developers and data experts.

Using browser XSLT transformations

I'm not sure if this is the right group for this question. It seems to
span a few topics.

I have a PHP page that generates XML output. I want to push this output
through a stylesheet transformation and display this to the user. I
know the transformation is sound because if I save the output as a .xml
file it renders fine. However, the PHP page is displayed as raw text
without even line breaks. I suspect that because the extension for the
page is .php the browser does not know to treat it as XML and apply the
stylesheet. Is it possible to force the browser to do this?

Once I have this working, I would then like to embed the XML into a
larger page generated by PHP. Will the browser be able to only
stylesheet-process the XML portion of the page and leave the rest
literal?

Any general suggestions on how to embed stylesheet-transformed XML into
a web page? I know I can use the XML XSLT routines to hand-crank the
transformation, but leaving the XML as it is and getting the browser to
transform seems a lot cleaner.

Thanks,

Peter

Apr 10 '06 #1
1 1236
El 10 Apr 2006 10:33:03 -0700
th*******@my-deja.com escribió:
I'm not sure if this is the right group for this question. It seems to
span a few topics.

I have a PHP page that generates XML output. I want to push this
output through a stylesheet transformation and display this to the
user. I know the transformation is sound because if I save the output
as a .xml file it renders fine. However, the PHP page is displayed as
raw text without even line breaks. I suspect that because the
extension for the page is .php the browser does not know to treat it
as XML and apply the stylesheet. Is it possible to force the browser
to do this?


you have to generate the header to change the default mime-type to
application/xml

header('Content-type: application/xml; charset=utf-8 ');

--
Juan José Gutiérrez de Quevedo
Director Técnico (ju****@iteisa.com)
ITEISA (http://www.iteisa.com)
942544036 - 637447953
Apr 10 '06 #2

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

Similar topics

1
by: David | last post by:
I would like to be able to re-sort data in an HTML table on the without returning to the server. It seems like an XSLT should be able to accomplish this, but I can't find enough information... ...
3
by: Tim Dempsey | last post by:
Folks, I need some advice. I hpoe some of you can advise me. Our church's weekly bulletin has been published on paper for years. It is created in MS Word and sent to the publishing company....
1
by: Dan | last post by:
I have a C# program which executes some XSLT transformations. The XSLT code requires an input intermediate file, generated by other transformations, as its duty is copying some data from an input...
5
by: JusPassinThrough | last post by:
I have a client that has an existing website of about 100 pages. He wants those pages translated into 3 different languages. He currently uses a third party translation source who suggested that a...
6
by: Lenny Wintfeld | last post by:
Hi I'm attempting additions/changes to a Java program that (among other things) uses XSLT to transform a large (96 Mb) XML file. It runs fine on small XML files but generates OutOfMemory...
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 =...
2
by: 张韡武 | last post by:
We have preffered language set as variable in xslt: <xsl:variable name="preferred_language"> zh </xsl:variable> Data: <name xml:lang="de">Raw Materials (Mining incl.)</name> <name...
13
by: Toby Newman | last post by:
I started learning XML on Monday. I have an XML file and have written an XSL file to render it to HTML for formatted viewing in a browser. I'd like to create a second alternative view of the...
2
by: killy971 | last post by:
I have been testing different libraries to process XSL transformations on large XML files. The fact is that I read a document from Intel, stating their library (XSLT accelerator) was more twice...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.