Subject: RE: [xsl] In-order traversal of XHTML of text() and <foo> nodes? From: "Bryan Archer" <barcher@xxxxxx> Date: Fri, 28 Mar 2003 16:09:02 -0000 |
In your specific example, you can just use <xsl:apply-templates /> (with no attributes) to instruct the processor to apply the default templates for each node type, then just override the ones you want.. <xsl:template match="foobar"> <p> <xsl:apply-templates /> </p> </xsl:template> <xsl:template match="foo"> <b><xsl:apply-templates /></b> </xsl:template> <xsl:template match="bar"> <i><xsl:apply-templates /></i> </xsl:template> and so on. Regards Bryan -----Original Message----- From: Gan Uesli Starling [mailto:alias@xxxxxxxxxxx] Sent: 28 March 2003 15:49 To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] In-order traversal of XHTML of text() and <foo> nodes? Say I have XML like this... <foobar> Once <foo>upon</foo> a midnight <bar>dreary</bar> while I... </foobar> How do I make a traversal of that <foobar> node, picking up text(), <foo> and <bar> in document order, so as to pass through the text() but apply separate templates to <foo> and <bar>? Really silly, but identical in concept, would be to output XHTML like below... <p> Once <b>upon</b> a midnight <i>dreary</i> while I... </p> I'm not really doing something that silly. But the example illustrates my traversal confusion in the simplest possible terms. I can't just grab the whole <foobar> node. I need to traverse it...with text() mixed in and between those <foo> and <bar> nodes. Sentence structure must not be destoyed. It would be, I think, like traversing an XHTML <p> node. XSL can do that, yes? Thanks, Gan -- Mistera Sturno - Rarest Extinct Bird <(+)__ Gan Uesli Starling ((__/)=- Kalamazoo, MI, USA `||` ++ http://starling.us XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list Visit our website at http://www.rm.com This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information only for the intended purpose. Internet communications are not secure and therefore RM does not accept legal responsibility for the contents of this message. Any views or opinions presented are only those of the author and not those of RM. If this email has come to you in error please delete it and any attachments. Please note that RM may intercept incoming and outgoing e-mail communications. This email has been scanned for viruses by Trend ScanMail. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] In-order traversal of XHT, Jeni Tennison | Thread | RE: [xsl] In-order traversal of XHT, Kaine Varley |
Re: [xsl] id() pattern, David Carlisle | Date | [xsl] XSLT optimisation, Alexander Johannesen |
Month |