Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2011, 11:13 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default Not function

Hi,

i have attached input and output file for ur reference. Kindly advise to me.

<F> nested RM tag present that will show as normal text. if not in RM it will show italic.

Input file

<F><SUP>2</SUP><RM>Li</RM> + <SUP>3</SUP><RM>He</RM></F>
<F><SUP>4</SUP>La <SUP>5</SUP>He></F>

output
<html>
<p><SUP>2</SUP>Li + <SUP>3</SUP>He</p>
<p><SUP>4</SUP><i>La</i> <SUP>5</SUP><i>He</i></p>
</html>


Kindly Advise
Thanks
Rockbal
 
Old August 8th, 2011, 11:26 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

What you need to know here is that the nodes you are interested in are the F/RM elements, and the F/text() elements.

So given that, then some sample templates you might want to use would look like this:

Code:
<xsl:template match="F/text()">
  <i><xsl:value-of select="."/></i>
</xsl:template>

<xsl:template match="F/RM">
  <xsl:value-of select="."/>
</xsl:template>
Then you could use a simple template to map the SUP element to itself (also called the identity template) and map the F to the <p> element, and call xsl:apply-templates on its inner elements.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old August 8th, 2011, 11:32 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

It's working fine Thank for reply.





Similar Threads
Thread Thread Starter Forum Replies Last Post
search function and trim function sett Excel VBA 1 April 23rd, 2010 09:20 PM
How to use Function akumarp2p SQL Server 2000 1 May 28th, 2007 05:04 AM
send variable in function to another function schoolBoy Javascript How-To 6 March 3rd, 2007 09:16 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.