Remove empty nodes in the target structure

Hi,
My scenario is IDoc-XI-JDBC.
For one IDoc I need to update data in 4 tables. But if idoc contains ATWRT node then it should update 4 tables if not only first two tables.
For the statement 3 and 4, i have done the following mapping.
[ATWRT][collapseContexts]-[exists]--[if then][statement3]
but in the target sturcture I am getting blank node as following:
<statement3/>.
And because of this blank statement JDBC Adapter is throwing an error.
Can anyone help me how to remove this blank node from target structure.

Jwalith,
I hope you must have kept the Statement node occurrence as 0..xxxx(1 or n), if that's the case you don't need to check anything. Just map the ATWRT directly to Statement 3 and Statement 4.
By the way what's the occurence of ATWRT node ? I gave the above suggestion, keeping in mind that ATWRT node occurrence is 0..1.
If the occurrence of  ATWRT is not 0..Unbounded, then you can also use the below simple UDF.
ATWRT >UDF>Statement3
ATWRT >UDF>Statement4
UDF - Advanced(Queue), with one Parameter (
if( ATWRT.length >0)
result.addValue("");
else
result.addSuppress();
Thanks,
raj.

Similar Messages

  • How to remove a node from a target xml payload in reciever file channel

    i have a scenario where i have to remove a node from my target xml file in receiver file channel and want xml as the output file. I don't want a fixed length file. How to do that in receiver channel? Do we need to use file content conversion for that?

    that will result in giving you a fixed file or a separator defined file.
    it will not give you an XML file.
    In case you want a XML file, instead of using variable substitution, use Dynamic configuration and adapter specific properties.
    Some ref:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

  • How To Remove Empty Node From Source XML

    Hi,
    How can I remove an empty node from the source xml in a XSLT mapping.
    For e.g. If the source xml is like:
    <SRC>
    <Node1>SAP</Node2>
    <Node2/>
    <Node3>XI</Node3>
    </SRC>
    Then the xml should become:
    <SRC>
    <Node1>SAP</Node2>
    <Node3>XI</Node3>
    </SRC>
    I need to do this because the output of my XSLT mapping is showing blank spaces for each blank node.
    Thanks,
    Abhishek.

    Use <xsl:if>
    Or else you may find different options here
    http://www.dpawson.co.uk/xsl/sect2/N3328.html#d4804e304
    Regards,
    Prateek

  • Unable to remove empty nodes from Message

    Hello,
    I have message format like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:Enrollment xmlns:ns1="http://pac.bluecross.ca/Common/Types" xmlns:ns2="http://www.w3.org/2001/XMLSchema-instance">
      <ns1:Policies>
      <ns1:Policy>
      <ns1:Code>11140</ns1:Code>
      <ns1:Certificates>
      <ns1:Certificate>
      <ns1:Class>
      <ns1:Code>1</ns1:Code>
      <ns1:EffectiveDate>2009-05-09T00:00:00</ns1:EffectiveDate>
      </ns1:Class>
      <ns1:CurrentEmploymentRecord>
      <ns1:HoursWorked>20</ns1:HoursWorked>
      <ns1:Type>FullTimeHourly</ns1:Type>
      </ns1:CurrentEmploymentRecord>
      <ns1:CurrentIncome>
      <ns1:Amount>5000</ns1:Amount>
      <ns1:EffectiveDate>2014-01-01T00:00:00</ns1:EffectiveDate>
      <ns1:Frequency>BiWeekly</ns1:Frequency>
      <ns1:Type>Salary</ns1:Type>
      </ns1:CurrentIncome>
      <ns1:Dependents>
      <ns1:CoveredLife>
      <ns1:CoverageDeclines/>
      <ns1:CoveredLifeHolder>
      <ns1:Contacts/>
      <ns1:DefaultAddress/>
      <ns1:DefaultEmail/>
      <ns1:DefaultPhone/>
      <ns1:PreferredLanguage>ENG</ns1:PreferredLanguage>
      <ns1:DateOfBirth>2009-05-09T00:00:00</ns1:DateOfBirth>
      <ns1:FirstName>Sean Louis</ns1:FirstName>
      <ns1:LastName>Carrier</ns1:LastName>
      <ns1:***>Male</ns1:***>
      </ns1:CoveredLifeHolder>
      <ns1:DependentCategory>Child</ns1:DependentCategory>
      <ns1:DependentSubCategory>Minor</ns1:DependentSubCategory>
      <ns1:Number>03</ns1:Number>
      </ns1:CoveredLife>
      </ns1:Dependents>
      <ns1:Division>
      <ns1:Code>1</ns1:Code>
      <ns1:EffectiveDate>2009-05-09T00:00:00</ns1:EffectiveDate>
      </ns1:Division>
      <ns1:FamilyCategory>Family</ns1:FamilyCategory>
      <ns1:HealthCareSpendingAccountInformation/>
      <ns1:HireDate>2002-07-15T00:00:00</ns1:HireDate>
      <ns1:InsuredCoveredLife>
      <ns1:CoverageDeclines/>
      <ns1:CoveredLifeHolder>
      <ns1:Contacts/>
      <ns1:DefaultAddress ns2:type="ns1:CanadianAddress">
      <ns1:City>Surrey</ns1:City>
      <ns1:Country>CA</ns1:Country>
      <ns1:Line1>98 - 10752 Guildford Drive</ns1:Line1>
      <ns1:PostalCode>V3R 1W6</ns1:PostalCode>
      <ns1:Province>BC</ns1:Province>
      </ns1:DefaultAddress>
      <ns1:DefaultEmail>
      <ns1:CorrespondenceMethod>Email</ns1:CorrespondenceMethod>
      <ns1:CorrespondenceType>Home</ns1:CorrespondenceType>
      <ns1:Data>[email protected]</ns1:Data>
      </ns1:DefaultEmail>
      <ns1:DefaultPhone>
      <ns1:CorrespondenceMethod>Telephone</ns1:CorrespondenceMethod>
      <ns1:CorrespondenceType>Home</ns1:CorrespondenceType>
      <ns1:Data>(001)(555)555-5555</ns1:Data>
      </ns1:DefaultPhone>
      <ns1:PreferredContact>Mail</ns1:PreferredContact>
      <ns1:PreferredLanguage>ENG</ns1:PreferredLanguage>
      <ns1:DateOfBirth>1974-02-07T00:00:00</ns1:DateOfBirth>
      <ns1:FirstName>Krisztina</ns1:FirstName>
      <ns1:LastName>Carrier</ns1:LastName>
      <ns1:***>Female</ns1:***>
      </ns1:CoveredLifeHolder>
      <ns1:EffectiveDate>2007-06-01T00:00:00</ns1:EffectiveDate>
      <ns1:Status>Inforce</ns1:Status>
      </ns1:InsuredCoveredLife>
      <ns1:JobTitle>Recreation Leader 2</ns1:JobTitle>
      <ns1:Number>000050</ns1:Number>
      <ns1:Plan>
      <ns1:Code>9027380101</ns1:Code>
      <ns1:EffectiveDate>2009-05-09T00:00:00</ns1:EffectiveDate>
      </ns1:Plan>
      <ns1:RegionalAdministration>
      <ns1:Country>CA</ns1:Country>
      <ns1:ProvinceOfBilling>BC</ns1:ProvinceOfBilling>
      </ns1:RegionalAdministration>
      <ns1:Section/>
      </ns1:Certificate>
      </ns1:Certificates>
      </ns1:Policy>
    Here is my XSL for removing empty nodes:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:strip-space elements="*"/>
        <xsl:template match="node()|@*">
            <xsl:copy>
                <xsl:apply-templates select="node()|@*"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="*[not(@*) and not(*) and (not(text()) or .=-1)]"/>
    </xsl:stylesheet>
    This program removes all empty nodes except below nodes:
    <ns1:Dependents>
      <ns1:CoveredLife>
      <ns1:CoverageDeclines/>
      <ns1:CoveredLifeHolder>
      <ns1:Contacts/>
      <ns1:DefaultAddress/>
      <ns1:DefaultEmail/>
      <ns1:DefaultPhone/>
    Please throw some ideas.
    Thank you
    John

    Here is my XSD:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:tns="http://pac.bluecross.ca/Common/Types" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://pac.bluecross.ca/Common/Types" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="BusinessObject">
        <xs:sequence>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="BusinessObject" nillable="true" type="tns:BusinessObject" />
      <xs:simpleType name="CancelReasonCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="LaidOff">
          </xs:enumeration>
          <xs:enumeration value="Retired">
          </xs:enumeration>
          <xs:enumeration value="Divorced">
          </xs:enumeration>
          <xs:enumeration value="Separated">
          </xs:enumeration>
          <xs:enumeration value="NoLongerEligibleForCoverage">
          </xs:enumeration>
          <xs:enumeration value="MaternityLeave">
          </xs:enumeration>
          <xs:enumeration value="LeaveOfAbsense">
          </xs:enumeration>
          <xs:enumeration value="OnDisability">
          </xs:enumeration>
          <xs:enumeration value="PensionExpired">
          </xs:enumeration>
          <xs:enumeration value="StrikeOrLockout">
          </xs:enumeration>
          <xs:enumeration value="TransferredToAnotherCarrier">
          </xs:enumeration>
          <xs:enumeration value="WaivedBenefitsNoReason">
          </xs:enumeration>
          <xs:enumeration value="WaivedBenefitsSpousalCoverage">
          </xs:enumeration>
          <xs:enumeration value="LeftCompany">
          </xs:enumeration>
          <xs:enumeration value="DisContinuedCoverage">
          </xs:enumeration>
          <xs:enumeration value="NoProvincialMedicalPlan">
          </xs:enumeration>
          <xs:enumeration value="Transferred">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="CancelReasonCodes" nillable="true" type="tns:CancelReasonCodes" />
      <xs:simpleType name="CorrespondenceMethodCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Mail">
          </xs:enumeration>
          <xs:enumeration value="Telephone">
          </xs:enumeration>
          <xs:enumeration value="Email">
          </xs:enumeration>
          <xs:enumeration value="FTP">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="CorrespondenceMethodCodes" nillable="true" type="tns:CorrespondenceMethodCodes" />
      <xs:simpleType name="CorrespondenceTypeCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Home">
          </xs:enumeration>
          <xs:enumeration value="Office">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="CorrespondenceTypeCodes" nillable="true" type="tns:CorrespondenceTypeCodes" />
      <xs:simpleType name="CoveredLifeStatusCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Inforce">
          </xs:enumeration>
          <xs:enumeration value="Terminated">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="CoveredLifeStatusCodes" nillable="true" type="tns:CoveredLifeStatusCodes" />
      <xs:simpleType name="DependentCategoryCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Child">
          </xs:enumeration>
          <xs:enumeration value="Spouse">
          </xs:enumeration>
          <xs:enumeration value="Insured">
          </xs:enumeration>
          <xs:enumeration value="Dependent">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="DependentCategoryCodes" nillable="true" type="tns:DependentCategoryCodes" />
      <xs:simpleType name="DependentSubCategoryCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Student">
          </xs:enumeration>
          <xs:enumeration value="Minor">
          </xs:enumeration>
          <xs:enumeration value="CommonLaw">
          </xs:enumeration>
          <xs:enumeration value="Married">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="DependentSubCategoryCodes" nillable="true" type="tns:DependentSubCategoryCodes" />
      <xs:simpleType name="EmploymentTypeCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Director">
          </xs:enumeration>
          <xs:enumeration value="FullTimeSalary">
          </xs:enumeration>
          <xs:enumeration value="FullTimeHourly">
          </xs:enumeration>
          <xs:enumeration value="PartTimeSalary">
          </xs:enumeration>
          <xs:enumeration value="PartTimeHourly">
          </xs:enumeration>
          <xs:enumeration value="OwnerOperator">
          </xs:enumeration>
          <xs:enumeration value="Retired">
          </xs:enumeration>
          <xs:enumeration value="Seasonal">
          </xs:enumeration>
          <xs:enumeration value="Casual">
          </xs:enumeration>
          <xs:enumeration value="Client">
          </xs:enumeration>
          <xs:enumeration value="Consultant">
          </xs:enumeration>
          <xs:enumeration value="Contract">
          </xs:enumeration>
          <xs:enumeration value="ElectedOfficial">
          </xs:enumeration>
          <xs:enumeration value="JobShare">
          </xs:enumeration>
          <xs:enumeration value="Temporary">
          </xs:enumeration>
          <xs:enumeration value="Volunteer">
          </xs:enumeration>
          <xs:enumeration value="MSDRecipientnotEE">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="EmploymentTypeCodes" nillable="true" type="tns:EmploymentTypeCodes" />
      <xs:simpleType name="FamilyCategoryCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Single">
          </xs:enumeration>
          <xs:enumeration value="Family">
          </xs:enumeration>
          <xs:enumeration value="Couple">
          </xs:enumeration>
          <xs:enumeration value="NotApplicable">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="FamilyCategoryCodes" nillable="true" type="tns:FamilyCategoryCodes" />
      <xs:simpleType name="FrequencyCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Annual">
          </xs:enumeration>
          <xs:enumeration value="BiMonthly">
          </xs:enumeration>
          <xs:enumeration value="BiWeekly">
          </xs:enumeration>
          <xs:enumeration value="Hourly">
          </xs:enumeration>
          <xs:enumeration value="Monthly">
          </xs:enumeration>
          <xs:enumeration value="Quarterly">
          </xs:enumeration>
          <xs:enumeration value="SemiAnnually">
          </xs:enumeration>
          <xs:enumeration value="SemiMonthly">
          </xs:enumeration>
          <xs:enumeration value="Weekly">
          </xs:enumeration>
          <xs:enumeration value="LifeTime">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="FrequencyCodes" nillable="true" type="tns:FrequencyCodes" />
      <xs:simpleType name="IncomeTypeCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Salary">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="IncomeTypeCodes" nillable="true" type="tns:IncomeTypeCodes" />
      <xs:simpleType name="LanguageCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="ENG">
          </xs:enumeration>
          <xs:enumeration value="FRA">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="LanguageCodes" nillable="true" type="tns:LanguageCodes" />
      <xs:simpleType name="LineOfBusinessCategoryCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Health">
          </xs:enumeration>
          <xs:enumeration value="Dental">
          </xs:enumeration>
          <xs:enumeration value="Life">
          </xs:enumeration>
          <xs:enumeration value="AccidentalDeathAndDismemberment">
          </xs:enumeration>
          <xs:enumeration value="Disability">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="LineOfBusinessCategoryCodes" nillable="true" type="tns:LineOfBusinessCategoryCodes" />
      <xs:simpleType name="ProvinceCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="AB">
          </xs:enumeration>
          <xs:enumeration value="BC">
          </xs:enumeration>
          <xs:enumeration value="MB">
          </xs:enumeration>
          <xs:enumeration value="NB">
          </xs:enumeration>
          <xs:enumeration value="NL">
          </xs:enumeration>
          <xs:enumeration value="NT">
          </xs:enumeration>
          <xs:enumeration value="NS">
          </xs:enumeration>
          <xs:enumeration value="ON">
          </xs:enumeration>
          <xs:enumeration value="PE">
          </xs:enumeration>
          <xs:enumeration value="QC">
          </xs:enumeration>
          <xs:enumeration value="SK">
          </xs:enumeration>
          <xs:enumeration value="YT">
          </xs:enumeration>
          <xs:enumeration value="NU">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="ProvinceCodes" nillable="true" type="tns:ProvinceCodes" />
      <xs:simpleType name="ReapplicationReasonCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Exception">
          </xs:enumeration>
          <xs:enumeration value="Invalid">
          </xs:enumeration>
          <xs:enumeration value="Valid">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="ReapplicationReasonCodes" nillable="true" type="tns:ReapplicationReasonCodes" />
      <xs:simpleType name="SexCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Male">
          </xs:enumeration>
          <xs:enumeration value="Female">
          </xs:enumeration>
          <xs:enumeration value="NotApplicable">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="SexCodes" nillable="true" type="tns:SexCodes" />
      <xs:simpleType name="StateCodes">
        <xs:restriction base="xs:string">
          <xs:enumeration value="AL">
          </xs:enumeration>
          <xs:enumeration value="AK">
          </xs:enumeration>
          <xs:enumeration value="AZ">
          </xs:enumeration>
          <xs:enumeration value="AR">
          </xs:enumeration>
          <xs:enumeration value="CA">
          </xs:enumeration>
          <xs:enumeration value="Colorado">
          </xs:enumeration>
          <xs:enumeration value="CT">
          </xs:enumeration>
          <xs:enumeration value="DE">
          </xs:enumeration>
          <xs:enumeration value="DC">
          </xs:enumeration>
          <xs:enumeration value="FL">
          </xs:enumeration>
          <xs:enumeration value="GA">
          </xs:enumeration>
          <xs:enumeration value="HI">
          </xs:enumeration>
          <xs:enumeration value="ID">
          </xs:enumeration>
          <xs:enumeration value="IL">
          </xs:enumeration>
          <xs:enumeration value="IN">
          </xs:enumeration>
          <xs:enumeration value="IA">
          </xs:enumeration>
          <xs:enumeration value="KS">
          </xs:enumeration>
          <xs:enumeration value="KY">
          </xs:enumeration>
          <xs:enumeration value="LA">
          </xs:enumeration>
          <xs:enumeration value="ME">
          </xs:enumeration>
          <xs:enumeration value="MD">
          </xs:enumeration>
          <xs:enumeration value="MA">
          </xs:enumeration>
          <xs:enumeration value="MI">
          </xs:enumeration>
          <xs:enumeration value="MN">
          </xs:enumeration>
          <xs:enumeration value="MS">
          </xs:enumeration>
          <xs:enumeration value="MO">
          </xs:enumeration>
          <xs:enumeration value="MT">
          </xs:enumeration>
          <xs:enumeration value="NE">
          </xs:enumeration>
          <xs:enumeration value="NV">
          </xs:enumeration>
          <xs:enumeration value="NH">
          </xs:enumeration>
          <xs:enumeration value="NJ">
          </xs:enumeration>
          <xs:enumeration value="NM">
          </xs:enumeration>
          <xs:enumeration value="NY">
          </xs:enumeration>
          <xs:enumeration value="NC">
          </xs:enumeration>
          <xs:enumeration value="ND">
          </xs:enumeration>
          <xs:enumeration value="OH">
          </xs:enumeration>
          <xs:enumeration value="OK">
          </xs:enumeration>
          <xs:enumeration value="OR">
          </xs:enumeration>
          <xs:enumeration value="PA">
          </xs:enumeration>
          <xs:enumeration value="RI">
          </xs:enumeration>
          <xs:enumeration value="SC">
          </xs:enumeration>
          <xs:enumeration value="SD">
          </xs:enumeration>
          <xs:enumeration value="TN">
          </xs:enumeration>
          <xs:enumeration value="TX">
          </xs:enumeration>
          <xs:enumeration value="UT">
          </xs:enumeration>
          <xs:enumeration value="VT">
          </xs:enumeration>
          <xs:enumeration value="VA">
          </xs:enumeration>
          <xs:enumeration value="WA">
          </xs:enumeration>
          <xs:enumeration value="WV">
          </xs:enumeration>
          <xs:enumeration value="WI">
          </xs:enumeration>
          <xs:enumeration value="WY">
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="StateCodes" nillable="true" type="tns:StateCodes" />
      <xs:complexType name="Address">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="City" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Country" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line1" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line2" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line3" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line4" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Address" nillable="true" type="tns:Address" />
      <xs:complexType name="InternationalAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="Region" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="InternationalAddress" nillable="true" type="tns:InternationalAddress" />
      <xs:complexType name="CanadianAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Province" nillable="true" type="tns:ProvinceCodes" />
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="CanadianAddress" nillable="true" type="tns:CanadianAddress" />
      <xs:complexType name="AmericanAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="State" nillable="true" type="tns:StateCodes">
              </xs:element>
              <xs:element minOccurs="0" name="ZipCode" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="AmericanAddress" nillable="true" type="tns:AmericanAddress" />
      <xs:complexType name="Person">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Client">
            <xs:sequence>
              <xs:element minOccurs="0" name="DateOfBirth" nillable="true" type="xs:dateTime">
              </xs:element>
              <xs:element minOccurs="0" name="FirstName" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="LastName" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="MaidenName" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="MiddleName" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="PreferredName" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="***" type="tns:SexCodes">
              </xs:element>
              <xs:element minOccurs="0" name="Suffix" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Person" nillable="true" type="tns:Person" />
      <xs:complexType name="Client">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="Contacts" nillable="true" type="tns:ArrayOfContactInformation">
              </xs:element>
              <xs:element minOccurs="0" name="DefaultAddress" nillable="true" type="tns:Address">
              </xs:element>
              <xs:element minOccurs="0" name="DefaultEmail" nillable="true" type="tns:ContactInformation">
              </xs:element>
              <xs:element minOccurs="0" name="DefaultPhone" nillable="true" type="tns:ContactInformation">
              </xs:element>
              <xs:element minOccurs="0" name="PreferredContact" nillable="true" type="tns:CorrespondenceMethodCodes">
              </xs:element>
              <xs:element minOccurs="0" name="PreferredLanguage" nillable="true" type="tns:LanguageCodes">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Client" nillable="true" type="tns:Client" />
      <xs:complexType name="Division">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Structurable">
            <xs:sequence>
              <xs:element minOccurs="0" name="Code" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="SubDivisions" nillable="true" type="tns:ArrayOfDivision">
              </xs:element>
              <xs:element minOccurs="0" name="EffectiveDate" nillable="true" type="xs:dateTime">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Division" nillable="true" type="tns:Division" />
      <xs:complexType name="Structurable">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Structurable" nillable="true" type="tns:Structurable" />
      <xs:complexType name="CoveredLife">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="ApplicationDate" type="xs:dateTime">
              </xs:element>
              <xs:element minOccurs="0" name="CancelReason" nillable="true" type="tns:CancelReasonCodes">
              </xs:element>
              <xs:element minOccurs="0" name="CoverageDeclines" nillable="true" type="tns:ArrayOfBenefitDecline">
              </xs:element>
              <xs:element minOccurs="0" name="CoveredLifeHolder" nillable="true" type="tns:Person">
              </xs:element>
              <xs:element minOccurs="0" name="DependentCategory" nillable="true" type="tns:DependentCategoryCodes">
              </xs:element>
              <xs:element minOccurs="0" name="DependentSubCategory" nillable="true" type="tns:DependentSubCategoryCodes">
              </xs:element>
              <xs:element minOccurs="0" name="EffectiveDate" type="xs:dateTime">
              </xs:element>
              <xs:element minOccurs="0" name="Number" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="QualificationDate" type="xs:dateTime">
              </xs:element>
              <xs:element minOccurs="0" name="Status" nillable="true" type="tns:CoveredLifeStatusCodes">
              </xs:element>
              <xs:element minOccurs="0" name="TerminationDate" type="xs:dateTime">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="CoveredLife" nillable="true" type="tns:CoveredLife" />
      <xs:complexType name="Certificate">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="Class" nillable="true" type="tns:Class">
              </xs:element>
              <xs:element minOccurs="0" name="CurrentEmploymentRecord" nillable="true" type="tns:EmploymentRecord">
              </xs:element>
              <xs:element minOccurs="0" name="CurrentIncome" nillable="true" type="tns:Income">
              </xs:element>
              <xs:element minOccurs="0" name="Dependents" nillable="true" type="tns:ArrayOfCoveredLife">
              </xs:element>
              <xs:element minOccurs="0" name="Division" nillable="true" type="tns:Division">
              </xs:element>
              <xs:element minOccurs="0" name="FamilyCategory" nillable="true" type="tns:FamilyCategoryCodes">
              </xs:element>
              <xs:element minOccurs="0" name="HealthCareSpendingAccountInformation" nillable="true" type="tns:HealthCareSpendingAccountInformation">
              </xs:element>
              <xs:element minOccurs="0" name="HireDate" type="xs:dateTime">
              </xs:element>
              <xs:element minOccurs="0" name="InsuredCoveredLife" nillable="true" type="tns:CoveredLife">
              </xs:element>
              <xs:element minOccurs="0" name="JobTitle" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Number" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="PayrollNumber" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Plan" nillable="true" type="tns:Plan">
              </xs:element>
              <xs:element minOccurs="0" name="RegionalAdministration" nillable="true" type="tns:RegionalAdministrativeInformation">
              </xs:element>
              <xs:element minOccurs="0" name="Section" nillable="true" type="tns:Section">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Certificate" nillable="true" type="tns:Certificate" />
      <xs:complexType name="Policy">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Structurable">
            <xs:sequence>
              <xs:element minOccurs="0" name="Code" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Certificates" nillable="true" type="tns:ArrayOfCertificate">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Policy" nillable="true" type="tns:Policy" />
      <xs:complexType name="Class">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Structurable">
            <xs:sequence>
              <xs:element minOccurs="0" name="Code" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="EffectiveDate" type="xs:dateTime">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Class" nillable="true" type="tns:Class" />
      <xs:complexType name="Plan">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Structurable">
            <xs:sequence>
              <xs:element minOccurs="0" name="Code" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="EffectiveDate" type="xs:dateTime" />
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Plan" nillable="true" type="tns:Plan" />
      <xs:complexType name="ArrayOfPolicy">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Policy" nillable="true" type="tns:Policy" />
        </xs:sequence>
      </xs:complexType>
      <xs:element name="ArrayOfPolicy" nillable="true" type="tns:ArrayOfPolicy" />
      <xs:complexType name="BenefitDecline">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="ChangeEffectiveDate" nillable="true" type="xs:dateTime">
              </xs:element>
              <xs:element minOccurs="0" name="DeclineReason" nillable="true" type="tns:CancelReasonCodes">
              </xs:element>
              <xs:element minOccurs="0" name="Declined" nillable="true" type="xs:boolean">
              </xs:element>
              <xs:element minOccurs="0" name="LineOfBusinessCategory" nillable="true" type="tns:LineOfBusinessCategoryCodes">
              </xs:element>
              <xs:element minOccurs="0" name="ReapplicationReason" nillable="true" type="tns:ReapplicationReasonCodes">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="BenefitDecline" nillable="true" type="tns:BenefitDecline" />
      <xs:complexType name="ContactInformation">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="CorrespondenceMethod" nillable="true" type="tns:CorrespondenceMethodCodes">
              </xs:element>
              <xs:element minOccurs="0" name="CorrespondenceNote" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="CorrespondenceType" nillable="true" type="tns:CorrespondenceTypeCodes">
              </xs:element>
              <xs:element minOccurs="0" name="Data" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="ContactInformation" nillable="true" type="tns:ContactInformation" />
      <xs:complexType name="EmploymentRecord">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="EffectiveDate" type="xs:dateTime">
              </xs:element>
              <xs:element minOccurs="0" name="Frequency" nillable="true" type="tns:FrequencyCodes">
              </xs:element>
              <xs:element minOccurs="0" name="HoursWorked" type="xs:decimal">
              </xs:element>
              <xs:element minOccurs="0" name="SalaryAmount" nillable="true" type="xs:decimal">
              </xs:element>
              <xs:element minOccurs="0" name="Type" nillable="true" type="tns:EmploymentTypeCodes">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="EmploymentRecord" nillable="true" type="tns:EmploymentRecord" />
      <xs:complexType name="Enrollment">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="Policies" nillable="true" type="tns:ArrayOfPolicy">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Enrollment" nillable="true" type="tns:Enrollment" />
      <xs:complexType name="HealthCareSpendingAccountInformation">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="AllocationAmount" type="xs:decimal">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="HealthCareSpendingAccountInformation" nillable="true" type="tns:HealthCareSpendingAccountInformation" />
      <xs:complexType name="Income">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="Amount" type="xs:decimal">
              </xs:element>
              <xs:element minOccurs="0" name="EffectiveDate" type="xs:dateTime">
              </xs:element>
              <xs:element minOccurs="0" name="Frequency" nillable="true" type="tns:FrequencyCodes">
              </xs:element>
              <xs:element minOccurs="0" name="Type" nillable="true" type="tns:IncomeTypeCodes">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Income" nillable="true" type="tns:Income" />
      <xs:complexType name="RegionalAdministrativeInformation">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="Country" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="ProvinceOfBilling" nillable="true" type="tns:ProvinceCodes">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="RegionalAdministrativeInformation" nillable="true" type="tns:RegionalAdministrativeInformation" />
      <xs:complexType name="Section">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="Code" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Section" nillable="true" type="tns:Section" />
      <xs:complexType name="ArrayOfContactInformation">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="ContactInformation" nillable="true" type="tns:ContactInformation" />
        </xs:sequence>
      </xs:complexType>
      <xs:element name="ArrayOfContactInformation" nillable="true" type="tns:ArrayOfContactInformation" />
      <xs:complexType name="ArrayOfDivision">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Division" nillable="true" type="tns:Division" />
        </xs:sequence>
      </xs:complexType>
      <xs:element name="ArrayOfDivision" nillable="true" type="tns:ArrayOfDivision" />
      <xs:complexType name="ArrayOfCertificate">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Certificate" nillable="true" type="tns:Certificate" />
        </xs:sequence>
      </xs:complexType>
      <xs:element name="ArrayOfCertificate" nillable="true" type="tns:ArrayOfCertificate" />
      <xs:complexType name="ArrayOfCoveredLife">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="CoveredLife" nillable="true" type="tns:CoveredLife" />
        </xs:sequence>
      </xs:complexType>
      <xs:element name="ArrayOfCoveredLife" nillable="true" type="tns:ArrayOfCoveredLife" />
      <xs:complexType name="ArrayOfBenefitDecline">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="BenefitDecline" nillable="true" type="tns:BenefitDecline" />
        </xs:sequence>
      </xs:complexType>
      <xs:element name="ArrayOfBenefitDecline" nillable="true" type="tns:ArrayOfBenefitDecline" />
    </xs:schema><!-- BusinessObjects Version 3.2.471 -->

  • Removing empty node created by Value Mapping Functoid

    If the first input parameter to Value Mapping functoid is not true, it creates an empty element in the destination which I don't want, how can I get rid of this empty element, if it's empty I do not want it to created in the destination document.
    Do let me know how can I achive this within a Map.

    You can get rid of the empty nodes in your map by using a custom functoid and use XSLT script (also given below) and mentioned in this article
    Remove empty nodes in BizTalk by using XSLT
    <?xml version="1.0" ?>
    <xsl:stylesheet xmlns:xsl="@@ YOUR NAMESPACE @@" version="1.0" xmlns:ns0="http://Stater.Isvcs.Iface.BO.GetLoanData.ElfV2">
        <xsl:output method="xml" indent="yes" />
        <xsl:template match="node()">
            <xsl:if test="count(descendant::text()[string-length(normalize-space(.))>0]|@*)">
                <xsl:copy>
                    <xsl:apply-templates select="@*|node()" />
                </xsl:copy>
            </xsl:if>
        </xsl:template>
        <xsl:template match="@*">
            <xsl:copy />
        </xsl:template>
        <xsl:template match="text()">
            <xsl:value-of select="normalize-space(.)" />
        </xsl:template>
    </xsl:stylesheet>
    Abdul Rafay - MVP & MCTS BizTalk Server
    blog: http://abdulrafaysbiztalk.wordpress.com/
    Please mark this as answer if it helps.

  • Split the Target Structure.

    Hi,
    I have Header and Detail in my Target Structure, in the output I have to create 2 separate files, one for Header and one for Detail.I dont want to go for BPM, is there any solution for this with out using BPM?
    Thanks & Regards,
    Pragathi.

    Hi Pragathi
    Assuming you mean you have Header and Detail in the source structure and would like to create 2 messages on the target side, you have 2 options (Since you mentioned you dont want to use BPM)
    1. Create 2 sets of messages interface and related objects for the target structure and split the flow into 2, which will map the header to one message and the item to the other.
    2. Use multimap and map the header to message1 and item to message2. This will be a better option as the interface will use one map for creating the target message and you can pass the message onto 2 comm channels that will create the file.
    Hope this help.
    Regards
    Prav

  • Using XSLT to empty nodes with the exception of  specific node.

    I have XSLT code working which will remove all the empty elements. My user wishes to exempt a specific node, <BypassDateEdits>. I can not figure out the correct syntax to do this.
    Source XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <IMDSCDB xmlns="http://xml.dod.mil/log/maint/fs/main/4.0.0">
    <EndItemTCTOReporting originator="EMOC">
    <PartialJobDataDocumentationData/>
    <JobControlNumber>
    <EventId>052790038</EventId>
    <WorkcenterEvent>001</WorkcenterEvent>
    </JobControlNumber>
    <End/>
    <HomeEnterpriseLocationCode>7494</HomeEnterpriseLocationCode>
    <CurrentEnterpriseLocationCode>7494</CurrentEnterpriseLocationCode>
    <HostUnitDateAndTime>2006-02-23T19:29:37</HostUnitDateAndTime>
    <TransactionOrdinalDate>06054</TransactionOrdinalDate>
    <ComponentPosition>0</ComponentPosition>
    <HowMalfunctionCode>802</HowMalfunctionCode>
    <UnitsProduced>01</UnitsProduced>
    <StartTime>0800</StartTime>
    <StopDate>05200</StopDate>
    <StopTime>0805</StopTime>
    <CrewSize>6</CrewSize>
    <CategoryOfLaborCode>1</CategoryOfLaborCode>
    <ActivityIdentifierCode>02</ActivityIdentifierCode>
    <CorrectedByIMDSCDBUserId>GU03CW</CorrectedByIMDSCDBUserId>
    <CorrectiveActionNarrative>Test Test</CorrectiveActionNarrative>
    <InspectedByIMDSCDBUserId>GU03CW</InspectedByIMDSCDBUserId>
    <DocumentMoreTCTOThisJobControlNumber/>
    <InspectionPassed>Y</InspectionPassed>
    <BypassDateEdits/>
    </EndItemTCTOReporting>
    </IMDSCDB>
    Desired output is:
    <?xml version="1.0" encoding="UTF-8"?>
    <IMDSCDB xmlns="http://xml.dod.mil/log/maint/fs/main/4.0.0">
    <EndItemTCTOReporting originator="EMOC">
    <PartialJobDataDocumentationData/>
    <JobControlNumber>
    <EventId>052790038</EventId>
    <WorkcenterEvent>001</WorkcenterEvent>
    </JobControlNumber>
    <HomeEnterpriseLocationCode>7494</HomeEnterpriseLocationCode>
    <CurrentEnterpriseLocationCode>7494</CurrentEnterpriseLocationCode>
    <HostUnitDateAndTime>2006-02-23T19:29:37</HostUnitDateAndTime>
    <TransactionOrdinalDate>06054</TransactionOrdinalDate>
    <ComponentPosition>0</ComponentPosition>
    <HowMalfunctionCode>802</HowMalfunctionCode>
    <UnitsProduced>01</UnitsProduced>
    <StartTime>0800</StartTime>
    <StopDate>05200</StopDate>
    <StopTime>0805</StopTime>
    <CrewSize>6</CrewSize>
    <CategoryOfLaborCode>1</CategoryOfLaborCode>
    <ActivityIdentifierCode>02</ActivityIdentifierCode>
    <CorrectedByIMDSCDBUserId>GU03CW</CorrectedByIMDSCDBUserId>
    <CorrectiveActionNarrative>Test Test</CorrectiveActionNarrative>
    <InspectedByIMDSCDBUserId>GU03CW</InspectedByIMDSCDBUserId>
    <InspectionPassed>Y</InspectionPassed>
    <BypassDateEdits/>
    </EndItemTCTOReporting>
    </IMDSCDB>
    XSLT to remove all empty nodes is:
    <?xml version="1.0"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="@* | node()">
    <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="*[not(descendant::text()[normalize-space()])]" >
    </xsl:template>
    </xsl:stylesheet>
    I believe I need to use the | operator to select the additional node set of just the <BypassDateEdits> node, but repeated attempt and research on the web has enabled me to find a solution.
    Any assistance would be appreciated.
    Bill

    having gotten a big clue from tsuji, I finally achieved the correct XSLT.
    This XSLT:
    <?xml version="1.0"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="@* | node()">
    <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="*[not(local-name()='BypassDateEdits') and namespace-uri()='http://xml.dod.mil/log/maint/fs/main/4.0.0'][not(descendant::text()[normalize-space()])]" >
    </xsl:template>
    </xsl:stylesheet>
    Yields the desired results:
    <?xml version="1.0" encoding="UTF-8"?><IMDSCDB xmlns="http://xml.dod.mil/log/maint/fs/main/4.0.0">
    <EndItemTCTOReporting originator="EMOC">
    <JobControlNumber>
    <EventId>052790038</EventId>
    <WorkcenterEvent>001</WorkcenterEvent>
    </JobControlNumber>
    <HomeEnterpriseLocationCode>7494</HomeEnterpriseLocationCode>
    <CurrentEnterpriseLocationCode>7494</CurrentEnterpriseLocationCode>
    <HostUnitDateAndTime>2006-02-23T19:29:37</HostUnitDateAndTime>
    <TransactionOrdinalDate>06054</TransactionOrdinalDate>
    <ComponentPosition>0</ComponentPosition>
    <HowMalfunctionCode>802</HowMalfunctionCode>
    <UnitsProduced>01</UnitsProduced>
    <StartTime>0800</StartTime>
    <StopDate>05200</StopDate>
    <StopTime>0805</StopTime>
    <CrewSize>6</CrewSize>
    <CategoryOfLaborCode>1</CategoryOfLaborCode>
    <ActivityIdentifierCode>02</ActivityIdentifierCode>
    <CorrectedByIMDSCDBUserId>GU03CW</CorrectedByIMDSCDBUserId>
    <CorrectiveActionNarrative>Test Test</CorrectiveActionNarrative>
    <InspectedByIMDSCDBUserId>GU03CW</InspectedByIMDSCDBUserId>
    <InspectionPassed>Y</InspectionPassed>
    <BypassDateEdits/>
    </EndItemTCTOReporting>
    </IMDSCDB>
    Thank you tsuji,
    Bill

  • How to remove empty tags respecting the schema contraints?

    Hi,
    I'm generating an XML document with XSLT. This document have some empty tags. My question is about to remove all empty tags only if they are defined as optionnals in the schema.
    Is this possible with the DOM?
    Thanks in advance,
    Philippe

    With DOM3 validation api, elements/attributes may be checked if they may be removed.
    -Check if the element is empty; getFirstChild() method returns null.
    -Check if the element may be removed with DOM 3 Validation API.

  • LSMW - Problem while assigning the quantity field to the target structure

    Hi,
    Here I am getting the warning while I am maintaing the field mapping and conversion rules .  Here I am doing this through the Batch input Recording.
    That is , while I am assigning the source field to the target structre field .
    " <b>WARNING : Source field is longer than target field</b> "
    plz help me to remove that warning.
    Thank you

    in lsmw  use char field instead quantity of same length(in stucture defined in lsmw).

  • How to create multiple segments on the target structure of an IDOC

    Hi All
       I am working on the Shipment Confirmation Interface( Message Type SHPCON ) which is FILE to IDOC Scenario. I have a segment called E1EDL18 which occurs only once on the target side of the idoc. Now I have to created multiple E1EDl18 segments for the Qualifiers ORI, PGI and PCK. I treid to send a constant ORI,PGI,PCK and then used an user defined function which splits the constant at COMMA and then I am assigning to the target field QUALF. In the display queue for QUALF I see three values with context but still only one E1EDL!* segment is created. Please let me know how to create multiple E1EDl18 segments for three qualifiers.
    Thanks
    Naga

    In message Mapping, just right click on the segment and click on duplicate subtree. now it will create you another segment with same name and fields in it..
    you can hard code the Qual, or you can map the required source field into it.

  • How to remove link content from the link structure field

    Hi,
    I created a UDF as Link struture in marketing document title to link external file. After file has been linked to the UDF and saved, how do I remove it to empty the field? I tried to point to the field and right click, but couldn't find any function to remove the link.
    KC

    Press ALT + Double Click to remove the Link content from the UDF

  • Adding extra namespace in the target structure

    Input file (currently generating from existing message mapping)
    <?xml version="1.0" encoding="UTF-8"?>\
    <pData xmlns:xsi="namespace1">
    <Name>name</Name>
    <ListChange>
    <status>Active</status>
    </ListChange>
    </pData>
    Required File
    <?xml version="1.0" encoding="UTF-8"?>\
    <pData xmlns:xsi="namespace1" xmlns="namespace2">
    <Name>name</Name>
    <ListChange>
    <status>Active</status>
    </ListChange>
    </pData>
    To add the extra namespace (xmlns="namespace2") used following ways.
    1.     Using XML Anonymiser bean module
    Still the no change in the output (only accepting one namespace at a time 1/2)
    2.     Using XSLT Mapping as 1st row in interface mapping
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8"/>
         <xsl:template match="/pData">
                   <pData xmlns:xsi="namespace1" xmlns="namespace2">
                   <xsl:copy-of select="/pData/Name"/>
                   <xsl:copy-of select="/pData/ListChange/status"/>
              </pData>
         </xsl:template>
    </xsl:stylesheet>
    We are getting the following error
    com.sap.aii.utilxi.misc.api.BaseRuntimeException; Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 54, 65, 73(:main:, row:8851, col:24)
    Any inputs are welcome.

    >
    Jayashri Rade wrote:
    > Input file (currently generating from existing message mapping)
    >
    > ********************************************************
    > <?xml version="1.0" encoding="UTF-8"?>\
    >
    > <pData xmlns:xsi="namespace1">
    >
    > <Name>name</Name>
    > <ListChange>
    > <status>Active</status>
    > </ListChange>
    >
    > </pData>
    > ********************************************************
    > Required File
    > ********************************************************
    >
    > <?xml version="1.0" encoding="UTF-8"?>\
    >
    > <pData xmlns:xsi="namespace1" xmlns="namespace2">
    >
    > <Name>name</Name>
    > <ListChange>
    > <status>Active</status>
    > </ListChange>
    >
    > </pData>
    > ********************************************************
    >
    > To add the extra namespace (xmlns="namespace2") used following ways.
    > 1.     Using XML Anonymiser bean module
    > Still the no change in the output (only accepting one namespace at a time 1/2)
    the bean is to remove namespaces.. not to add
    > 2.     Using XSLT Mapping as 1st row in interface mapping
    > ********************************************************
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    > <xsl:output method="xml" encoding="UTF-8"/>
    >
    >      <xsl:template match="/pData">
    >
    >                <pData xmlns:xsi="namespace1" xmlns="namespace2">
    >                <xsl:copy-of select="/pData/Name"/>
    >                <xsl:copy-of select="/pData/ListChange/status"/>
    >
    >           </pData>
    >
    >      </xsl:template>
    > </xsl:stylesheet>
    > ********************************************************
    > We are getting the following error
    > com.sap.aii.utilxi.misc.api.BaseRuntimeException; Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 54, 65, 73(:main:, row:8851, col:24)
    >
    > Any inputs are welcome.
    the code looks fine. but i prefer a simple java mapping with a string operation to replace the tag <pData xmlns:xsi="namespace1"> to <pData xmlns:xsi="namespace1" xmlns="namespace2">. it will be simple string handling plus you will not lose any performance by using a XSLT parser invoked.

  • Multiple STATEMENT nodes in target structure for JDBC adapter

    Hi All,
    I have a file to JDBC scenario . At the receiver side we need to update two tables simultaneously .
    So in the target structure for JDBC , is it possible to have two STATEMENT nodes , so that 2 tables can be updated simultaneously.
    Please help.
    Thanks & Regards,
    Loveena.

    Hi,
    U can do tht..please see below link..
    http://help.sap.com/saphelp_nw04/Helpdata/EN/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    Regards,
    Manisha

  • How to remove empty lines from xml files after removing nodes from document

    <pre>
    Hi
    <b>i have xml document, which is shown below
    after removing some nodes from the document ,i am getting empty lines in place of removed nodes,how to resolve this and get the proper xml document without any errors</b>
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE Message SYSTEM "TRD01.dtd">
    <Message>
    <Header>
    <CounterPartyType>CLIENT</CounterPartyType>
    <CreationTime>20134455</CreationTime>
    <ErrorCode>363 </ErrorCode>
    <ErrorEnterPriseId>N</ErrorEnterPriseId>
    <ErrorStatus>1</ErrorStatus>
    <ErrorSystemId>STL</ErrorSystemId>
    <ErrorTimes>31</ErrorTimes>
    <MessageType>T</MessageType>
    <RecipientEnterpriseId>N</RecipientEnterpriseId>
    <RecipentSystemId>EXM</RecipentSystemId>
    <Remarks>REMARSK</Remarks>
    <SenderEnterpriseId>N</SenderEnterpriseId>
    <SenderSystemId>TR</SenderSystemId>
    </Header>
    </Message>
    <ErrorCode>363 </ErrorCode>
    <ErrorEnterPriseId>NIHK</ErrorEnterPriseId>
    <ErrorStatus>1</ErrorStatus>
    <ErrorSystemId>STL</ErrorSystemId>
    <ErrorTimes>31</ErrorTimes>
    XPathExpression expression5 = xpath.compile(xmlpath5);
    Object result5 = expression5.evaluate(doc, XPathConstants.NODE);
    Node node5 = (Node) result5;
    node5.getParentNode().removeChild(node5);
    XPathExpression expression6 = xpath.compile(xmlpath6);
    Object result6 = expression6.evaluate(doc, XPathConstants.NODE);
    Node node6=(Node) result6;
    node6.getParentNode().removeChild(node6);
    XPathExpression expression7 = xpath.compile(xmlpath7);
    Object result7 = expression7.evaluate(doc, XPathConstants.NODE);
    Node node7=(Node) result7;
    node7.getParentNode().removeChild(node7);
    doc.normalize();
    doc.normalizeDocument();
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.setOutputProperty(OutputKeys.INDENT, "yes");
    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
    t.setOutputProperty(OutputKeys.METHOD,"xml");
    t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    the xml output i am getting is
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Message>
    <Header>
    <CounterPartyType>CLIENT</CounterPartyType>
    <CreationTime>20134455</CreationTime>
    <MessageType>TRD01</MessageType>
    <RecipientEnterpriseId>N</RecipientEnterpriseId>
    <RecipentSystemId>STL</RecipentSystemId>
    <Remarks>REMARSK</Remarks>
    <SenderEnterpriseId>N</SenderEnterpriseId>
    <SenderSystemId>T</SenderSystemId>
    </Header>
    </Message>
    <b>could you please let me know how to avoid empty lines in the xml doucment output</b>
    this is the method i am using to get the result
    public void ValidateRecord(String xml){
    try{
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = factory.newDocumentBuilder();
    //parse file into DOM
    /*DOMParser parser = new DOMParser();
    parser.setErrorStream(System.err);
    parser.setValidationMode(DTD_validation);
    parser.showWarnings(true);*/
    System.out.println ("HI THIS xml is validation "+xml);
    Resolver res = new Resolver();
    db.setEntityResolver(res);
    Document doc = db.parse(new InputSource(new StringReader(xml)));
    XPathFactory xpf = XPathFactory.newInstance();
    XPath xpath = xpf.newXPath();
    // XPathExpression expression = xpath.compile("//A/B[C/E/text()=13]");
    String xmlpath="/Message/Header/CounterPartyType/text()";
    String xmlpath1="/Message/Header/RecipentSystemId/text()";
    String xmlpath2="/Message/Header/ErrorSystemId/text()";
    XPathExpression expression = xpath.compile(xmlpath);
    XPathExpression expression1 = xpath.compile(xmlpath2);
    Object result = expression.evaluate(doc, XPathConstants.NODE);
    Object result1 = expression1.evaluate(doc, XPathConstants.NODE);
    Node node = (Node) result;
    Node node1 = (Node) result1;
    System.out.println("the values of the string is " +node.getNodeValue());
    System.out.println("the values of the string is " +node1.getNodeValue());
    // for (int i = 0; i < nodes.getLength(); i++) {
    //System.out.println(nodes.item(i).getNodeValue());
    // CAHNGING THE RECEIPENT NODE
    XPathExpression expression2 = xpath.compile(xmlpath1);
    Object result2 = expression2.evaluate(doc, XPathConstants.NODE);
    Node node2 = (Node) result2;
    System.out.println(node2);
    node2.setNodeValue(node1.getNodeValue());
    System.out.println(node2);
    //removing the nodes from document
    String xmlpath3="/Message/Header/ErrorCode";
    String xmlpath4="/Message/Header/ErrorEnterPriseId";
    String xmlpath5="/Message/Header/ErrorStatus";
    String xmlpath6="/Message/Header/ErrorSystemId";
    String xmlpath7="/Message/Header/ErrorTimes";
    XPathExpression expression3 = xpath.compile(xmlpath3);
    Object result3 = expression3.evaluate(doc, XPathConstants.NODE);
    Node node3 = (Node) result3;
    node3.getParentNode().removeChild(node3);
    XPathExpression expression4 = xpath.compile(xmlpath4);
    Object result4 = expression4.evaluate(doc, XPathConstants.NODE);
    Node node4 = (Node) result4;
    System.out.println("node value");
    System.out.println(node4.getParentNode().getNodeName());
    node4.getParentNode().removeChild(node4);
    XPathExpression expression5 = xpath.compile(xmlpath5);
    Object result5 = expression5.evaluate(doc, XPathConstants.NODE);
    Node node5 = (Node) result5;
    node5.getParentNode().removeChild(node5);
    XPathExpression expression6 = xpath.compile(xmlpath6);
    Object result6 = expression6.evaluate(doc, XPathConstants.NODE);
    Node node6=(Node) result6;
    node6.getParentNode().removeChild(node6);
    XPathExpression expression7 = xpath.compile(xmlpath7);
    Object result7 = expression7.evaluate(doc, XPathConstants.NODE);
    Node node7=(Node) result7;
    node7.getParentNode().removeChild(node7);
    // Node b13Node = (Node) expression.evaluate(doc, XPathConstants.NODE);
    //b13Node.getParentNode().removeChild(b13Node);
    doc.normalize();
    doc.normalizeDocument();
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.setOutputProperty(OutputKeys.INDENT, "yes");
    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
    t.setOutputProperty(OutputKeys.METHOD,"xml");
    t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    t.transform(new DOMSource(doc), new StreamResult(System.out));
    catch (Exception e) {
         e.printStackTrace();
    System.out.println(e.getMessage());
    </pre>
    Edited by: user12185243 on Apr 6, 2013 6:38 AM
    Edited by: user12185243 on Apr 6, 2013 6:41 AM
    Edited by: user12185243 on Apr 6, 2013 6:43 AM
    Edited by: user12185243 on Apr 6, 2013 6:45 AM
    Edited by: user12185243 on Apr 6, 2013 9:00 AM

    either this way we can do this
    1)
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    <b> factory.setIgnoringElementContentWhitespace(true); </b>
    DocumentBuilder db = factory.newDocumentBuilder();
    or
    2)
    java.io.StringWriter sw = new java.io.StringWriter();
    StreamResult sr = new StreamResult(sw);
    t.transform(new DOMSource(doc), sr);
    String xml1 = sw.toString().trim();
    <b> xml1=xml1.replaceAll("\\s",""); </b>
    System.out.println(xml1.trim());

  • ** Is it possible to move back and generate the target node in Message Map

    Hi,
    We are doing EDI to IDoc scenario. In our scenario the source XML comes like
    XML Instance
    G_SPOC       (Node) 0..unbounded
       D_670       (Field)
       S_SDQ      (Node)
         D_67
         D_380
         D_67_2
         D_380_2
    G_SPOC
       D_670
       S_CTP
         D_212
    G_SPOC
       D_670
       S_SDQ
         D_67
         D_380
         D_67_2
         D_380_2
    Target Strcutre
    E1EDP01    0..unbounded
      For this instance we have to create E1EDP01 node for how much times D_67,D_67_2..... will come.
    By using 'CreateIf' function we check the existance of D_67,D_67_2 ... and create the target structure E1EDP01. This is working fine if S_SDQ node will come in source XML. Basically D_67,D_67_2 represents Store Nos and D_380,D_380_2 represents Qty.
    In the customer given EDI file, Price change also comes for Line items. It may comes in the file middle also. When Price Change come, the node S_SDQ will not come in G_SPOC but where as S_CTP will come. This contains Price Change in the field D_212.
    The indicator whether QD (Qty Discount), QI (Qty Increase), PC (Price change), AI (Additonal Increase) is stored in the fild D_670.
    In our logic in mapping, we create E1EDP01 based on the existance of D_67,D_67_2... . But, for PC (Price Change) we created special node E1EDP01 at the end (after all D_67,D_67_2 ) by checking the condition whether D_670 = 'PC'. This is also working fine when 'PC' comes in last G_POC of source XML. But, when it will come in middle of G_SPOC, mapping is only executed  for first 3 GPOC (for Example, QD,QI,PC) and it ignored the last one AI. (Because this is generated based on D_67 under S_SDQ again).
    The problem is we think that the system does not go back and execute the mapping for AI based on D_67.
    It executes mapping only in order.
    So, How will we solve this problem, friends? The requirements is  we have to do this thru Graphical Mapping only.
    We tried sever possibilites, but not worked out.
    Kindly help me friends to solve this issue.
    Thanking you.
    Kind Regards,
    Jeg P

    Friends,
    Any help to solve the above issue ?

Maybe you are looking for

  • Capture excise invoice at MIGO

    Hi, I want to capture excise invoice at MIGO. In migo i am selecting only refer excise invoice & entering excise invoice No & date. But i am getting error message as Excise Invoice ####  of Vendor ####  does not exist for Reference. Supriya.

  • System.Web.Services.Protocols.SoapException When Accessing Reporting Services

    Hi. I have inherited a client's mission critical database + SSRS project that I am attempting to migrate from 32-bit SQL Server Express 2005 + SSRS on a Windows Server 2003 to 64-bit SQL Server Express 2008 R2 + SSRS on a Server 2012 R2 Essentials. W

  • Cannot connect to the Administration server?

    I just installed Hyperion 11.1.2 in Windows 2008, and I'm sure the essbase server is started because I can connect by MaxL, and I can see the Administration server service is started because I can see it in the service list. But When I want to login

  • Can I take video with the iPhone and edit it in the iPad?

    I have an iPhone 4 and a iPad 2. On both devices I have iMovie. Many times I take video with the iPhone as it's more handy but it's harder to edit it on it. I would like then to transfer the movie  to the iPad to edit it using iMovie.

  • Compare tv's

    Does anyone have an opinion on which is the better TV? I am comparing the Samsung 55 in LED Smart TV with the Sony 55 inch LED Smart TV. Per reviews it seems like the Sony has better sound and more inputs than the Samsung. Both are on sale for the sa