p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XSLT (http://p2p.wrox.com/forumdisplay.php?f=86)
-   -   Regarding the XSLT Processor (http://p2p.wrox.com/showthread.php?t=51035)

sunrain December 2nd, 2006 11:28 AM

Regarding the XSLT Processor
 
Hi

The way I know that a Processor works is by building a tree for the initial XML and stylesheet files, which would be an in-memory representation of these files. These means that if the initial XML document is very large, it will impact both the memory and the time it actually takes to initial construct the tree, and then go through the tree and find proper matches from the XSL file. I see all this being similar to how DOM works. Why was these design chosen?

Thank you for any information regarding this.

Michael.

mhkay December 2nd, 2006 11:46 AM

>Why was these design chosen?

I'm always a bit cautious about answering questions of historical fact, I'm not a historian and it's very easy for conjectures to turn into urban myths.

There have been attempts to design transformation languages that process a document sequentially, for example STX and XStream. Generally they are harder to use or have more limited functionality. Doing something like building an index or a table of contents when you haven't got the ability to navigate anywhere you like in the source tree isn't easy.

Some people also argue that a good optimizer should be able to detect those XSLT stylesheets where serial processing is possible and avoid building the tree. Personally, I'm sceptical.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

sunrain December 2nd, 2006 03:21 PM

Thank you Michael for your answer. I mentioned that I see similitudes between Processors and the way DOM works; does, for example Saxon, use DOM when building the source and stylesheet tree?

Michael

sunrain December 2nd, 2006 03:30 PM

I just found an article regarding Saxon on the IBM website written by you where you specify that Saxon does not use the DOM tree model but rather the XPath tree model which is needed by an XSLT processor. I presume that this means that a DOM model cannot be use by an XSLT Processor. Now I have to find out how the DOM tree model differs from the XPath tree model.

Mihai

mhkay December 3rd, 2006 02:59 AM

>does, for example Saxon, use DOM when building the source and stylesheet tree?


No, Saxon uses its own tree representation which is much more efficient (in both space and time) than DOM.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

mhkay December 3rd, 2006 03:01 AM

Do get yourself a copy of my XSLT Programmer's Reference, it's a good starting point for such discussions.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference


All times are GMT -4. The time now is 04:14 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.