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

Re: Re: XSL issue

Subject: Re: Re: XSL issue
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Fri, 7 Jul 2006 10:53:56 +0530
Re:  Re: XSL issue
Hi Prashanth,
  You need to do following..

First write a identity template (to copy everything):

<xsl:template match="node() | @*">
  <xsl:copy>
     <xsl:apply-templates select="node() | @*" />
  </xsl:copy>
</xsl:template>

Now write different templates for various cases:

<xsl:template match="body">
  <body>
     <chunk>
        <xsl:apply-templates />
     </chunk>
  </body>
</xsl:template>

<xsl:template match="a">
  <xsl:choose>
     <xsl:when test="contains(@href, '.com') or contains(@href, '.net')">
        <ulink url="{@href}" />
     </xsl:when>
     <xsl:otherwise>
        <link linkend="{@href}" />
     </xsl:otherwise>
  </xsl:choose>
</xsl:template>

Regards,
Mukul

On 7/7/06, Prashanth T S <tsprashanth@xxxxxxxxx> wrote:
>
> Hi,
>
>           I have an input xhtml file. There are a couple of things I need to
> do to this file
>
> 1) Between the <body>......................</body> tags, I
> need to add my own custom tag like
> <body><chunk>................</chunk></body>.
>
> 2) If I have a <a href="xyz"> </link>then I need to replace a with link,
> href with linkend.Basically this should become
>                    <link linkend="xyz"></link>.
>
> Also, if the link is referring to an external link, like
> http://www.google.com, then instead of link I must put ulink i.e.,
>                    <ulink url=http://www.google.com> </ulink>
>
> Please let me know if there is a solution for the above. This is very urgent
> and any help would be highly appreciated.
>
> Thanks
> Prashanth

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.