xsl-list
[Top] [All Lists]

RE: [xsl] Saxon .Net API performance

2010-09-01 11:49:51
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?

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(_at_)saxonica(_dot_)com]
Sent: 31 August 2010 21:45
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>