About XMLIN > How StreamServer reads and processes XML documents

How StreamServer reads and processes XML documents
The StreamServer reads an XML document starting from the top. In the collection phase, the StreamServer continuously reads, parses, and saves input data until it comes to a specific check point in the document. The check point can be an end tag, a comment, a pattern, etc. What it is depends on the current collection mode – Document, Node, or Message. When a check point is reached, the StreamServer swaps to the process phase, and processes data that is currently available in the memory. The StreamServer continues to swap between collection phase and process phase until it reaches the end tag in the XML document.
Multiple Events using the same XML document as input
The StreamServer may use different collection modes for different parts of the input XML document. It all depends on the number of Events that use the same XML document as input, and which collection modes you have specified for the Events.
Available data
When the StreamServer processes data, it has access to the data that is currently available in the memory – nothing more and nothing less.
Releasing memory
The more data occupying the memory, the less performance. The StreamServer will therefore continuously release memory when operating in Message and Node collection mode. Consequently, all removed data will be unavailable to the StreamServer in the subsequent process phases.
Collection modes
 
For example, while parsing <A>billy<B/>bob<A/>, billy is removed when bob is parsed.
For example, when the StreamServer has processed the elements <A><B/><C/></A>, the child elements <B/> and <C/> will be removed.
 
The collection phase extends from [pattern start] to [pattern end] according to the following example:
<[pattern start]A><B/><C>text</C></A[pattern end]>
Data availability and performance depends on the amount of data enclosed by [pattern start] and [pattern end]. For example, if the pattern is defined for the root element, the Message mode is the same as the Document mode. On the other hand, if the pattern encloses one single element, the Message mode is the same as the Node mode.
Nested Events
Multiple Events can retrieve input from the same XML document. Which parts of the document an Event will retrieve is defined by patterns. If one Event’s pattern is enclosed by another Event’s pattern, this is known as nested Events.
Example 1
...
<EventA>text
   <EventB>text</EventB>
</EventA>
...
If EventA operates in collection mode Message, EventB will also be forced to operate in collection mode Message. Everything enclosed by the parent pattern – in this example EventA and EventB – will be available during the process phase. This means that the StreamServer will have access to all data that belongs to EventA when it processes EventB, and vice versa.
 
 
OpenText StreamServe 5.6 Updated: 2013-03-01