IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Mapping XML tags that have values and attributes

    Posted 10/13/09 08:01 PM

    Originally posted by: Stingray123


    I have an xml file (see below) and created a schema (see below) in order to generate the type tree. When trying to create map rules, I cannot figure out how to populate the "parameter" tag. I can populate the "name" attribute for the parameter tag without an issue, but any time I try to enter a rule that evaluates to the value I want populated in the "parameter" tag, I just get a build error like the one below.

    Map: HL7_in Output: parameter [1]:method:hsp_canonicalgrammar_request Element:Global:output1
    Output argument of rule does not match output type: ="sampleText"

    I understand the fact that the "parameter" tag is defined as a Group Class in the type tree and that I am getting this error because I cannot simply assign a text value to "parameter" since WTX is expecting the rule for "parameter" to evaluate to a "paramater" object as opposed to a string. But I need to assign a string value as indicated in the sample XML below, and I cannot figure out anyway to do it. Any help would be greatly appreciated.

    SAMPLE XML
    <?xml version="1.0" encoding="UTF-8"?>

    <hsp_canonicalgrammar_request>

    <header>
    <UUID_Consumer>7c8e547b-c8c4-4b6b-b178-a0c7b4a8def0</UUID_Consumer>
    <UserId>lnardle@hotmail.com</UserId>
    <UserName>Larry Nardle</UserName>
    <UserOrganization>NC HIE</UserOrganization>
    <UserRole>Administrator</UserRole>
    <UserEmail>lnardle@hotmail.com</UserEmail>
    <PurposeForUse>TREATMENT</PurposeForUse>
    </header>

    <method name="findSubjectsByDemographics">
    <parameter name="fname">Kamri</parameter>
    <parameter name="lname">Franklin</parameter>
    <parameter name="mname" />
    <parameter name="suffix" />
    <parameter name="dob" />
    <parameter name="gender">F</parameter>
    </method>

    </hsp_canonicalgrammar_request>

    SAMPLE SCHEMA
    <?xml version="1.0" encoding="UTF-8" ?>

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="UUID_Consumer" type="xs:string"/>
    <xs:element name="UserId" type="xs:string"/>
    <xs:element name="UserName" type="xs:string"/>
    <xs:element name="UserOrganization" type="xs:string"/>
    <xs:element name="UserRole" type="xs:string"/>
    <xs:element name="UserEmail" type="xs:string"/>
    <xs:element name="PurposeForUse" type="xs:string"/>
    <xs:element name="parameter" type="parameterType"/>
    <xs:element name="header" type="headerType"/>
    <xs:element name="method" type="methodType"/>

    <xs:attribute name="name" type="xs:string"/>

    <xs:complexType name="headerType">
    <xs:sequence>
    <xs:element ref="UUID_Consumer"/>
    <xs:element ref="UserId"/>
    <xs:element ref="UserName"/>
    <xs:element ref="UserOrganization"/>
    <xs:element ref="UserRole"/>
    <xs:element ref="UserEmail"/>
    <xs:element ref="PurposeForUse"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="parameterType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute ref="name" use="required"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>

    <xs:complexType name="methodType">
    <xs:sequence>
    <xs:element ref="parameter" minOccurs="6" maxOccurs="6"/>
    </xs:sequence>
    <xs:attribute ref="name" use="required"/>
    </xs:complexType>

    <xs:element name="hsp_canonicalgrammar_request">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="header"/>
    <xs:element ref="method"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>

    </xs:schema>
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: Mapping XML tags that have values and attributes

    Posted 10/15/09 07:28 AM

    Originally posted by: SystemAdmin


    You didn't mention the WTX version, or whether you selected "Xerces" or "Classic" validation when you were importing the schema to build the type tree. I created a type tree and simple map using "Xerces" validation and it produced the group and items names shown below.

    Are you trying to enter your rule on a "parameter" line or on a "Value parameterType Type" line?

    You should be entering a rule on a "Value parameterType Type" line which is defined as an item. Here should be able to enter a straight text string value or some type of rule that results in a text string.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender