Subject: [xsl] Perplexing Problem in Embedding Stylesheet From: "Sean Kelly" <sean@xxxxxxxxxxxxxxxxxx> Date: Thu, 1 Nov 2001 00:15:12 -0000 |
Hi all, I am trying to embed a style sheet into an XML document. I am using IE5 running MSXML3 in replace mode. I have originally tried an example from the Wrox Professional XML book which doesnt work. In addition to this I also tried the skeleton example http://sources.redhat.com/ml/xsl-list/2000-07/msg01048.html before I posted my oroginal post yesterday, but again this didnt seem to work, all I got was the default tree listing of the XML document. Oleg Tkachenko kindly suggested the following <?xml version="1.0"?> <?xml-stylesheet href="#newsStylesheet" type="text/xsl" media="screen"?> <root> <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> <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> </root> This worked to some degree, however when I place the <xsl:value-of select> tags in seperate (and correctly nested) <p></p> tags, the data gets displayed as one line, and the <b></b> gets ignored so does <i></i> and linebreaks <br />. !!!!!!! Oleg kindly suggested in using <xsl:output indent="yes"/> however I still get the same result! Can anyone offer me some advice or assistance regarding this matter? thanks in advance sean XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] whitespace problem when forma, John Ericson | Thread | Re: [xsl] Perplexing Problem in Emb, David Carlisle |
[xsl] whitespace problem when forma, John Ericson | Date | Re: [xsl] embed XML island in style, David Carlisle |
Month |