By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,452 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,452 IT Pros & Developers. It's quick & easy.

Including XSLT formatted XML files in an HTML page

P: n/a
Hi folks, hopefully I posted this question in the right place.

I'm currently writing an html file which references three different
xml files, each one with its own xsl stylesheet. Originally I used
framesets to display each file, and everything worked fine. However,
this method produces an ugly page with too many scroll bars, and I
want to simplify the look.

I spent a good deal of time looking up ways to include html files
within another, and I tried SSI with Apache 2.2. That method just
displayed the xml elements on the page, and completely disregarded the
stylesheets and formatting.

I'm trying to use PHP right now, but I don't think that'll work either
since I'm pretty sure you have to include other php files, rather than
xml.

All I want is for each styled xml file to be displayed one after the
other on the page, without using frames where the height of each
section is limited and therefore scroll bars are introduced if the xml
docs are too long. Surely there must be some way to accomplish this?

Thanks!
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 15 May, 15:51, Cameron.MacNeil....@gmail.com wrote:
All I want is for each styled xml file to be displayed one after the
other on the page,
Write some PHP code to do the XSLT translation yourself (three times),
as you serve the page. Pretty standard stuff, so web searching should
find you examples.

Or else (assuming the XML doesn't change often) transform the XMLs to
HTML fragments (no <headelement or <bodytags, just straight into
the content). Store these on disk and include them through SSI. Re-run
the XSLT generation process as necessary, when the XML changes.
Jun 27 '08 #2

P: n/a
On Thu, 15 May 2008 16:51:12 +0200, <Ca*****************@gmail.comwrote:
Hi folks, hopefully I posted this question in the right place.

I'm currently writing an html file which references three different
xml files, each one with its own xsl stylesheet. Originally I used
framesets to display each file, and everything worked fine. However,
this method produces an ugly page with too many scroll bars, and I
want to simplify the look.

I spent a good deal of time looking up ways to include html files
within another, and I tried SSI with Apache 2.2. That method just
displayed the xml elements on the page, and completely disregarded the
stylesheets and formatting.

I'm trying to use PHP right now, but I don't think that'll work either
since I'm pretty sure you have to include other php files, rather than
xml.
When trying to use PHP, ask in comp.lang.php.

As it's of topic here, I'll just say look at PHP's DOM
(http://www.php.net/DOM), http://nl2.php.net/manual/en/book.dom.php,
combined with the XSLT processor
(http://nl2.php.net/manual/en/class.xsltprocessor.php, have a look at
XSLTProcessor::transformToDoc), which probably will do what you want in an
embarrasingly small amount of code.
All I want is for each styled xml file to be displayed one after the
other on the page, without using frames where the height of each
section is limited and therefore scroll bars are introduced if the xml
docs are too long. Surely there must be some way to accomplish this?
That last part is just a CSS property of the container of course, using
overflow:auto & max-height, ask in
comp.infosystems.www.authoring.stylesheets when in doubt.
--
Rik Wasmus
....spamrun finished
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.