Comparing Features

Streaming API:

  • The streaming API is limited in that it can read, or it can write. The xmlReader and xmlWriter APIs are separate, so there's no modifying XML that is being read with xmlReader, and no looking back at data that's come out of xmlWriter.

  • The streaming APIs are also linear - the xmlReader can only examine the current element, meaning operations such as "get the current element's parent" are impossible. Similarly, the xmlWriter cannot change data that has already been send to the API for writing.

  • XPath processing is also unavailable for the xmlReader interface, since previous and future elements are not kept in memory to be analyzed.

  • XSL Processing is unavailable for the xmlReader interface, as XSL processing relies on random access and XPath expressions during the transformation.

Tree API:

  • The tree API does not have these limitations. Because the entire XML document is held in memory, data can be read and written simultaneously.

  • The tree can be accessed sequentially, randomly, or any desired method. A tree could be constructed from the inside out, if so desired.

  • XPath processing is available for the tree API, allowing for a very easy, very powerful method of traversal for XML data.

  • XSL Processing is available for the tree API, allowing the application of a stylesheet to produce XML or HTML data.

Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.