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

XSLT wish list

Subject: XSLT wish list
From: "Robert C. Lyons" <boblyons@xxxxxxxxxx>
Date: Thu, 20 May 1999 21:31:31 -0400
xsl exit for
I'm writing an XSLT stylesheet that must validate some of the
fields in the source document while transforming the
source document into a new XML document. When my XSLT stylesheet 
finds a validation error, I would like it to do the following:

- Write an error message to standard error (rather than to the result tree).
  The error message should include the line number within the source
  document of the invalid data.

- Abort the processing of the stylesheet and specify the exit code
  that the XSLT processor will return.

I'm hoping that a future version of XSLT will let me use
the xsl:message instruction to write an error message
to standard error.

It would also be nice if XSLT provided a function that returned
the line number for a node in the source document.

Lastly, I'd like to see an "xsl:exit" instruction added to XSLT.
For example:

    <xsl:if test="not(element='valid_value')">
        <xsl:message>Error: element contains invalid value</xsl:message>
        <!-- Abort stylesheet and cause the XSLT processor to exit with 
             an exit code of 2. -->
        <xsl:exit code="2"/>
    </xsl:if>

With the current version of XSLT, the stylesheet can abort
processing by invoking an illegal instruction (e.g., xsl:abort-stylesheet). 
For example:

    <xsl:if test="not(element='valid_value')">
        <xsl:message>Error: element contains invalid value</xsl:message>
        <!-- Abort stylesheet by invoking an illegal instruction. -->
        <xsl:abort-stylesheet/>
    </xsl:if>

However, this is a little kludgey and it doesn't allow you specify an exit code.
Also, there may be cases where you want the stylesheet to force an early,
successful exit. 

Bob

------
Bob Lyons
EC Consultant
Unidex Inc.
1-732-975-9877
boblyons@xxxxxxxxxx
http://www.unidex.com/

<<application/ms-tnef>>

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.