Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xsl:message without linefeed?

Reply
Thread Tools

xsl:message without linefeed?

 
 
Johannes Busse
Guest
Posts: n/a
 
      12-07-2004
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

 
Reply With Quote
 
 
 
 
David Carlisle
Guest
Posts: n/a
 
      12-07-2004

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)" />
 
Reply With Quote
 
 
 
 
Johannes Busse
Guest
Posts: n/a
 
      12-07-2004
> 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 xmlnssl="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


 
Reply With Quote
 
David Carlisle
Guest
Posts: n/a
 
      12-07-2004

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
 
Reply With Quote
 
Johannes Busse
Guest
Posts: n/a
 
      12-08-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get a frame without titlebar and without any controls ontitlebar tanveer.sjce@gmail.com Java 2 02-16-2008 03:11 AM
PythonWin: any way to delete all objects without exiting and without doing it with "del"? dananrg@yahoo.com Python 5 03-03-2006 05:12 PM
How to store session ID without cookies and without "Cookieless=True" Paul W ASP .Net 4 06-02-2005 09:34 AM
How to allocate mem without using malloc() & free without using free() Rajshekhar C Programming 5 03-29-2005 06:03 PM
open a new window without javascript and without hyperlink Dan ASP .Net 8 11-24-2004 08:10 AM



Advertisments