[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl:message inside of xsl:variable

Subject: xsl:message inside of xsl:variable
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Jun 2000 11:24:15 +0200 (MET DST)
xsl message variable
Hello,

take a look at the following template:

<xsl:template match="/">
   <xsl:variable name="message">
      <xsl:message>a message</xsl:message>
      <xsl:text>some text</xsl:text>
   </xsl:variable>

   <xsl:value-of select="$message" />
</xsl:template>

What is the expected output?
I tested this with Saxon, XT and LotusXSL/Xalan, and only Saxon seems
to do the job the way I wanted it:

a message
<?xml version="1.0" encoding="utf-8" ?>some text

I.e. "a message" is sent directly to the output (stderr), message contains
"some text".

XT and LotusXSL omit "a message".

I need this for the following kind of application.
The first step of my transformation is a check if the source document
is valid according to my constraints (of course I could separate the 
task using Schematron ...).
Every time an error is detected the stylesheet produces a message via
<xsl:message>. I want all errors to be found, and I want to stop if
one or more errors occured.

The solution I had was

<xsl:variable name="errors">
   <xsl:apply-templates mode="validate">
</xsl:variable>
<xsl:if test="string-length($errors)!=0">
   <xsl:message terminate="yes">
       <xsl:value-of select="string-length($errors)"/>
       <xsl:text> errors detected</xsl:text>
   </xsl:message>
</xsl:if>

If a template in validate mode detects an error it calls
<xsl:message>
   <xsl:text> ... error report ... </xsl:text>
</xsl:message>
<xsl:text>.</xsl:text>

That works great with Saxon! :-)
Unfortunately XT and LotusXSL omit all error reports. They just say (e.g.)
"5 errors detected", terminate, and that's all.

Is that a bug in XT and LotusXSL, or is the XSLT spec too unspecific?

Cheers,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.