This discussion is archived
9 Replies Latest reply: Mar 21, 2012 11:16 PM by 925315 RSS

Using Regular Expression in XML parsing

925315 Newbie
Currently Being Moderated
Hi

I have an XML File with the node names like "ns670:PTC_FareBreakdown" etc. Now i need to get to the "PTC_FareBreakdown" node but the "ns670:" expression is not static and keeps changing dynamically. Is there any way to get the element by the tag name "PTC_FareBreakdown" using some regular expression in Java using a DOM Parser? Its really urgent.

<PTC_FareBreakdowns SequenceNo="1">
<ns670:PTC_FareBreakdown>...</ns670:PTC_FareBreakdown>
<ns690:PTC_FareBreakdown>...</ns690:PTC_FareBreakdown>
<ns890:PTC_FareBreakdown>...</ns890:PTC_FareBreakdown>
</PTC_FareBreakdowns>

Thanks & Regards

Tarni Sharma

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points