<?xml version="1.0" encoding="UTF-8"?><MetamergeConfig IDIversion="Created by TDI7.1 - 2010-05-11" created="Thu Sep 09 15:55:56 CEST 2010" createdBy="DK21740" modified="Thu Sep 09 15:55:56 CEST 2010" modifiedBy="DK21740" version="7.1">
    <Folder name="AssemblyLines">
        <AssemblyLine name="entry2XML">
            <Settings>
                <parameter name="ALPoolSettingsDialog">showALPoolSettings</parameter>
                <parameter name="automapattributes">false</parameter>
                <parameter name="createTombstones">false</parameter>
                <parameter name="debug">false</parameter>
                <parameter name="includeGlobalPrologs">true</parameter>
                <parameter name="nullBehaviorDialog">showNullBehavior</parameter>
            </Settings>
            <Hooks/>
            <CheckpointConfig/>
            <SandboxConfig/>
            <SimulationConfig>
                <SimulationStates>
                    <Component name="createWork" state="Enabled"/>
                    <Component name="dump" state="Enabled"/>
                    <Component name="xmlParser" state="Enabled"/>
                    <Component name="xmlParser(new)" state="Enabled"/>
                    <Component name="xslParser" state="Enabled"/>
                    <Component name="saxParser" state="Enabled"/>
                    <Component name="entry2XML" state="Enabled"/>
                    <Component name="entry_toXML" state="Enabled"/>
                    <Component name="xml_toXML" state="Enabled"/>
                </SimulationStates>
                <ProxySettings/>
            </SimulationConfig>
            <LogConfig/>
            <ContainerEF name="EntryFeedContainer"/>
            <ContainerDF name="DataFlowContainer">
                <ALMap name="createWork">
                    <AttributeMap name="Input">
                        <AttributeMapItem>
                            <Name>attr1</Name>
                            <Type>advanced</Type>
                            <Script>ret.value = "Single value";</Script>
                            <Simple>attr1</Simple>
                        </AttributeMapItem>
                        <AttributeMapItem>
                            <Name>attr2</Name>
                            <Type>advanced</Type>
                            <Script>ret.value = ["value1","value2"];</Script>
                            <Simple>attr2</Simple>
                        </AttributeMapItem>
                        <AttributeMapItem>
                            <Name>æøå</Name>
                            <Type>advanced</Type>
                            <Script>ret.value = ["æøå","ÆØÅ"];</Script>
                            <Simple>æøå</Simple>
                        </AttributeMapItem>
                    </AttributeMap>
                    <State>Enabled</State>
                </ALMap>
                <Connector name="dump">
                    <ConnectorMode>Script</ConnectorMode>
                    <ConnectorState>Enabled</ConnectorState>
                    <Configuration/>
                    <ConnectorScript>system.dumpEntry(work);</ConnectorScript>
                    <Parser>
                        <Schema name="Input">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                        <Schema name="Output">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                    </Parser>
                    <AttributeMap name="Input"/>
                    <AttributeMap name="Output"/>
                    <DeltaSettings>
                        <Driver>BTree</Driver>
                    </DeltaSettings>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <LinkCriteria/>
                    <Hooks/>
                    <CheckpointConfig/>
                    <SandboxConfig/>
                    <Reconnect>
                        <InheritFrom>[parent]</InheritFrom>
                        <ReconnectRules/>
                    </Reconnect>
                    <Operations/>
                    <PoolDefinition>
                        <InheritFrom>[parent]</InheritFrom>
                    </PoolDefinition>
                    <PoolInstance/>
                    <InitializeOption>0</InitializeOption>
                </Connector>
                <Connector name="xmlParser">
                    <ConnectorMode>Script</ConnectorMode>
                    <ConnectorState>Enabled</ConnectorState>
                    <Configuration/>
                    <ConnectorScript><![CDATA[var myEntry = work;

//Setup the XML parser
var xml = system.getParser("Parsers/xml");
if (xml == null) throw "Unable to get Parsers/xml";

os = new java.io.ByteArrayOutputStream();
xml.setOutputStream(os);

xml.initParser();

xml.writeEntry(myEntry);
xml.closeParser();

task.logmsg("This is the work entry as parsed with the XML (simple) parser : \n" + os.toString("UTF-8").trim() + "\n");]]></ConnectorScript>
                    <Parser>
                        <Schema name="Input">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                        <Schema name="Output">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                    </Parser>
                    <AttributeMap name="Input"/>
                    <AttributeMap name="Output"/>
                    <DeltaSettings>
                        <Driver>BTree</Driver>
                    </DeltaSettings>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <LinkCriteria/>
                    <Hooks/>
                    <CheckpointConfig/>
                    <SandboxConfig/>
                    <Reconnect>
                        <InheritFrom>[parent]</InheritFrom>
                        <ReconnectRules/>
                    </Reconnect>
                    <Operations/>
                    <PoolDefinition>
                        <InheritFrom>[parent]</InheritFrom>
                    </PoolDefinition>
                    <PoolInstance/>
                    <InitializeOption>0</InitializeOption>
                </Connector>
                <Script name="xmlParser(new)">
                    <parameter name="script"><![CDATA[var myEntry = work;

//Setup the StAX XML parser
var xml2 = system.getParser("Parsers/XML2");
if (xml2 == null) throw "Unable to get Parsers/XML2";

os = new java.io.ByteArrayOutputStream();
xml2.setOutputStream(os);

xml2.initParser();

xml2.writeEntry(myEntry);
xml2.closeParser();

task.logmsg("This is the work entry as parsed with the (StAX) XML parser : \n" + os.toString("UTF-8").trim() + "\n");]]></parameter>
                </Script>
                <Connector name="xslParser">
                    <ConnectorMode>Script</ConnectorMode>
                    <ConnectorState>Enabled</ConnectorState>
                    <Configuration/>
                    <ConnectorScript><![CDATA[var myEntry = work;

//Setup the xsl parser
var xsl = system.getParser("Parsers/xsl");
if (xsl == null) throw "Unable to get Parsers/xsl";

os = new java.io.ByteArrayOutputStream();
xsl.setOutputStream(os);

xsl.initParser();

xsl.writeEntry(myEntry);
xsl.closeParser();

task.logmsg("This is the work entry as parsed with the xsl parser : \n" + os.toString("UTF-8").trim() + "\n");]]></ConnectorScript>
                    <Parser>
                        <Schema name="Input">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                        <Schema name="Output">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                    </Parser>
                    <AttributeMap name="Input"/>
                    <AttributeMap name="Output"/>
                    <DeltaSettings>
                        <Driver>BTree</Driver>
                    </DeltaSettings>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <LinkCriteria/>
                    <Hooks/>
                    <CheckpointConfig/>
                    <SandboxConfig/>
                    <Reconnect>
                        <InheritFrom>[parent]</InheritFrom>
                        <ReconnectRules/>
                    </Reconnect>
                    <Operations/>
                    <PoolDefinition>
                        <InheritFrom>[parent]</InheritFrom>
                    </PoolDefinition>
                    <PoolInstance/>
                    <InitializeOption>0</InitializeOption>
                </Connector>
                <Connector name="saxParser">
                    <ConnectorMode>Script</ConnectorMode>
                    <ConnectorState>Enabled</ConnectorState>
                    <Configuration/>
                    <ConnectorScript><![CDATA[myXML = '<?xml version="1.0" encoding="UTF-8"?>\n';
myXML += '<DocRoot>\n';
myXML += '    <Entry>\n';
myXML += '        <Attribute name="attr2">\n';
myXML += '            <Value>value1</Value>\n';
myXML += '            <Value>value2</Value>\n';
myXML += '        </Attribute>\n';
myXML += '        <Attribute name="attr1">\n';
myXML += '            <Value>Single value</Value>'
myXML += '        </Attribute>\n';
myXML += '        <Attribute name="æøå">\n';
myXML += '            <Value>æøå</Value>\n';
myXML += '            <Value>ÆØÅ</Value>\n';
myXML += '        </Attribute>\n';
myXML += '    </Entry>\n';
myXML += '</DocRoot>\n';

isSAX = new java.io.ByteArrayInputStream(myXML.getBytes("UTF-8"));

//Setup the sax parser
var sax = system.getParser("Parsers/sax");
if (sax == null) throw "Unable to get Parsers/sax";

os = new java.io.ByteArrayOutputStream();

sax.setInputStream(isSAX);
sax.initParser();

task.logmsg("This is the work entry as parsed with the sax parser : \n" + system.dumpEntry(sax.readEntry()) + "\n");
	
]]></ConnectorScript>
                    <Parser>
                        <Schema name="Input">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                        <Schema name="Output">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                    </Parser>
                    <AttributeMap name="Input"/>
                    <AttributeMap name="Output"/>
                    <DeltaSettings>
                        <Driver>BTree</Driver>
                    </DeltaSettings>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <LinkCriteria/>
                    <Hooks/>
                    <CheckpointConfig/>
                    <SandboxConfig/>
                    <Reconnect>
                        <InheritFrom>[parent]</InheritFrom>
                        <ReconnectRules/>
                    </Reconnect>
                    <Operations/>
                    <PoolDefinition>
                        <InheritFrom>[parent]</InheritFrom>
                    </PoolDefinition>
                    <PoolInstance/>
                    <InitializeOption>0</InitializeOption>
                </Connector>
                <Connector name="entry2XML">
                    <ConnectorMode>Script</ConnectorMode>
                    <ConnectorState>Enabled</ConnectorState>
                    <Configuration/>
                    <ConnectorScript><![CDATA[myXMLUtils = new com.ibm.di.util.XMLUtils();
var myEntry = work;

task.logmsg("This is the work entry as converted with XMLUtils : \n" + myXMLUtils.entry2XML(myEntry).trim() + "\n");]]></ConnectorScript>
                    <Parser>
                        <Schema name="Input">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                        <Schema name="Output">
                            <InheritFrom>[parent]</InheritFrom>
                        </Schema>
                    </Parser>
                    <AttributeMap name="Input"/>
                    <AttributeMap name="Output"/>
                    <DeltaSettings/>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <LinkCriteria/>
                    <Hooks/>
                    <CheckpointConfig/>
                    <SandboxConfig/>
                    <Reconnect>
                        <InheritFrom>[parent]</InheritFrom>
                        <ReconnectRules/>
                    </Reconnect>
                    <Operations/>
                    <PoolDefinition>
                        <InheritFrom>[parent]</InheritFrom>
                    </PoolDefinition>
                    <PoolInstance/>
                    <InitializeOption>0</InitializeOption>
                </Connector>
                <Script name="entry_toXML">
                    <parameter name="script"><![CDATA[var myEntry = work;

task.logmsg("This is the work entry as converted with Entry.toXML() : \n" + myEntry.toXML().trim() + "\n");]]></parameter>
                </Script>
                <Script name="xml_toXML">
                    <parameter name="script"><![CDATA[myXML = new com.ibm.di.eclipse.http.XML()
var myEntry = work;

task.logmsg("This is the work entry as converted with XML.toXML() : \n" + myXML.toXML(myEntry).trim() + "\n");]]></parameter>
                </Script>
            </ContainerDF>
            <ThreadOptions/>
            <Operations/>
            <InitParams>
                <Schema name="AssemblyLineInitParams"/>
            </InitParams>
        </AssemblyLine>
        <AssemblyLine name="xsltTransforms">
            <Settings/>
            <Hooks/>
            <CheckpointConfig/>
            <SandboxConfig/>
            <SimulationConfig>
                <SimulationStates>
                    <Component name="xslTransformSimple" state="Enabled"/>
                    <Component name="xslTransformWithXslScript" state="Enabled"/>
                    <Component name="xslTransformWithParams" state="Enabled"/>
                </SimulationStates>
                <ProxySettings/>
            </SimulationConfig>
            <LogConfig/>
            <ContainerEF name="EntryFeedContainer"/>
            <ContainerDF name="DataFlowContainer">
                <Script name="xslTransformSimple">
                    <parameter name="script"><![CDATA[myXML = '<?xml version="1.0" encoding="UTF-8"?><level1>some text<level2>ÆØÅæøå</level2></level1>' + "\n";
myXSL = '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml" encoding="UTF-8"/><xsl:template match="node()|@*"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template></xsl:stylesheet>' + "\n";

xmlOut = system.xslTransform(myXSL,myXML);

task.logmsg("xmlOut : \n" + xmlOut);]]></parameter>
                </Script>
                <Script name="xslTransformWithXslScript">
                    <parameter name="script"><![CDATA[myXML = system.getScriptText("XML_simpleXml");
myXSL = system.getScriptText("XSL_IdentityTransform");

xmlOut = system.xslTransform(myXSL,myXML);

task.logmsg("xmlOut : \n" + xmlOut);]]></parameter>
                </Script>
                <Script name="xslTransformWithParams">
                    <parameter name="script"><![CDATA[myXML = system.getScriptText("XML_entriesXml");
myXSL = system.getScriptText("XSL_paramTransform");

myParam = [];
xmlOut = xslTransformWithParams(myXSL,myXML,myParam);

task.logmsg("Calling with no parameters - xmlOut : \n" + xmlOut);

myParam = [["ID","3"]];
xmlOut = xslTransformWithParams(myXSL,myXML,myParam);

task.logmsg("Calling with ID=3 parameter - xmlOut : \n" + xmlOut);]]></parameter>
                </Script>
            </ContainerDF>
            <ThreadOptions/>
            <Operations/>
            <InitParams>
                <Schema name="AssemblyLineInitParams"/>
            </InitParams>
        </AssemblyLine>
        <AssemblyLine name="xsltWithJava">
            <Settings/>
            <Hooks/>
            <CheckpointConfig/>
            <SandboxConfig/>
            <SimulationConfig>
                <SimulationStates>
                    <Component name="UsingJavaUppercaseMethod" state="Enabled"/>
                    <Component name="UsingJavaGoogleTranslate" state="Enabled"/>
                    <Component name="UsingJavaGoogleTranslateValidationFails" state="Enabled"/>
                    <Component name="UsingJavaGoogleTranslateValidation" state="Enabled"/>
                </SimulationStates>
                <ProxySettings/>
            </SimulationConfig>
            <LogConfig/>
            <ContainerEF name="EntryFeedContainer"/>
            <ContainerDF name="DataFlowContainer">
                <Script name="UsingJavaUppercaseMethod">
                    <parameter name="script"><![CDATA[myXML = system.getScriptText("XHTML_simplePage");
myXSL = system.getScriptText("XSL_XSLTWithJavaString");

myParam = [];
xmlOut = xslTransformWithParams(myXSL,myXML,myParam);

task.logmsg("All text into uppercase - xmlOut : \n" + xmlOut);]]></parameter>
                </Script>
                <Script name="UsingJavaGoogleTranslate">
                    <parameter name="script"><![CDATA[myXML = system.getScriptText("XHTML_simplePage");
myXSL = system.getScriptText("XSL_XSLTWithJavaGoogleTranslate");

myParam = [];
xmlOut = xslTransformWithParams(myXSL,myXML,myParam);

task.logmsg("All text translated into Danish - xmlOut : \n" + xmlOut);]]></parameter>
                </Script>
                <Script name="UsingJavaGoogleTranslateValidationFails">
                    <parameter name="script"><![CDATA[myXML = system.getScriptText("XHTML_simplePageWithValidation");
myXSL = system.getScriptText("XSL_XSLTWithJavaGoogleTranslate");

myParam = [];
xmlOut = xslTransformWithParams(myXSL,myXML,myParam);

task.logmsg("All text translated into Danish - xmlOut : \n" + xmlOut);]]></parameter>
                </Script>
                <Script name="UsingJavaGoogleTranslateValidation">
                    <parameter name="script"><![CDATA[myXML = system.getScriptText("XHTML_simplePageWithValidation");
myXSL = system.getScriptText("XSL_XSLTWithJavaGoogleTranslate");

xmlOut = xslTransformWithValidation(myXSL,myXML);

task.logmsg("All text translated into Danish - xmlOut : \n" + xmlOut);]]></parameter>
                </Script>
            </ContainerDF>
            <ThreadOptions/>
            <Operations/>
            <InitParams>
                <Schema name="AssemblyLineInitParams"/>
            </InitParams>
        </AssemblyLine>
    </Folder>
    <Folder name="Connectors"/>
    <Folder name="Parsers">
        <Parser name="xml">
            <InheritFrom>system:/Parsers/ibmdi.XML</InheritFrom>
            <parameter name="debug">false</parameter>
            <parameter name="isnamespaceaware">false</parameter>
            <parameter name="isvalidating">false</parameter>
            <parameter name="omitxmldeclaration">true</parameter>
            <Schema name="Input">
                <InheritFrom>[parent]</InheritFrom>
            </Schema>
            <Schema name="Output">
                <InheritFrom>[parent]</InheritFrom>
            </Schema>
        </Parser>
        <Parser name="sax">
            <InheritFrom>system:/Parsers/ibmdi.XMLSax</InheritFrom>
            <parameter name="debug">false</parameter>
            <parameter name="isnamespaceaware">false</parameter>
            <parameter name="isvalidating">false</parameter>
            <Schema name="Input">
                <InheritFrom>[parent]</InheritFrom>
            </Schema>
            <Schema name="Output">
                <InheritFrom>[parent]</InheritFrom>
            </Schema>
        </Parser>
        <Parser name="xsl">
            <UserComment/>
            <InheritFrom>system:/Parsers/ibmdi.XSLbasedXMLParser</InheritFrom>
            <parameter name="In_XSL_isFile">false</parameter>
            <parameter name="InputXSL"/>
            <parameter name="Out_XSL_isFile">false</parameter>
            <parameter name="OutputXSL"><![CDATA[<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:strip-space elements="*" />
	<xsl:output indent="yes" method="xml" />

	<xsl:template match="/">
		<xsl:copy-of select="." />
	</xsl:template>

</xsl:stylesheet>
]]></parameter>
            <parameter name="debug">false</parameter>
            <parameter name="isnamespaceaware">false</parameter>
            <parameter name="isvalidating">false</parameter>
            <parameter name="omitxmldeclaration">true</parameter>
            <parameter name="userComment"/>
            <Schema name="Input">
                <InheritFrom>[parent]</InheritFrom>
            </Schema>
            <Schema name="Output">
                <InheritFrom>[parent]</InheritFrom>
            </Schema>
        </Parser>
        <Parser name="XML2">
            <UserComment/>
            <InheritFrom>system:/Parsers/ibmdi.XML2</InheritFrom>
            <parameter name="debug">true</parameter>
            <parameter name="entry.tag">Entry</parameter>
            <parameter name="omit.xml.decl.on.writing">true</parameter>
            <parameter name="userComment"/>
            <parameter name="value.tag">ValueTag</parameter>
            <parameter name="xpath.expr">*</parameter>
            <Schema name="Input">
                <InheritFrom>[parent]</InheritFrom>
            </Schema>
            <Schema name="Output">
                <InheritFrom>[parent]</InheritFrom>
            </Schema>
        </Parser>
    </Folder>
    <Folder name="Scripts">
        <Script name="XML_simpleXml">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<level1>
