Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2006, 01:00 PM
Registered User
 
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default add xsl style sheet in generated xhtml using xslt.

Hi,

I am new to XSL. Recently purchased "XSLT2.0 3rd edition - Programmer's refernece by Michale Kay" book and implementing xslt in my project.

I have requirement where i need to add xsl stylesheet line in generated xhtml output using xsl.

<?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>

How can i do this?

I am generating xhtml output using xsl. Because generated output can have MATHML aslo , thats why we are using xhtml. This works fine in Mozilla firefox and Netscape. Only for IE it is expecting this line <?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>
in generated output xhtml file.

Example some thing like this works fine in IE browser:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml">

I am able to generate these 2 lines using xslt which works fine in Firfox and Netscape browsers.

<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">

Can you please let me know,how to add xsl style sheet in xhtml output using xsl.

waiting for response.

Thanks,
Vijay


 
Old April 10th, 2006, 02:16 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You can generate this output:

<?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>

using this XSLT code:

<xsl:processing-instruction name="xml-stylesheet">
  type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"
</xsl:processing-instruction>


Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old April 10th, 2006, 02:22 PM
Registered User
 
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Michael ,

Thank you very much for the quick response. I spent nearly 2 days looking around on the web /google , way to do this. Atlas i posted here.

I am really thankful to you for your quick response. I changed my xsl and its working fine now.

Thanks & Regards,
Vijay






Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 -- Style Sheet problem. Doug Happ BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 4 January 10th, 2008 01:14 PM
ASP.NET Generated XHTML Mr Fett BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 February 7th, 2007 01:33 AM
cascading style sheet problem nikotromus ASP.NET 2.0 Professional 0 March 24th, 2006 07:49 PM
need xsl style sheet help please!(im a begginer) klipss XSLT 2 July 25th, 2005 02:10 PM
Setting the Style Sheet class jacob ASP.NET 1.0 and 1.1 Basics 4 August 20th, 2003 01:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.