[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: replace xml element

Subject: RE: replace xml element
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 1 May 2002 10:29:59 +0100
xsl replace element
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:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.