473,471 Members | 4,095 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

xsl:text element?

I'm having difficulty XSL tranforming some XML of the form <some_element>
<jis>1234</jis></some_element> into the xhtml form <img
src="jis/1234.gif"/>

My initial idea was to use the following XSL:

<xsl:text><img src="jis/</xsl:text><xsl:value-of select"./jis/text()"/>
<xsl:text>.gif"/></xsl:text>

But when I run this, I get the error that "src may not contain a <
symbol" (I run this in the XSLT engine that comes with the Exchanger XML
editor v2, which uses Xerces 2.6.2 and Saxon 6.5.2). I must admit being
slightly confused... am I using <xsl:text> wrong, or should this work for
all intents and purposes?
Mike Kamermans
Jul 20 '05 #1
2 1615
Hi,

use:
<img src="jis/{./jis/text()}.gif"/>
or:
<img>
<xsl:attribute name="src">jis/<xsl:value-of
select="./jis/text()"/>.gif</xsl:attribute>
</img>

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
Ceterum censeo XML omnibus esse utendum
Jul 20 '05 #2

My initial idea was to use the following XSL:

<xsl:text><img src="jis/</xsl:text><xsl:value-of
select"./jis/text()"/>

XSLT has to be well formed XML, you can never have element markup inside
an attribute in XML so that would be rejected by the XML parser before
XSLT started.

if you fix the attribute so that XSLt does see the file, the XSLT engine
will tell you that you can't have result elements inside xsl:text (only
text)

Use

<img src="jis/{jis}.gif"/>

David
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Derek Fountain | last post by:
When is the use of <xsl:text>blah blah</xsl:text> necessary? I'm finding that, although it's used religously in the book I'm learning from, if I miss it out, the output is just the same.
0
by: ReignMan | last post by:
I'm running JDK 1.4.0_01, Xalan2.5.1 and Tomcat 4.1.27. XSL transformations work, yet when running in debug mode (Eclipse IDE), I get the following: 990S2html.xsl:3:80: Element type...
2
by: Angus Parvis | last post by:
Hi, I've already posted this in comp.lang.java.programmer, but it doesn't seem like the ppl there can help. I hope you guys here know more about it, altough my question is more java than xml...
2
by: adrian | last post by:
Hi I'm having the following problem: im my xml file there is an element called <gebdatum>22.09.79</gebdatum> (date of birth in english). this might be full (like in the example) or empty. in...
3
by: darrel | last post by:
In my XSLT, I'm trying to write out some dynamic URLs. I can't put an actual xsl:value-of field inside a URL: <a href="<xsl:value-of select="linkUrl"/>"> But I can do this: <a...
2
by: Buddy Ackerman | last post by:
Apparently .NET strips these white space characters (MSXML doesn't) regardless of what the output method is set to. I'm using <xsl:text> </xsl:text> to output a tab character and...
2
by: Paul Verbelen | last post by:
I have a file with topics. I like to copy them in another file but want to have some blank lines between the different topics. I use <xsl:text> element with as data some blank lines to perform...
4
by: Jon | last post by:
Hi, I used XslCompiledTransform with the following Xsl file. The <xsl:text disable-output-escaping="yes"does not work when using XslCompiledTransform to do the trnasform (namely the output...
2
by: KDawg44 | last post by:
Hi, How can I use XSL to get to the text within an element? For example, say I have the following XML: <sunday> <am>Leisure Day</am> <pm>3:00 Tigers Game</pm> </sunday>
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.