[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] A simple basic question
Subject: Re: [xsl] A simple basic question From: Jakub.Valenta@xxxxxxxx Date: Mon, 6 May 2002 14:57:00 +0300 |
Hi Philip, try this one: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <body> <xsl:apply-templates select="document" /> </body> </xsl:template> <xsl:template match="paragraph"> <xsl:apply-templates /> </xsl:template> <xsl:template match="paragraph"> <p> <xsl:apply-templates /> </p> </xsl:template> <xsl:template match="bold"> <b> <xsl:value-of select="./text()" /> </b> </xsl:template> <xsl:template match="italic"> <i> <xsl:value-of select="./text()" /> </i> </xsl:template> </xsl:stylesheet> hope it helps br, Jakub Philip Mak <pmak@xxxxxxxxxxx>@... on 05/06/2002 02:38:53 PM Please respond to xsl-list@xxxxxxxxxxxxxxxxxxxxxx Sent by: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx cc: Subject: [xsl] A simple basic question I looked at various XSL guides, but I still can't figure out how to transform this: <document> <paragraph>Here is a <bold>bold</bold> word.</paragraph> <paragraph>Here is an <italic>italic</italic> word.</paragraph> </document> into this: <body> <p>Here is a <b>bold</b> word.</p> <p>Here is an <i>italic</i> word.</p> </document> The part I have trouble with is the <bold> and <italic>. The thing is that they could appear anywhere in the document; they're not part of a rigid structure. It seems that when I use <xsl:value-of select="paragraph">, the <bold> and <italic> tags inside just get stripped out. Any suggestions? XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] A simple basic question, Oleg Tkachenko | Thread | [xsl] XSl, sorting, namespaces and , Ernst Wolthaus |
[xsl] A simple basic question, Philip Mak | Date | Re: [xsl] A simple basic question, Jeni Tennison |
Month |
Keywords