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

Re: xsl:processing-instruction

Subject: Re: xsl:processing-instruction
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 14 Oct 2002 15:46:17 +0100
create xml stylesheet
Hi Dave,

> I need to generate
> <?xml-stylesheet href="base.css" type="text/css"?>
>
> except that the href needs to come from an xhtml file
>
> I have
>   <xsl:if test="html:html/html:head/html:link[@rel='stylesheet']">
>
>         <xsl:processing-instruction name="xml-stylesheet">
>           href="<xsl:value-of
> select="html:html/html:head/html:link[@rel='stylesheet']/@href"/>"
>           type="text/css"
>         </xsl:processing-instruction>
>
>       </xsl:if>

That looks fine. Doesn't it work?

> Is this a bit like putting markup into xsl:comment, a nono?

The same rules apply for the content of xsl:processing-instruction as
do for xsl:comment, yes -- you can't create nodes aside from text
nodes within them. But that's all you're doing in the above --
creating text -- so what you have should be fine. If you tried to do:

  <xsl:processing-instruction name="xml-stylesheet">
    <xsl:attribute name="href">
      <xsl:value-of select="html:html/html:head/html:link[@rel='stylesheet']/@href"/>
    </xsl:attribute>
    <xsl:attribute name="type">text/css</xsl:attribute>
  </xsl:processing-instruction>

*that* would be an error.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • xsl:processing-instruction
    • DPawson - Mon, 14 Oct 2002 10:08:11 -0400 (EDT)
      • Jeni Tennison - Mon, 14 Oct 2002 10:43:08 -0400 (EDT) <=
      • David Carlisle - Mon, 14 Oct 2002 11:25:18 -0400 (EDT)
      • TP - Mon, 14 Oct 2002 15:03:16 -0400 (EDT)
        • Mike Brown - Mon, 14 Oct 2002 15:53:21 -0400 (EDT)
          • TP - Mon, 14 Oct 2002 16:29:46 -0400 (EDT)

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.