Opening an XMLPrintStream Object

Figure 1. Opening an XMLPrintStream
open(XSLTemplateInstanceKey key);
open(String xslTemplate);
open(XSLTemplateInstanceKey key,
     String host,
     int port);
open(String xslTemplate,
     String host,
     int port);
open(XSLTemplateInstanceKey key,
     XMLServerEndPoint[] endpoints)
open(String xslTemplate,
    XMLServerEndPoint[] endpoints)

Opening an XMLPrintStream object, establishes a connection with the chosen XML Server, sends the job configuration information, and the XSL template. Once open, the XML data can be written to the connection. In general, you will let an XMLDocument object write the data to the stream. All XML documents must be accompanied with an XSL template to allow the data to be formatted.

There are a number of open() methods. The main difference between these is that you can specify a key to an XSL template in the database or provide the XSL template document directly in a string. Also, you can provide the connection information for the XML Server (host and port) or alternatively leave these values to be picked up from the curam.xmlserver.host and curam.xmlserver.port properties.

Once opened, you should immediately begin writing data to the connection. A long delay will cause a time-out to occur and the connection will be lost.