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

Re: how to output a processing instruction

Subject: Re: how to output a processing instruction
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 19 May 2010 13:32:24 +0200
Re:  how to output a processing instruction
Nnaemeka David wrote:

i was reading the xslt 1.0 recommendation but could not output the example processing instruction to an html file. <xsl:processing instruction name="xml-stylesheet">href="me.css" type="text/css"</xsl:processing-instruction> i tried several ways, first of all through the head element and lastly, replacing the text nodes with two <xsl:attribute > tags with the href and type being attribute value templates. i still couldn't. can someone help me out and show me how to insert a <?xml-stylesheet...?> into the html output?


<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3.org/1999/xhtml"
  version="1.0">

<xsl:template match="/">
<xsl:processing-instruction name="xml-stylesheet">href="me.css" type="text/css"</xsl:processing-instruction>
<html>
...
</html>
</xsl:template>



should do, assuming you want to create an XHTML result document to be parsed as XML by an user agent.


If you want to create text/html output then I would not use xsl:processing-instruction to link to a stylesheet, instead I would put an HTML "link rel=stylesheet" element in the head section of the HTML document.

--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

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.