Click here to get back home

Including XSLT formatted XML files in an HTML page

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Including XSLT formatted XML files in an HTML page Cameron.MacNeil.024 05-15-2008
Posted by Cameron.MacNeil.024 on May 15, 2008, 10:51 am
Please log in for more thread options
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!

Posted by Andy Dingley on May 15, 2008, 11:11 am
Please log in for more thread options
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 <head> element or <body> tags, 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.

Posted by Rik Wasmus on May 15, 2008, 3:47 pm
Please log in for more thread options

> 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

Similar ThreadsPosted
Including files (without a web server) February 9, 2006, 6:21 am
Recommendation for HTML formatted emails August 8, 2004, 8:41 pm
Research webpage design: including word processor and web page frames July 29, 2004, 11:55 pm
RFC: From XHTML to HTML via XSLT March 22, 2007, 2:52 am
ANN: v2007 Altova XML / XSLT / HTML tools available December 11, 2006, 10:41 am
types of audio files for web page April 28, 2005, 4:59 pm
Problem with downloading Word doc files and rtf files through browser January 25, 2005, 5:33 pm
Share common HTML code among different HTML files? May 14, 2005, 11:05 pm
Sycronize files with HTML January 24, 2005, 1:48 pm
Including text January 23, 2007, 2:33 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap