<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Optional elements in XML transformation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908483#M1482483</link>
    <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;brad.bohn&lt;/SPAN&gt;.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I am also facing similar issue when trying to upload multiple XML files using ST in abap.&lt;/P&gt;&lt;P&gt;how to check optional tags?&lt;/P&gt;&lt;P&gt;could you please help me if you have any solution on above?&lt;/P&gt;&lt;P&gt;i tried as below: transformation logic:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1820710-tag-xml.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jun 2020 05:40:29 GMT</pubDate>
    <dc:creator>former_member658995</dc:creator>
    <dc:date>2020-06-25T05:40:29Z</dc:date>
    <item>
      <title>Optional elements in XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908481#M1482481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I call a transformation ( defined in STRANS ) that has as source a XML document and as destination several Abap variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dump when transforming the XML, because some elements sometime do not exist in XML to transform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if the element &amp;lt;fax tt:value-ref="$REF.C250"/&amp;gt; of the bellow example does not exist in a XML, how can i preview it  ? How do I don't have problem if tag &amp;lt;fax&amp;gt; does not exist &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know there's a property minOccurs="0", I've seen in several forums but I don't know how to adapt it to the bellow example. Can anyone help me solve this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Paulo Sousa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXAMPLE ( part of my transformation &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?sap.transform simple?&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined"&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root name="ZSHSTXML_EMPRESA" type="ddic:ZSHSTXML_EMPRESA"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root name="ZSHSTXML_SST_C140" type="ddic:CHAR1000SF"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_ESTABL" name="ZSHSTXML_ESTABL"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_ACTVHST" name="ZSHSTXML_ACTVHST"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_SRV_SST" name="ZSHSTXML_SRV_SST"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_MEDICOS" name="ZSHSTXML_MEDICOS"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_TEC_SHT" name="ZSHSTXML_TEC_SHT"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_ACTIVID" name="ZSHSTXML_ACTIVID"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_CONSULT" name="ZSHSTXML_CONSULT"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_INFO" name="ZSHSTXML_INFO"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_FORMAC" name="ZSHSTXML_FORMAC"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RFISICO" name="ZSHSTXML_RFISICO"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RQUIMIC" name="ZSHSTXML_RQUIMIC"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RBIOLOG" name="ZSHSTXML_RBIOLOG"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RMUSCUL" name="ZSHSTXML_RMUSCUL"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RPSICOS" name="ZSHSTXML_RPSICOS"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_ROUTROS" name="ZSHSTXML_ROUTROS"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_EXAMES" name="ZSHSTXML_EXAMES"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_EXCOMPL" name="ZSHSTXML_EXCOMPL"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_IMUNIZA" name="ZSHSTXML_IMUNIZA"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_PROMOST" name="ZSHSTXML_PROMOST"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_ACIDTRA" name="ZSHSTXML_ACIDTRA"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_DOENCAP" name="ZSHSTXML_DOENCAP"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_DOENCAC" name="ZSHSTXML_DOENCAC"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RFMEDID" name="ZSHSTXML_RFMEDID"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RQMEDID" name="ZSHSTXML_RQMEDID"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RBMEDID" name="ZSHSTXML_RBMEDID"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RMMEDID" name="ZSHSTXML_RMMEDID"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_RPMEDID" name="ZSHSTXML_RPMEDID"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_ROMEDID" name="ZSHSTXML_ROMEDID"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:root line-type="ddic:ZSHSTXML_EXCMEDI" name="ZSHSTXML_EXCMEDI"/&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;tt:template&amp;gt;&lt;/P&gt;&lt;P&gt;    &amp;lt;entity_data xmlns="http://www.gep.mtss.gov.pt/sguri/ru" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;&lt;/P&gt;&lt;P&gt;      &amp;lt;active_estabs&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;tt:attribute name="year_ref" value-ref=".ZSHSTXML_EMPRESA.ANO"/&amp;gt;&lt;/P&gt;&lt;P&gt;... SOME LINES I'VE REMOVED. I BELIEVE NOT RELEVANT&lt;/P&gt;&lt;P&gt;        &amp;lt;estabs&amp;gt;&lt;/P&gt;&lt;P&gt;          &amp;lt;tt:loop ref="ZSHSTXML_ESTABL"&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;estab&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;estab_id&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;tt:value ref="$REF.ID"/&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/estab_id&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;dcf tbl="RU_DCF"&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;tt:value ref="$REF.C230"/&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/dcf&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;dcf_description&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;tt:value ref="$REF.C231"/&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/dcf_description&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;country tbl="RU_CODPAIS"&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;tt:value ref=".ZSHSTXML_SST_C140"/&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/country&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;country_description&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;tt:value ref=".ZSHSTXML_SST_C140"/&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/country_description&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;phone tt:value-ref="$REF.C240" /&amp;gt;&lt;/P&gt;&lt;P&gt;              &lt;STRONG&gt;&amp;lt;fax tt:value-ref="$REF.C250"/&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;email tt:value-ref="$REF.C260"/&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;cae tbl="RU_CAE_5DIG"&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;tt:value ref="$REF.C300"/&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/cae&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;cae_description&amp;gt;&lt;/P&gt;&lt;P&gt;                &amp;lt;tt:value ref="$REF.C301"/&amp;gt;&lt;/P&gt;&lt;P&gt;              &amp;lt;/cae_description&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;/estab&amp;gt;&lt;/P&gt;&lt;P&gt;          &amp;lt;/tt:loop&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;/estabs&amp;gt;&lt;/P&gt;&lt;P&gt;      &amp;lt;/entity&amp;gt;&lt;/P&gt;&lt;P&gt;    &amp;lt;/entity_data&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;/tt:template&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/tt:transform&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 16:03:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908481#M1482481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-30T16:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Optional elements in XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908482#M1482482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can't see your example  - are you using XSLT or ABAP ST?  For ABAP ST, you can make a node in the template conditional as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
        &amp;lt;tt:cond frq="?"&amp;gt;
          &amp;lt;Location&amp;gt;
            &amp;lt;tt:value ref="LOCATION"/&amp;gt;
          &amp;lt;/Location&amp;gt;
        &amp;lt;/tt:cond&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 17:36:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908482#M1482482</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2010-04-30T17:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Optional elements in XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908483#M1482483</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;brad.bohn&lt;/SPAN&gt;.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I am also facing similar issue when trying to upload multiple XML files using ST in abap.&lt;/P&gt;&lt;P&gt;how to check optional tags?&lt;/P&gt;&lt;P&gt;could you please help me if you have any solution on above?&lt;/P&gt;&lt;P&gt;i tried as below: transformation logic:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1820710-tag-xml.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 05:40:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908483#M1482483</guid>
      <dc:creator>former_member658995</dc:creator>
      <dc:date>2020-06-25T05:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Optional elements in XML transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908484#M1482484</link>
      <description>&lt;P&gt;XML FILES as below:&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 05:43:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/optional-elements-in-xml-transformation/m-p/6908484#M1482484</guid>
      <dc:creator>former_member658995</dc:creator>
      <dc:date>2020-06-25T05:43:36Z</dc:date>
    </item>
  </channel>
</rss>

