on 11-23-2011 8:29 AM
Hello experts.
I have this structure (for example):
<AAA>
<ID>A1</ID>
<B1>1</B1>
<B2>2</B2>
...
<B100>100</B100>
</AAA>
<AAA>
<ID>A2</ID>
<B1>1</B1>
<B2>2</B2>
...
<B100>100</B100>
</AAA>
<AAA>
<ID>A3</ID>
<B1>1</B1>
<B2>2</B2>
...
<B100>100</B100>
</AAA>
I have a need for the following mapping:
If the ID=A2, I need to suppress the whole <AAA> element with all it's subnodes.
So in the example the result of the mapping should be:
<AAA>
<ID>A1</ID>
<B1>1</B1>
<B2>2</B2>
...
<B100>100</B100>
</AAA>
<AAA>
<ID>A3</ID>
<B1>1</B1>
<B2>2</B2>
...
<B100>100</B100>
</AAA>
Is there an elegant way of doing this?
I don't want to add a check for 100 elements - to see if ID=A2...
Hello,
Use a two-step mapping,
the first mapping is one-to-one mapping but the logic in AAA is like this
ID -> removeContext ->equalsS -> ifWithoutElse -> AAA
constant: A2 / AAA -> /
Second mapping is if you need additional mapping logic.
Hope this helps,
Mark
Edited by: Mark Dihiansan on Nov 23, 2011 9:35 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.