473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

xsl:message without linefeed?

Hello,

I use saxon 6.5.3. under SuSE 9.1.
In my stylesheet I give out messages like

<xsl:message>
<xsl:value-of select="$myId" />
<xsl:text> | </xsl:text>
</xsl:message>

my problem: saxon adds a newline behind each message;
instead of getting

3d2345 | 3d098 | 3d09568 | ...

I get

3d2345 |
3d098 |
3d09568 |
...

This behavior semms to differ
from the saxon documentation, c.f.
http://saxon.sourceforge.net/saxon6....ml#xsl:message

any hint?

thank you, johannes
www.jbusse.de

Jul 20 '05 #1
4 2841

the linefeed isn't coming from the code you showed, it is presumably
coming from the variable $myId the definition of which you didn't show.
You could get rid of it with:

<xsl:value-of select="normalize-space($myId)" />
Jul 20 '05 #2
> the linefeed isn't coming from the code you showed,

ok: you agree there should be no linefeed?
it is presumably
coming from the variable $myId the definition of which you didn't show.
You could get rid of it with:

<xsl:value-of select="normalize-space($myId)" />

if you were right, the " | " in my example output
would be moved to the new line; but is is still
on the right line.

Have a look at the follwing example:

------- message.xsl --------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.1">
<xsl:template match="/">
<xsl:message><xsl:text>Adam</xsl:text></xsl:message>
<xsl:message><xsl:text>Eve</xsl:text></xsl:message>
</xsl:template>
</xsl:stylesheet>
---------- EOF message.xsl ----------

This stylesheet produces the following output:

name@nirwana:~/public_html/test> saxon empty.xml message.xsl RETURN
Adam
Eve
<?xml version="1.0" encoding="utf-8"?>name@nirwana:~/public_html/test>

maybe it is a problem of the terminal window?
(I am using xterm with fvwm2, the SuSE standard if you
do not want to use KDE.)

johannes
Jul 20 '05 #3

Oh they are different xsl:messages (That was implied by your original
post but I missed it, sorry)

yes saxon puts each new message on a new line, you can suppress
"internal" line breaks from xslt but I don't think you can do anything
about the newline that is used at the start of each message from the
command line at the saxon level, although of course since you are using
a linux shell you could redirect stderr (which is where xsl:message is
going) through sed or perl or whatever and reformat it any way you want.

your posted input file (e.xsl) run on itself produces:

saxon e.xsl e.xsl 2>&1 | sed -e :a -e "/$/N;s/\n//;ta" -
AdamEve
david

blame google for the sed hack:-)
Jul 20 '05 #4
hi,
I don't think you can do anything
about the newline that is used at the start of each message from the
command line at the saxon level,
thank you, good to know that it is not my fault
do find out the solution
saxon e.xsl e.xsl 2>&1 | sed -e :a -e "/$/N;s/\n//;ta" -
AdamEve
blame google for the sed hack:-)


That's in deed a hack. I will keep it in mind!
thank you for your help!

johannes

Jul 20 '05 #5

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

Similar topics

5
by: Simon Brooke | last post by:
Test Test HTML file Test file to observe effect of DTD declaration on XSL processing.
1
by: RobA | last post by:
Does anyone now how to fire an exception from with plain XSL e.g. <xsl:if test="something_not_correct"> <xsl:exception> <xsl:text>The transformation failed...</xsl:text> </xsl:exception>...
14
by: inquirydog | last post by:
Hi- One frusterating thing for me with xsl is that I don't know how to make xslt throw some sort of exception when a value-of path does not exist. For instance, suppose I have the following...
1
by: Sharon | last post by:
Hi! I have this function to add some parameters to my XSL and then retransform my XML with it, resulting in a neatly filtered table. It works great, but as soon as I take out the alert, it doesn't...
2
by: Alok Sathaye | last post by:
Hi, I have an XSLT which outputs an <xsl:message> How can I handle it using .net framework 1.1 I know 2.0 has provided an event to trp the message. Is something similiar possible in 1.1 also? ...
3
by: Bo | last post by:
Can XMLSpy (and AltovaXML) be "persuaded" to continue processing after issuing a (conditional) xsl:message? I've tried with terminate="no" and terminate="false", but the engine stops regardless....
5
by: the_jos | last post by:
Dear reader, I am trying some things with xml/xsl and cannot find a solution for what I would like to do. I have 2 base items with name and price and two that are composed of base two (given...
3
by: Petterson Mikael | last post by:
Hi, I was running the following in Netbeans 5.5: sing com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl - default JRE XSLT processor. Creating output/NcmiSigTest.java Unsupported...
3
by: z1 | last post by:
hi- i am fooling around with soap and weather templates. for some reason either this if or select is failing. i am very new to xml and found this code at another site. i can show you the xml...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.