Hi Tobias, Thanks for the quick reply.
I understand from your response that I should direct the output to an XML file whose format is as below and my application should be able to open the file parse it and read the data. <Report> <Failure description="..." /> </Report> But, I want my application to read the output buffer of the XSL transformation say I would put text 0 on success & 1 or 2 or etc on failures. I would not mind such solution. xsl stylesheet: output method="text" <xsl:if test="..."> <xsl:text>0<\xsl:text> </xsl:if> I would be very glad if some more clarify is provided on this. Thanks & Regards, Pnvd Sudhir -----Original Message----- From: Tobias [mailto:[EMAIL PROTECTED] Sent: Thursday, October 18, 2007 6:33 PM To: xalan-c-users@xml.apache.org Subject: Re: how to send error code from stylesheet to XalanC API >> Hi, >> I am using XALAN C for my project where I have a requirement similar to >> the below description. >> I am using XSLT to process some XML data (this XML data keeps modifying @ >> runtime) using xalanC lib, which I have linked it to my binary, in my >> program. >> I want the style sheet to intimate my program an error code >> through which it can take decision on what next to do. >> Does xalan C provides any mechanism or API through which style sheet can >> return error code/ error message, which my program can be able to >> understand? >> To my awareness anything under xsl:message will be flushed to std output >> but I am not sure if those messages can be read by my program through >> xalan C. your stylesheet could return an list of failures and your application parses the result to check and handle success or failure(s). xsl stylesheet: <failures> <xsl:if test="..."><failure description="..."></xsl:if> ... more tests ... </failures> application: parses the result, checks success by simple counting the children of /failures, which should be zero on success. on error the application can access the failure's description and other info by visiting the particular failure-node. regards tobias The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com