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]

Embedded Stylesheet


Hi all

I'm trying to embed a stylesheet within an XML document, code is as follows;

<?xml version="1.0"?>
<?xml-stylesheet href="#newsStylesheet" type="text/xsl" media="screen"?>

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

<html>
 <head>
  <title>Sample of an Embeded Stylesheet</title>
 </head>
 <body>
  <p>NEWS</p>
  <xsl:for-each select="news/day">
   <p>
    <xsl:value-of select="date"/><br/>
     <b>
      <xsl:value-of select="title"/>
     </b><br/>
    <xsl:value-of select="text"/>
   </p>
  </xsl:for-each>
 </body>
</html>
</xsl:stylesheet>

<!-- following is the XML data -->

<news>
 <day>
  <date>30 October 2001</date>
  <title>Embedded Stylesheet Example</title>
  <text>The following text is displayed using an embedded stylesheet</text>
 </day>
</news>

All the code is one file with the .xml suffix

Sadly it doesnt work, I am using IE5 running version 3 of MSXML2 is this
where the problem lies or is it within the source code?

any advice?


 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]