Subject: Re: [xsl] Saxon .Net API performance From: Michael Kay <mike@xxxxxxxxxxxx> Date: Wed, 01 Sep 2010 23:57:23 +0100 |
Thanks Michael, that's really helpful. However, I don't understand how Tinytree is used by the Saxon API in .Net.
I'm using a .Net XmlTextWriter to serialize my objects to XML which are then built into an XdmNode (see code excerpt below), which is used as the input for transformation. As I understand, using the XmlTextWriter avoids using DOM. Does this use Saxon's tree model efficiently?
Michael Kay Saxonica
public XdmNode ReadObject(object objectToSerialize, Uri baseUri) { XdmNode result;
using (MemoryStream stream = new MemoryStream()) { XmlSerializer xmlSerializer = new XmlSerializer(objectToSerialize.GetType()); using (XmlTextWriter xmlWriter = new XmlTextWriter(stream, Encoding.UTF8)) { xmlSerializer.Serialize(xmlWriter, objectToSerialize);
DocumentBuilder builder = XsltHelper.Processor.NewDocumentBuilder(); builder.BaseUri = baseUri;
stream.Seek(0, SeekOrigin.Begin); result = builder.Build(stream); } } return result; }
-----Original Message----- From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: 31 August 2010 21:45 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Saxon .Net API performance
That's a very broad question!
I think probably the most important advice is to use Saxon's native tree model rather than running over the Microsoft DOM (which is possible, but slow). Most of the other things one can say are pretty generic, applying equally to any XSLT processor.
This is a confidential email. Tesco may monitor and record all emails. The views expressed in this email are those of the sender and not Tesco.
Tesco Stores Limited Company Number: 519500 Registered in England Registered Office: Tesco House, Delamare Road, Cheshunt, Hertfordshire EN8 9SL VAT Registration Number: GB 220 4302 31
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Saxon .Net API performanc, Merrilees, David | Thread | RE: [xsl] Performance with Saxon an, Fabien Tillier |
Re: [xsl] Saxon .Net API performanc, Michael Kay | Date | [xsl] Creating exception in process, Gábor Tóth |
Month |