some text
<level2>
ÆØÅæøå
</level2>
</level1>]]></parameter>
        </Script>
        <Script name="SCRIPT_javaTransform">
            <parameter name="autoInclude">true</parameter>
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[function xslTransform( xsl, xml ) {

	os = new java.io.ByteArrayOutputStream();
	is = new java.io.ByteArrayInputStream(xsl.getBytes("UTF-8"));
	ss = new javax.xml.transform.stream.StreamSource(is);
	is1 = new java.io.ByteArrayInputStream(xml.getBytes("UTF-8"));
	ss1 = new javax.xml.transform.stream.StreamSource(is1);
	sr = new javax.xml.transform.stream.StreamResult(os);
	transformerfactory = javax.xml.transform.TransformerFactory.newInstance();
	transformer = transformerfactory.newTransformer(ss);
	// Set the output encoding
	outputEncoding = transformer.getOutputProperty("encoding")
	transformer.transform(ss1, sr);
	if (outputEncoding != null) {
		result = os.toString(outputEncoding); 
	} else {
		result = os.toString();
	}
	return result;
}]]></parameter>
        </Script>
        <Script name="XSL_IdentityTransform">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>]]></parameter>
        </Script>
        <Script name="XSL_NormalizeXml">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xslt" version="1.0">
	<xsl:strip-space elements="*"/>
	<xsl:output method="xml" indent="yes" encoding="utf-8" cdata-section-elements="SCRIPT ACCESS_PARAMETER_VALUE" omit-xml-declaration="yes" xalan:indent-amount="3"/>

	<xsl:template match="@* | node()">
		<xsl:copy>
			<xsl:apply-templates select="@* | node()"/>
		</xsl:copy>
	</xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <xsl:for-each select="@*">
        <xsl:sort/>
        <xsl:copy/>
      </xsl:for-each>
    </xsl:copy>
  </xsl:template>

	
  <xsl:template match="*">
    <xsl:copy>
      <xsl:for-each select="@*">
        <xsl:sort select="name(.)"/>
        <xsl:copy/>
      </xsl:for-each>
      <xsl:apply-templates>
        <xsl:sort select="name(.)"/>
      </xsl:apply-templates>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>]]></parameter>
        </Script>
        <Script name="SCRIPT_javaTransformWithParams">
            <parameter name="autoInclude">true</parameter>
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[function xslTransformWithParams( xsl, xml, params ) {

	os = new java.io.ByteArrayOutputStream();
	is = new java.io.ByteArrayInputStream(xsl.getBytes("UTF-8"));
	ss = new javax.xml.transform.stream.StreamSource(is);
	is1 = new java.io.ByteArrayInputStream(xml.getBytes("UTF-8"));
	ss1 = new javax.xml.transform.stream.StreamSource(is1);
	sr = new javax.xml.transform.stream.StreamResult(os);
	transformerfactory = javax.xml.transform.TransformerFactory.newInstance();
	transformer = transformerfactory.newTransformer(ss);
	// Add paramaters to the transform
	for (i=0; i<params.length; i++) {
		transformer.setParameter((params[i])[0],(params[i])[1]);
	}
	// Set the output encoding
	outputEncoding = transformer.getOutputProperty("encoding")
	transformer.transform(ss1, sr);
	if (outputEncoding != null) {
		result = os.toString(outputEncoding);
	} else {
		result = os.toString();
	}
	return result;
}]]></parameter>
        </Script>
        <Script name="XML_entriesXml">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<entries>
	<entry id="1">
	this is text one
	</entry>
	<entry id="2">
	this is text two
	</entry>
	<entry id="3">
	this is text three
	</entry>
</entries>]]></parameter>
        </Script>
        <Script name="XSL_paramTransform">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="text" encoding="utf-8" omit-xml-declaration="yes"/>
	<xsl:param name="ID">2</xsl:param>
	<xsl:template match="@*|node()">
		<xsl:apply-templates select="//entry[@id=$ID]"/>
	</xsl:template>
	
	<xsl:template match="//entry[@id=$ID]">
		<xsl:copy-of select="."/>
	</xsl:template>
</xsl:stylesheet>]]></parameter>
        </Script>
        <Script name="XHTML_simplePage">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<html lang="en-us" xml:lang="en-us">
<body>
<h1>This is a heading</h1>
And here goes the text
</body>
</html>]]></parameter>
        </Script>
        <Script name="XHTML_simplePageWithValidation">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<body>
<h1>This is a heading</h1>
And here goes the text
</body>
</html>]]></parameter>
        </Script>
        <Script name="XSL_XSLTWithJavaString">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version = "1.0"
	xmlns:string="xalan://java.lang.String">

<xsl:output method="html" indent="yes"/>

<xsl:template match='/'>
<xsl:apply-templates/>
</xsl:template>

<xsl:template match='*'>
  <xsl:copy>
    <xsl:apply-templates select='*|comment()|@*|text()'/>
  </xsl:copy>
</xsl:template>

<xsl:template match='@*'>
     <xsl:attribute name="{name(.)}">
        <xsl:value-of select="normalize-space(.)"/>
      </xsl:attribute>
</xsl:template>

<xsl:template match="comment()">
  <xsl:comment>
    <xsl:value-of select="normalize-space(.)"/>
  </xsl:comment>
</xsl:template>

<xsl:template match="text()">
	<xsl:if test="string-length(normalize-space(.)) &gt; 0">
		<xsl:variable name="myText" select="string:new(.)" />
		<xsl:value-of select="string:toUpperCase($myText)"/>
	</xsl:if>
</xsl:template>

</xsl:stylesheet>]]></parameter>
        </Script>
        <Script name="SCRIPT_XSLTWthJavaFixBadTranslations">
            <parameter name="autoInclude">true</parameter>
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[//Fix known error - currently Danish is supported indiscriminitly
function fixTranslation(myTranslatedText,language){

	if (language.equals("DA")) {	
		//Fix bad translations
		myTranslatedText = myTranslatedText.replaceAll('Du gemt','Du har gemt'); 
		//  Use this template to add additional reoccurrant errors
		//  myTranslatedText = myTranslatedText.replaceAll('Du','Dut'); 
		//	myTranslatedText = myTranslatedText.replaceAll('Du','Dut'); 
		//	myTranslatedText = myTranslatedText.replaceAll('Du','Dut'); 
		//	myTranslatedText = myTranslatedText.replaceAll('Du','Dut'); 
		//	myTranslatedText = myTranslatedText.replaceAll('Du','Dut');
	}	else {
		// add other languages later on....
	}		 

		return myTranslatedText;
}]]></parameter>
        </Script>
        <Script name="SCRIPT_XSLTWithJavaGoogleTranslate">
            <parameter name="autoInclude">true</parameter>
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[//Perform translation using the google translation api
//relies on the availability of google-api-translate-java-0.51.jar in jarpath
//Modified to read from/to language from external property file
function googleTranslate(inputText) {
	myText = new java.lang.String(inputText);
	translatedText = new java.lang.String();
	fromLanguage = new java.lang.String();
	toLanguage = new java.lang.String();

	fromLanguage = com.google.api.translate.Language.ENGLISH;
	toLanguage = com.google.api.translate.Language.DANISH;

	//Translate
	try {
		myTranslatedText = com.google.api.translate.Translate.translate(myText, fromLanguage, toLanguage);
	}
	catch (ex) {
		//retry if it fails
		myTranslatedText = com.google.api.translate.Translate.translate(myText, fromLanguage, toLanguage);
	}

	myTranslatedText = myTranslatedText.replaceAll('\\[\\(([0-9])\\)\\]','[ {$1} ]'); // fix "[(<n>)]" to "[ {<n>} ]"
	myTranslatedText = myTranslatedText.replaceAll('\\(([0-9])\\)','{$1}'); // fix "(<n)" to "{<n>}"
	myTranslatedText = myTranslatedText.replaceAll('&quot;','"'); // fix &quot; to " 
	myTranslatedText = myTranslatedText.replaceAll('\\ " ([^\\\\]) \\ "','\"$1\" '); // fix '\ "' to '\ '
	myTranslatedText = myTranslatedText.replaceAll('\\.</b>','</b>\\.'); // fix '.</b>' to '</b>.'
	myTranslatedText = myTranslatedText.replaceAll(' \\\\ N','\\\\n'); // fix '\ N' to '\n'
	
	// Escape quotes
	myTranslatedText = myTranslatedText.replaceAll('"','\\\\"'); 

	//Fix bad translations
	myTranslatedText = fixTranslation(myTranslatedText,"DA");

	//task.logmsg("DEBUG","Original text : " + myText + " - Translated text : " + myTranslatedText);

	return(myTranslatedText);
}]]></parameter>
        </Script>
        <Script name="XSL_XSLTWithJavaGoogleTranslate">
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version = "1.0"
	xmlns:string="xalan://java.lang.String"
	xmlns:se="xalan://com.ibm.di.script.ScriptEngine"
	xmlns:itdi="xalan://com.ibm.di.function.UserFunctions" >

<xsl:output method="html" indent="yes"/>

<xsl:template match='/'>
<xsl:apply-templates/>
</xsl:template>

<xsl:template match='*'>
  <xsl:copy>
    <xsl:apply-templates select='*|comment()|@*|text()'/>
  </xsl:copy>
</xsl:template>

<xsl:template match='@*'>
     <xsl:attribute name="{name(.)}">
        <xsl:value-of select="normalize-space(.)"/>
      </xsl:attribute>
</xsl:template>

<xsl:template match="comment()">
  <xsl:comment>
    <xsl:value-of select="normalize-space(.)"/>
  </xsl:comment>
</xsl:template>

<xsl:template match="text()">
<xsl:variable name="myServer" select="itdi:getServer()" />
<xsl:variable name="mySE" select="se:new('javascript',$myServer)" />
<xsl:variable name="temp0" select="se:loadScript($mySE,$myServer,'myContext','SCRIPT_XSLTWithJavaGoogleTranslate','true')" />
<xsl:if test="string-length(normalize-space(.)) &gt; 0">
<xsl:comment><xsl:text> </xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text></xsl:comment>
<xsl:text>
</xsl:text>
<xsl:variable name="myParam" select="string:split(normalize-space(.),'$')" />
<xsl:value-of select="se:call($mySE,'googleTranslate',$myParam)"/>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>

