Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

XML SImple transform ignoring <tags>

Former Member
0 Kudos


I am attempting to read in a file using a Simple Transform that may contain certain blocks of data that I do not wish to process. Per my example, how does one go about ingnoring the data in <HB> while still reading in <HA> and <HC>. It has been my experience that if every single potential <tag> is not accounted for the program will short dump. I would prefer to not have to define tags for an entire XML STD, but rather only include those elements that I an required to capture. Thanks in advance.

<HA>

     <employee>

          <name>Bill</name>

          <date>01/01/2015</date>

     </employee>

     <employee>

          <name>Bob</name>

          <date>01/02/2015</date>

     </employee>

</HA>

<HB>

     <address>

          <state>AZ</state>

      </address>

     <address>

          <state>AR</state>

     </adress>

</HB>

<HC>

     <age>    

          <dob>12/25/1980</dob>

     </age>

     <age>

          </dob>07/04/1976</dob>

     </age>

</HC>

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

Could you try a <tt:skip name="HB"/> command ?

(The following XML content shouldbe consumed up to the end of the current element.)

Regards,

Raymond

0 Kudos

Unfortunately if you use the skip command, the transform will move on to <address> (in <HB>). When it doesn't find address defined, it wil then short dump. Ideally I thought there must be some way to define what you'd like in terms of the data being passed, not accounting for all the data you'd like to ignore. Keep in mind this same issue is relevant to conditional <tags>. Let's say sometimes in <HA> the interface will send <name> always and <date> occaisionally. If you don't add <tt:cond> <date> </date> </tt:cond> you will get a short dump when only <name> is passed. I have to assume SAP created some easier way to define an expected inbound XML structure that has some variance to it. Thanks.

0 Kudos

I would try this.

<tt:skip count="*" name="HA">

</tt:skip>


<tt:skip count="*" name="address">

</tt:skip>


<tt:skip count="*" name="state">

</tt:skip>

N.B : "*" indicates all the nodes


R