Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] replace xml element

From: "Michael Kay" <michael.h.kay@------------>
To:
Date: 5/1/2002 1:23:00 AM
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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent