Monday, May 22, 2017

XML file transformation with checking tags-

  

Xml file structure:

  <InvoiceAddress>    
                <Name>Salauddin Fashion House</Name>
                <PostalCode>1219</PostalCode>
                <City>Dhaka</City>
                <CountryCode>BD</CountryCode>

    </InvoiceAddress>


XML file Transformation code: 


 " if invoice tag not available 

<tt:cond s-check="not-initial(ref('INVOICEADD'))"

      " if name tag not available.

           <tt:cond s-check="not-initial(ref('INVOICEADD.NAME'))"
              <Name tt:value-ref="INVOICEADD.NAME"/>
            </tt:cond>
            
            " if name tag available.

            <tt:cond s-check="initial(ref('INVOICEADD.NAME'))">  
              <Name tt:value-ref="INVOICEADD.NAME"/>
            </tt:cond>

            <tt:cond s-check="not-initial(ref('INVOICEADD.POSTALCODE'))">
              <PostalCode tt:value-ref="INVOICEADD.POSTALCODE"/>
            </tt:cond>
            <tt:cond s-check="initial(ref('INVOICEADD.POSTALCODE'))">
              <PostalCode tt:value-ref="INVOICEADD.POSTALCODE"/>
            </tt:cond>

            <tt:cond s-check="not-initial(ref('INVOICEADD.CITY'))">
              <City tt:value-ref="INVOICEADD.CITY"/>
            </tt:cond>
            <tt:cond s-check="initial(ref('INVOICEADD.CITY'))">
              <City tt:value-ref="INVOICEADD.CITY"/>
            </tt:cond>

            <tt:cond s-check="not-initial(ref('INVOICEADD.COUNTRYCODE'))">
              <CountryCode tt:value-ref="INVOICEADD.COUNTRYCODE"/>
            </tt:cond>
            <tt:cond s-check="initial(ref('INVOICEADD.COUNTRYCODE'))">
              <CountryCode tt:value-ref="INVOICEADD.COUNTRYCODE"/>
            </tt:cond>

          </tt:cond>




          " if invoice tag available 

          <tt:cond s-check="initial(ref('INVOICEADD'))">   

            <InvoiceAddress>


              <tt:cond s-check="not-initial(ref('INVOICEADD.NAME'))">
                <Name tt:value-ref="INVOICEADD.NAME"/>
              </tt:cond>
              <tt:cond s-check="initial(ref('INVOICEADD.NAME'))">
                <Name tt:value-ref="INVOICEADD.NAME"/>
              </tt:cond>

              <tt:cond s-check="not-initial(ref('INVOICEADD.POSTALCODE'))">
                <PostalCode tt:value-ref="INVOICEADD.POSTALCODE"/>
              </tt:cond>
              <tt:cond s-check="initial(ref('INVOICEADD.POSTALCODE'))">
                <PostalCode tt:value-ref="INVOICEADD.POSTALCODE"/>
              </tt:cond>


              <tt:cond s-check="not-initial(ref('INVOICEADD.CITY'))">
                <City tt:value-ref="INVOICEADD.CITY"/>
              </tt:cond>
              <tt:cond s-check="initial(ref('INVOICEADD.CITY'))">
                <City tt:value-ref="INVOICEADD.CITY"/>
              </tt:cond>

              <tt:cond s-check="not-initial(ref('INVOICEADD.COUNTRYCODE'))">
                <CountryCode tt:value-ref="INVOICEADD.COUNTRYCODE"/>
              </tt:cond>
              <tt:cond s-check="initial(ref('INVOICEADD.COUNTRYCODE'))">
                <CountryCode tt:value-ref="INVOICEADD.COUNTRYCODE"/>
              </tt:cond>

            </InvoiceAddress>
          </tt:cond>



18 comments:

  1. nice blog...The leading training concern THE CREATING EXPERTS are providing SELENIUM training and here is the link

    http://thecreatingexperts.com/selenium-training-in-chennai/

    contact 8122241286

    ReplyDelete
  2. Thank you. sir, Really I like your post on sap remote access free.

    ReplyDelete
  3. SAP ABAP training is provided in CHENNAI.

    THE CREATING EXPERTS is one of the leading trainer in SAP who provides real time training

    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    contact 8122241286

    ReplyDelete
  4. Thank you. It is such a wonderful post. it has great information it is very useful topic on sap remote access.

    ReplyDelete
  5. It was Nice post and very useful information on sap hana server access, Follow this Post More Information.

    ReplyDelete
  6. Thank you for Wonderful information.

    SAP ABAP training in CHENNAI BY THE CREATING EXPERTS

    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    CONTACT 8122241286

    ReplyDelete
  7. Informative post...for a long time I was searching for a trainer in Chennai

    And i landed with THE CREATING EXPERTS one of the leading trainer with real time training in Chennai

    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    contact 8122241286 for more info.

    ReplyDelete
  8. Sap abap training in chennai by the creating experts, are you in search of a real time trainer

    Take a look at the link below

    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    contact 8122241286

    ReplyDelete
  9. Superb explanation & it's too clear to understand the concept as well, keep sharing admin with some updated information with right examples.Keep update more posts.

    SAP MM Training in Chennai

    SAP HR Training in Chennai

    ReplyDelete
  10. Thank you. sir, Really I like your post on sap video.

    ReplyDelete
  11. Thankyou for wonderful article. It has more Information in Your Website sapvideos.

    ReplyDelete
  12. Thank you. It is such a wonderful post. it has great information it is very useful for sap hana videos.

    ReplyDelete
  13. Thankyou for Sharing Great Information. It is Very Helpful Information on sap video tutorials.

    ReplyDelete

  14. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
    sap business intelligence solutions

    ReplyDelete