[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:processing-instruction
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|