You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by ka...@wipro.com on 2008/01/07 08:01:50 UTC

Queries on Performance and error/message handling!

Hi,
 
We have a requirement to perform series of transformations and  most of the time, our input XML and XSLT file will be different.
 
We know that Xalan provides interface to perform the transformation on DOM and XML file. Wanted to know which option will be good in terms of performance. Our end application will be running on network elements with low memory. 
 
So can someone give me the pros and cons of DOM and XML file transformation in terms of memory and time?
 
Also, currently XSLT returns the actual transformation result. Does Xalan provides interface the return value of XSLT?
 
Any pointers would be highly appreciated.
 
Thanks
 
Karuna

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


Re: Queries on Performance and error/message handling!

Posted by David Bertoni <db...@apache.org>.
karuna.kosaraju@wipro.com wrote:
> Yes , you are right. XSL creates a result tree which can be dumped to 
> Xml or Html or txt.
>  
> Apart from creating output file, our style sheet throws few 
> messages using <xsl:message> construct.
> So we need to know the way to capture these messages using Xalan 
> Interface.  
You need to install a custom ProblemListener using 
XalanTransformer::setProblemListener().  Take a look at the abstract base 
class in src/xalanc/XSLT/ProblemListener.  Text from the xsl:message 
instruction comes through the ProblemListener interface with the 
classification eMESSAGE.

You will want to make sure you pass through everything you don't report in 
your own code to the default ProblemListener that's already installed in 
the XalanTransformer instance.  Otherwise, error messages will not appear 
on std::err.

Dave

RE: Queries on Performance and error/message handling!

Posted by ka...@wipro.com.
Yes , you are right. XSL creates a result tree which can be dumped to Xml or Html or txt.
 
Apart from creating output file, our style sheet throws few messages using <xsl:message> construct.
So we need to know the way to capture these messages using Xalan Interface.  
 
Thanks,
Karuna
________________________________

From: David Bertoni [mailto:dbertoni@apache.org]
Sent: Tue 1/8/2008 12:34 PM
To: xalan-c-users@xml.apache.org
Subject: Re: Queries on Performance and error/message handling!



karuna.kosaraju@wipro.com wrote:
> Hi David,
> 
> Thanks for the reply. Reg question #2, I refer to stylesheet by XSLT.
> 
> I have the stylesheet which returns boolean at the end of the transformation. I want to capture the boolean value from Xalan interface. Is this possible?
> 
> The return type of XalanTransformer::transform() API is "integer" which tells whether the transformation is successful or not.
> But it is not helping the to get the actual value returned by Stylesheet. Hope i clarified myself this time.

A stylesheet doesn't "return" anything -- it creates a result tree which is
usually serialized as markup.  Can you be more specific by providing a
minimal stylesheet that illustrates your intentions?

Dave



Re: Queries on Performance and error/message handling!

Posted by David Bertoni <db...@apache.org>.
karuna.kosaraju@wipro.com wrote:
> Hi David,
>  
> Thanks for the reply. Reg question #2, I refer to stylesheet by XSLT.
>  
> I have the stylesheet which returns boolean at the end of the transformation. I want to capture the boolean value from Xalan interface. Is this possible?
>  
> The return type of XalanTransformer::transform() API is "integer" which tells whether the transformation is successful or not. 
> But it is not helping the to get the actual value returned by Stylesheet. Hope i clarified myself this time.

A stylesheet doesn't "return" anything -- it creates a result tree which is 
usually serialized as markup.  Can you be more specific by providing a 
minimal stylesheet that illustrates your intentions?

Dave

RE: Queries on Performance and error/message handling!

Posted by ka...@wipro.com.
Hi David,
 
Thanks for the reply. Reg question #2, I refer to stylesheet by XSLT.
 
I have the stylesheet which returns boolean at the end of the transformation. I want to capture the boolean value from Xalan interface. Is this possible?
 
The return type of XalanTransformer::transform() API is "integer" which tells whether the transformation is successful or not. 
But it is not helping the to get the actual value returned by Stylesheet. Hope i clarified myself this time.
 
Regards,
 
Karuna

________________________________

From: David Bertoni [mailto:dbertoni@apache.org]
Sent: Mon 1/7/2008 8:44 PM
To: xalan-c-users@xml.apache.org
Subject: Re: Queries on Performance and error/message handling!



karuna.kosaraju@wipro.com wrote:
> Hi,
> 
> We have a requirement to perform series of transformations and  most of
> the time, our input XML and XSLT file will be different.
> 
> We know that Xalan provides interface to perform the transformation on
> DOM and XML file. Wanted to know which option will be good in terms of
> performance. Our end application will be running on network elements
> with low memory.
> 
> So can someone give me the pros and cons of DOM and XML file
> transformation in terms of memory and time?
Xalan-C parses an XML file into its internal source tree model, so the
representation of the entire XML document will be in memory.  Xalan-C can
also wrap the Xerces-C DOM, but it's not very efficient, and never
recommended unless you really need to do that.

> 
> Also, currently XSLT returns the actual transformation result. Does
> Xalan provides interface the return value of XSLT?
I'm not sure what you mean by XSLT.  If you mean can Xalan-C generate an
instance of its source tree, so you can chain transformations, then the
answer is yes.  This is more efficient in terms of processing power, since
the resulting serialized XML document doesn't have to be parsed to process
it, but uses more memory, because you will end up with two source trees in
memory at the same time.

Dave



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


Re: Queries on Performance and error/message handling!

Posted by David Bertoni <db...@apache.org>.
karuna.kosaraju@wipro.com wrote:
> Hi,
>  
> We have a requirement to perform series of transformations and  most of 
> the time, our input XML and XSLT file will be different.
>  
> We know that Xalan provides interface to perform the transformation on 
> DOM and XML file. Wanted to know which option will be good in terms of 
> performance. Our end application will be running on network elements 
> with low memory.
>  
> So can someone give me the pros and cons of DOM and XML file 
> transformation in terms of memory and time?
Xalan-C parses an XML file into its internal source tree model, so the 
representation of the entire XML document will be in memory.  Xalan-C can 
also wrap the Xerces-C DOM, but it's not very efficient, and never 
recommended unless you really need to do that.

>  
> Also, currently XSLT returns the actual transformation result. Does 
> Xalan provides interface the return value of XSLT?
I'm not sure what you mean by XSLT.  If you mean can Xalan-C generate an 
instance of its source tree, so you can chain transformations, then the 
answer is yes.  This is more efficient in terms of processing power, since 
the resulting serialized XML document doesn't have to be parsed to process 
it, but uses more memory, because you will end up with two source trees in 
memory at the same time.

Dave