Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: "Chains" of xslt transformations

From: "Oleg Tkachenko [MVP]" <oleg@--!----!---------------.--->
To: NULL
Date: 7/6/2005 1:03:00 PM
Slava Sedov wrote:
> need to effectively perform 2 sequential xslt transforms on some data 
> ((xm1+xsl1)+xsl2) and can`t find a way to do it without intermediate 
> transform intermediate xml to text - i use XslCompiledTransform with 
> XPathDocument, is anyone know good way to pass result data after first 
> xslt-transformation as source data for second xslt-transformation?

As XslCompiledTransform doesn't support XmlReader output, there is no 
such easy way. The only way that doesn't incur reparsing is transforming 
to XmlNodeWriter, which writes to XmlDocument. But then your next 
transformation will deal with XmlDocument, which is slower than 
XPathDocument.
We (XML MVPs) are working on this problem.

Another solution is to avoid double stylesheets and instead combine them 
into one (set mode for each template to distinguish them), then store 
first transformation in a variable, convert it to a nodeset and run 
second one.

> p.s. also i am interesting about best practice to this scenario - i get 
> xml1, then apply xslt1 to it and in result i get another xslt2 and then 
> perform tranformation of xml2 using xslt2. I don`t understand why i need 
> store intermediate results as strings instead of storing it as XPathDocument 
> or at least XMLDocument.
You don't have to. Transform to XmlWriter instead.

-- 
Oleg Tkachenko [XML MVP, MCAD]
http://www.xmllab.net
http://blog.tkachenko.com


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent