Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


No Format
<?xml version="1.0"?>
<smooks-resource-list xmlns=""

    Filter the message using the SAX Filter (i.e. not DOM, so no
    intermediate DOM, sofor wethe can"complete" processmessage huge messages- there are "mini" DOMs
    for the NodeModels below)....
        <param name="stream.filter.type">SAX</param>
        <param name="default.serialization.on">false</param>

    Create 2 NodeModels.  One high level model for the "order"
    (header etc) and then one per "order-item".

    These models are used in the FreeMarker templating resources
    defined below.  You need to make sure you set the selector such
    that the total memory footprint is as low as possible.  In this
    example, the "order" model will contain everything accept the
    <order-item> data (the main bulk of data in the message).  The
    "order-item" model only contains the current <order-item> data
    (i.e. there's max 1 order-item in memory at any one time).
    <resource-config selector="order,order-item">

    Apply the first part of the template when we reach the start
    of the <order-items> element.  Apply the second part when we
    reach the end.

    Note the <?TEMPLATE-SPLIT-PI?> Processing Instruction in the
    template.  This tells Smooks where to split the template,
    resulting in the order-items being inserted at this point.
    <resource-config selector<ftl:freemarker applyOnElement="order-items">
        <resource type="ftl"><<ftl:template><!--<salesorder>

    Output the <order-items> elements.  This will appear in the
    output message where the <?TEMPLATE-SPLIT-PI?> token appears in the
    order-items template.
    <resource-config selector<ftl:freemarker applyOnElement="order-item">
        <resource type="ftl"><<ftl:template><!--        <item>


Executing the Transform