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
  #1 (permalink)  
Old April 25th, 2006, 12:10 AM
Authorized User
 
Join Date: Apr 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stripping out extra space around an italic word

This is my XML file
===================
<list list-type="number">
<list-item>
<label>1.#160;</label><p>They used tall pieces of wood so that the <emphasis type="italic">fence</emphasis> would keep the dog in the garden.</p>
<p>Becky used a <emphasis type="italic">blas</emphasis> #x0028;<emphasis type="italic">cake</emphasis>#x0029; to dig a hole in the ground.</p>
</list-item>
<list-item>
<label>2.#160;</label><p>James laughed because the <emphasis type="italic">fork</emphasis> #x0028;<emphasis type="italic">gler</emphasis>#x0029; looked so funny.</p>
</list-item>


This is XSL coding
==================
<xsl:template match="list[@list-type='simple' or @list-type='bullet' or @list-type='number']/list-item">
<table><tr><td valign="top" width="5"><xsl:value-of select="label"/><text>#160;#160;</text></td>
<td><p align="justify"><xsl:apply-templates/></p></td></tr></table>
</xsl:template>

This is my output currently
===========================
Familiar referent stories
1. They used tall pieces of wood so that the fence would keep the dog in the garden. Becky used a blas
( cake ) to dig a hole in the ground.

2. James laughed because the fork ( gler ) looked so funny.



Can anyone please help me to take out the extra space around the words "( cake )" and "( gler )"

Thanks



  #2 (permalink)  
Old April 25th, 2006, 03:17 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Somewhere in your stylesheet there is code that is generating this whitespace, but you haven't shown it.

It's better to show the HTML output as it appears in a text editor, not as it appears in the browser. That makes it easier to see what's going on.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
  #3 (permalink)  
Old April 25th, 2006, 03:50 AM
Authorized User
 
Join Date: Apr 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I have posted is a copy of my HTML output or may be my understanding about your need is not right. Can you please be little more specific.

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
extra space??? crazeydazey XSLT 2 August 11th, 2008 05:55 AM
nested <div> creates extra space sstuber BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 May 2nd, 2008 09:56 AM
convert text to bold/italic/underline arunkhushi General .NET 0 August 21st, 2007 04:07 PM
regex for stripping space muki XSLT 2 February 8th, 2006 06:29 AM
PHP GD - how to write bold and/or italic text starsol Beginning PHP 0 October 4th, 2005 03:12 AM





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