This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: processing instructions


> Could someone tell me how to create a xsl processing
> instruction with an attribut using xslt?
>
> Sample:
>
> I would like to create something like this
> <?xml-stylesheet type="text/css" href="toto.xsl"?>
>
> I tried to create attributs within
> <xsl:processing-instruction> template but it seems not
> work.

Processing instructions do not contain attributes. Some processing
instructions, like this one, contain "pseudo-attributes", but they are not
recognized as attributes by the XML parser, by the infoset, or by the XPath
data model. They are just text.

So you create them as text:

<xsl:processing-instruction name="xml-stylesheet">
  <xsl:text>type="text/css" </xsl:text>
  <xsl:text>href="</xsl:text>
  <xsl:value-of select="$href"/>
  <xsl:text>"</xsl:text>
</xsl:processing-instruction>

Mike Kay


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]