</xsl:stylesheet>]]></parameter>
        </Script>
        <Script name="SCRIPT_javaTransformWithValidation">
            <parameter name="autoInclude">true</parameter>
            <parameter name="includeFiles"/>
            <parameter name="script"><![CDATA[//Support DTD checking suppression
//and Catalog support

function xslTransformWithValidation( xsl, xml ) {

//Set up SAX inputSource for xsl stylesheet
	ssr = new java.io.StringReader(xsl);
	inps = new org.xml.sax.InputSource(ssr);

//Set up SAX inputSource for xml data
	ssr1 = new java.io.StringReader(xml);
	inps1 = new org.xml.sax.InputSource(ssr1);

//Set up XMLReader and turn off validation
	xr = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
	xr.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",false); // Does not work

//Set up Catalog resolver - catalog.properties must be in <TDI_HOME>/classes 
//If validation is swithced off this will NOT be used...
	cr = new org.apache.xml.resolver.tools.CatalogResolver();
	xr.setEntityResolver(cr);

//Create SAXSource for xsl and associate it with the XMLReader
	saxs = new javax.xml.transform.sax.SAXSource(xr,inps);
	saxs.setXMLReader(xr);

//Create SAXSource for xml and associate it with the XMLReader
	saxs1 = new javax.xml.transform.sax.SAXSource(xr,inps1);
	saxs1.setXMLReader(xr);

//Create OutputStream for the transformation
	os = new java.io.ByteArrayOutputStream();
	sr = new javax.xml.transform.stream.StreamResult(os);

//Setup the transformer and transform...
	transformerfactory = javax.xml.transform.sax.SAXTransformerFactory.newInstance();
	transformer = transformerfactory.newTransformer(saxs);
	outputEncoding = transformer.getOutputProperty("encoding")
	transformer.transform(saxs1, sr);
	if (outputEncoding != null) {
		result = os.toString(outputEncoding); // This is difference to system.xslTransform
	} else {
		result = os.toString();
	}
	return result;
}]]></parameter>
        </Script>
    </Folder>
    <JavaLibraries/>
    <JavaProperties/>
    <Folder name="Includes"/>
    <Folder name="Config">
        <LogConfig name="Logging"/>
        <InstanceProperties name="AutoStart">
            <AutoStart/>
        </InstanceProperties>
        <TombstonesConfig name="Tombstones"/>
        <SolutionInterface name="SolutionInterface">
            <PollInterval>-1</PollInterval>
            <InstanceID/>
            <enabled>true</enabled>
        </SolutionInterface>
    </Folder>
    <Folder name="Functions"/>
    <Folder name="AttributeMaps"/>
    <Properties name="Properties">
        <Stores>
            <PropertyStore name="Solution-Properties">
                <Parser>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                </Parser>
                <RawConnector>
                    <InheritFrom>system:/Connectors/ibmdi.Properties</InheritFrom>
                    <parameter name="collectionType">Solution-Properties</parameter>
                </RawConnector>
                <Key>key</Key>
                <Value>value</Value>
                <ReadOnly>false</ReadOnly>
                <InitialLoad>true</InitialLoad>
                <CacheTimeout>0</CacheTimeout>
            </PropertyStore>
            <PropertyStore name="Global-Properties">
                <Parser>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                </Parser>
                <RawConnector>
                    <InheritFrom>system:/Connectors/ibmdi.Properties</InheritFrom>
                    <parameter name="collectionType">Global-Properties</parameter>
                </RawConnector>
                <Key>key</Key>
                <Value>value</Value>
                <ReadOnly>false</ReadOnly>
                <InitialLoad>true</InitialLoad>
                <CacheTimeout>0</CacheTimeout>
            </PropertyStore>
            <PropertyStore name="System-Properties">
                <Parser>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                </Parser>
                <RawConnector>
                    <InheritFrom>system:/Connectors/ibmdi.Properties</InheritFrom>
                    <parameter name="collectionType">System-Properties</parameter>
                </RawConnector>
                <Key>key</Key>
                <Value>value</Value>
                <ReadOnly>false</ReadOnly>
                <InitialLoad>true</InitialLoad>
                <CacheTimeout>0</CacheTimeout>
            </PropertyStore>
            <PropertyStore name="ParserTest">
                <Parser>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                </Parser>
                <RawConnector>
                    <InheritFrom>system:/Connectors/ibmdi.Properties</InheritFrom>
                    <parameter name="collection">@SUBSTITUTE{config.$directory}/ParserTest.properties</parameter>
                    <parameter name="collectionType">ParserTest</parameter>
                </RawConnector>
                <Key>key</Key>
                <Value>value</Value>
                <ReadOnly>false</ReadOnly>
                <InitialLoad>true</InitialLoad>
                <CacheTimeout>0</CacheTimeout>
            </PropertyStore>
            <PropertyStore name="Java-Properties">
                <Parser>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                </Parser>
                <RawConnector>
                    <InheritFrom>system:/Connectors/ibmdi.Properties</InheritFrom>
                    <parameter name="collection">@SUBSTITUTE{config.$directory}/ParserTest.properties</parameter>
                    <parameter name="collectionType">Java-Properties</parameter>
                </RawConnector>
                <Key>key</Key>
                <Value>value</Value>
                <ReadOnly>false</ReadOnly>
                <InitialLoad>true</InitialLoad>
                <CacheTimeout>0</CacheTimeout>
            </PropertyStore>
            <PropertyStore name="AdvancedXML">
                <Parser>
                    <Schema name="Input">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                    <Schema name="Output">
                        <InheritFrom>[parent]</InheritFrom>
                    </Schema>
                </Parser>
                <RawConnector>
                    <InheritFrom>system:/Connectors/ibmdi.Properties</InheritFrom>
                    <parameter name="collection">@SUBSTITUTE{config.$directory}/ParserTest.properties</parameter>
                    <parameter name="collectionType">Default</parameter>
                </RawConnector>
                <Key>key</Key>
                <Value>value</Value>
                <ReadOnly>false</ReadOnly>
                <InitialLoad>true</InitialLoad>
                <CacheTimeout>0</CacheTimeout>
            </PropertyStore>
        </Stores>
    </Properties>
</MetamergeConfig>