doStreamingTranslate Function Translator XPath Functions

Native Format Builder Wizard 6-59 The following table describes the parameters used in the syntax for using this function: The streamingXPathContext parameter specifies the context for the streaming transformation and, it must conform to the following schema element: schema targetNamespace=… element name=streamingcontext complexType sequence element name=sourceSchema type=string element name=sourceRootElement type=string element name=sourceType type=string element name=xsl type=string element name=targetSchema type=string element name=targetRootElement type=string element name=targetType type=string element name=batchSize type=string sequence complexType element schema In context:

6.3.2.4 Batching Transformation Features

This section discusses the following features of batching transformation: Parameter Description input Input data for the XPath function; the data can either be SDOM or an Attachment element. streamingXpathContext DOM representing the XPath context. targetType This parameter decides how the XPath function translates the input data into an attachment. This must be set to either SDOM or ATTACHMENT. attachmentElement This parameter is optional. This is the attachment to which the data is streamed. Schema Element Description sourceSchema Source NXSD schema used to translate a native data to XML. sourceRootElement Name of root element in source NXSD schema. sourceType Set this to either xml or native depending on the input data. xsl Relative path of the XSL file. targetSchema Target NXSD schema used to translate an XML into native data. targetRootElement Name of root element in target NXSD schema. targetType Set this to either xml or native depending on the output data. batchSize The number of elements after which the transformation engine flushes its memory. 6-60 Oracle Fusion Middleware Users Guide for Technology Adapters Applicability Batching transformation is applicable to: ■ Documents with repeating structure ■ XSLTs not requiring aggregation across entire document Batched Invocation of XSLT Engine The following procedure highlights the batched invocation of the XSLT engine: 1. Splitting the source document into multiple batches of one or more records 2. Performing the XSLT transformation one batch at a time 3. Combining the result of the XSLT invocation to a single target document Splitting or Combining Performed on the Fly The source documents are split and the results are combined into a target document: ■ Without any intermediate memory or disk storage ■ Through pipelining or intercepting SAX events Low In-Memory Footprint Batching transformation method uses low memory for the following tasks: ■ Transforming arbitrarily large XML documents, which are constrained by the target system ■ For standalone tests, 540 MB is transformed in less than 3 minutes Example 6–7 implements the FlatStructure FileAdapter sample using streaming transformation XPath functions. This sample use case translates the inbound native attachment from a CSV format to an XML format, and then applies the user-supplied XSL file to the resulting XML file. The transformed XML file is then translated into a fixed-length content represented by an attachment. Example 6–7 Using Streaming Transformation XPath Function 1. Define attachmentElement, as shown: schema targerNamespace=… element name=attachmentElement complexType attribute name=href type=string complexType element schema 2. Create a variable for the input attachment referring to the inbound csv file and the output attachment referring to the output fixed-length file. Create the variable corresponding to the streaming context. You must populate this variable before making a call to the XPath function. variables variable name=xlationContext element=client:streamingcontext variable name=inputAttachment element=client:attachmentElement variable name=returnAttachment element=client:attachmentElement variables - - Assign the input and output attachments - - assign name=assignValuesForAttachments