[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Print vs Screen XSLT stylesheets?

Subject: Print vs Screen XSLT stylesheets?
From: Dan Vint <dvint@xxxxxxxxx>
Date: Thu, 26 Nov 2009 13:46:57 -0500
 Print vs Screen XSLT stylesheets?
I've been building an XML based website. I've got a nice working environment for the screen. I have the following association:

<?xml-stylesheet type="text/xsl" href="scripts/slideshow-tables.xslt" media="screen"?>

This produces a slide show and a bunch of navigation features. I want to make a corresponding "for print" stylesheet. I added this:

<?xml-stylesheet type="text/xsl" href="scripts/slideshow-tables.xslt" media="screen"?>
<?xml-stylesheet type="text/xsl" href="scripts/slideshow-print.xslt" media="print"?>


My screen presentation switched to the print style - which I didn't want. Looks like the last stylesheet read is what is used. I made the next change:

<?xml-stylesheet alternate="yes" type="text/xsl" href="scripts/slideshow-print.xslt" media="print"?>

The alternate='yes' seems to have at least kept my original stylesheet being read for the screen. I'm not sure if the media='screen' has anything to do with it. The media='print' certainly is not producing the result I want. When I do a print preview with FireFox, I don't get my new print arrangement.

FYI results seem to be the same in IE as well.

The xml-stylesheet spec indicates that this is supposed to work like the <link> tag for CSS, so I thought this would work. I need more support than what CSS will allow and I want to write a second XSLT stylesheet to handle the different formatting. The biggest thing I need to do is convert my slideshow from Javascript arrays and a Javascript player to be in line <img> references. That's the reason I want XSLT instead of CSS for this task.

Any suggestions how I can handle this with XSLT/XML/HTML techniques?

I would like the stylesheet to be automatically triggered when someone hits the print button. My only other thought is to add a button on the webpage that will trigger some Javascript to process the XML content with a different stylesheet and then pop that up as a new window. Anyone got some example code that would call an XML file and apply a stylesheet?




..dan





--------------------------------------------------------------------------- Danny Vint

Panoramic Photography
http://www.dvint.com

voice: 502-749-6179

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.