Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IXSLT::startTransform ( p6IDataStream pTransformResult,
const P6CHAR pBuffer,
P6UINT32  bufSize,
P6BOOL  isLast 
)
pure virtual

The caller must first call the compileTempates() method with a valid XSLT stylesheet.

After that, this function is called to provide the start of the complete chunk of XML (or JSON) to transform with the compiled XSLT. If the XML is being streamed in then the caller first calls this method with the "isLast" parameter set to P6FALSE. Secondly, the caller calls the continueTransform() method as many times as necessary (once per XML chunk) setting "isLast" to P6TRUE when the final buffer of XML is available.

The compiled XSL templates can be reused over multiple sets of XML. Thus this function can be called multiple times with different XML input documents. If a different output data stream is used each time (i.e., pTransformResult parameter) a separate result will be generated on each call. So for example, the following call sequences are possible with the same p6IXSLT component:

* compileTemplates( XSL template1 )...
* startTransform( XML document1 )
* continueTransform( rest of XML document1 )
* startTransform( XML document2 )
* compileTempates( XSL template2 )....
* startTransform( XML document3 )...
*
Parameters
pTransformResult[ in ] Created by caller, the output of the transformation process is written to this stream.
pBuffer[ in ] All or part of the XML (or JSON) to be transformed by a previously compiled XSLT stylesheet
bufSize[ in ] The number of characters in the buffer pointed to by pBuffer
isLast[ in ] pBuffer contains all the XML to transform?
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to intialize() must be made before calling this funciton.
P6R::eInvalidArgpTransforResult, pErrorResult, or pBuffer is NULL.
P6R::eInvalidStateThere are no compiled templates. A successful call to compileTemplates() must be done before calling this function.