[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] replace xml element
Subject: RE: [xsl] replace xml element From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Wed, 1 May 2002 10:29:59 +0100 |
Write a template rule for each element saying how you want that element to be processed: <xsl:template match="content"> <xsl:apply-templates/> </xsl:template> <xsl:template match="break> <br/> </xsl:template> You might want to add a default rule that copies elements unchanged: <xsl:template match="*"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> or that deletes elements together with their content: <xsl:template match="*"/> or that processes the contents of the element but drops the start and end tag: <xsl:template match="*"> <xsl:apply-templates/> </xsl:template> Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of valerie > liston > Sent: 01 May 2002 09:27 > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] replace xml element > > > I have a question about replacing xml elements. Here is the problem; > I want to output the content of the element <content> and replace the > element <break/> with the html tag <br/>. I know this is > probably a very > basic question but I appreciate your help. > <item name="netinterfacedes" translation="Network Interface > Description"> > > <par type="text"> > > <content>Intel Pro/100 VE Network connection<break/>10 Base-T and 100 > Base-TX physical layer capabilities<break/>Remote wake on LAN > supported</content> > > </par> > > </item> > > <xsl:value-of select="item/par/content"/> > > Thanks > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] replace xml element, Mike Brown | Thread | [xsl] How can i access a JSP functi, Suman . Sathyanaraya |
[xsl] How can i access a JSP functi, Suman . Sathyanaraya | Date | [xsl] DTD, tinku |
Month |
Keywords