i have complex XML structure i want get all descendents uisng some xml paren.child.@attribute representation
For example
<employes>
<employe id="a123">
<month name="jan" sales="100" target="110">
<task sale="100" target="110"/>
</month>
<month name="Feb" sales="150" target="150">
<task sale="75" target="75"/>
<task sale="75" target="75"/>
</month>
</employe>
<employe id="b123">
<month name="dec" sales="50" target="100">
<task sale="50" target="100"/>
</month>
<month name="jan" sales="100" target="110">
<task sale="100" target="110"/>
</month>
<month name="Feb" sales="150" target="150">
<task sale="75" target="75"/>
<task sale="75" target="75"/>
</month>
</employe>
Suppose i want get all xml nodes with month.task.@target how can i implement this,
I mean i only give input as “month.task.@target” and the return should be XMLList containing all node that have same structure
can any one help me please
thanks
You’ll need to use the “..” operator.
Your query should look something like:
This will return all “task” nodes on any level.
You can also add filtering on the attributes: