[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to generate an XML log using xsl:message?
Hi Stefan,
I think the solution depends on how you get the messages. For instance if you register a MessageEmitter for Saxon or an ErrorListener for Xalan to collect the messages then you can emit the root element when you serialize them. If you rely on the default message processing (that is on the fact that they are written to stderr then you can write the start tag before the transformation to stderr and after the transformation write the end tag. If you are looking for a solution inside the stylesheet and all you want to do is to collect the stderr content then I cannot think (at least right now :) ) at a different solution than to use the disable-output-escaping attribute. Something like below: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:message> <xsl:text disable-output-escaping="yes"><log></xsl:text> </xsl:message> <xsl:message> <test>sample</test> </xsl:message> <xsl:message> <xsl:text disable-output-escaping="yes"></log></xsl:text> </xsl:message> </xsl:template> </xsl:stylesheet> should give you: <log> <test>sample</test> </log> Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Stefan Wachter wrote: Hi all,
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|