Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT <xsl:text> no whitespace output 1

Status
Not open for further replies.

sedj

Programmer
Aug 6, 2002
5,610
Hi, is there any way to tell the <xsl:text> directive not to output any whitespace.
I am try to generate an HTML <img> tag ...

When I use :

Code:
<xsl:text disable-output-escaping="yes">
  &lt;img src="
</xsl:text>

  <xsl:value-of select="."/>

<xsl:text disable-output-escaping="yes">
  "/&gt;
</xsl:text>

the output is :

Code:
	<img src="
    file://C:\java\xslt\px_logo.gif
	"/>

and in order to have it appear on one line, I use this :

Code:
    <xsl:text disable-output-escaping="yes">
	&lt;img src="</xsl:text><xsl:value-of select="."/><xsl:text disable-output-escaping="yes">"/&gt;
    </xsl:text>

... which produces the desired output, but this is not very readable - is there a better way ?

Cheers

Ben
 
heh, yeah, that's not gonna work ;-)

try this instead:
Code:
<img src="{.}" />

Hope This Helps...

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top