This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copying xml into another on a condition

 
Vivian Josh
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers.,

I am trying to copy one XML into other but I only want to copy entire block of elements if one particular child tag exist.

For example

<Elements>
<element>
<a1></a1>
<b1></b1>
<c1></c1>
</element>
<element>
<a1></a1>
<b1></b1>
</element>
</Elements>

So in above xml I want copy all <element> tags only if <c1> exist in that.

How do I achieve that?

Thanks in advance ,

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With an if-statement?

You're going to have to be more specific about exactly what it is you can't do. What have you got so far?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic