Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
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 June 18th, 2008, 05:27 PM
Friend of Wrox
Points: 1,306, Level: 14
Points: 1,306, Level: 14 Points: 1,306, Level: 14 Points: 1,306, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: Pondicherry, India
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Default remove duplicate text in an output html element

Hi All,

I wrote an xsl to output xml as html. in one <td> i get two values, say <td>1 1</td>. between two 1's there is a space. i dont want that extra 1 in the output. could anyone help me. below is the xml and xsl.

$tl1i can have the value 0001, 0001a, etc.

<xsl:variable name="check" select="$docB//TL1CommandSection[./Head=$tl1cs]//table[@tabType='TL1AttrImplementation']//tbody/row[.//TL1Instance!=$tl1i][.//TL1Attribute=$tl1cAttr]//TL1Instance"/>
<td>
<xsl:value-of select="$docC//ratttable/rattrow[.//TL1Instance = $check]//TL1Block"></xsl:value-of>
</td>

xml

<rattrow attrfield = "1">
<rattcell format = "Small" colname = "1"><TL1Instance>0002</TL1Instance></rattcell>
<rattcell format = "Small" colname = "2"><TL1Block>1</TL1Block></rattcell>
<rattcell format = "Small" colname = "4"><TL1Attribute attrType = "Positional">AID</TL1Attribute></rattcell>
</rattrow>
<rattrow attrfield = "1">
<rattcell format = "Small" colname = "1"><TL1Instance>0002a</TL1Instance></rattcell>
<rattcell format = "Small" colname = "2"><TL1Block>1</TL1Block></rattcell>
<rattcell format = "Small" colname = "4"><TL1Attribute attrType = "Positional">AID</TL1Attribute></rattcell>
</rattrow>

output

<td>1 1</td>





__________________
Rummy
 
Old June 20th, 2008, 01:41 AM
Registered User
 
Join Date: Jun 2008
Location: chennai, , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use substring($var, ' ')

This is helps





Similar Threads
Thread Thread Starter Forum Replies Last Post
xhtml, remove element Kabe XML 4 November 8th, 2007 12:09 PM
How to remove duplicate row from sheet ketannsharma Excel VBA 1 February 18th, 2007 03:32 AM
Duplicate Element Names carolynk XML 1 September 30th, 2004 09:22 AM
Getting HTML element text using id badgolfer Javascript How-To 1 July 27th, 2004 12:17 PM





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