Including XSLT formatted XML files in an HTML page

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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

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?


Re: Including XSLT formatted XML files in an HTML page

On 15 May, 15:51, wrote:

Quoted text here. Click to load it

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.

Re: Including XSLT formatted XML files in an HTML page

Quoted text here. Click to load it

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  
( ), ,  
combined with the XSLT processor  
( , have a look at  
XSLTProcessor::transformToDoc), which probably will do what you want in an  
embarrasingly small amount of code.

Quoted text here. Click to load it

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

Site Timeline