I think it would look something like this:
Node eRoot = doc.getDocumentElement();
Nodelist nChild = eRoot.getElementByTagName("B");
Node eB = null;
if (nChild.getLength()>0)
eB = nChild.item(0);
"SETHI, BHAVDEEP SINGH (LNG)" wrote:
> Hi
> I am using Apache's xerces parser 1.3.0
> I have a xml file that looks like this:
>
> <A>
> <B>
> Tag B
> <C>
> Tag C
> </C>
> </B>
> <B>
> Tag B again
> </B>
> <D>
> Tag D
> </D>
> </A>
>
> I am trying to extract all the elements B (and under) out of this file and
> print them; but am getting lost doing so.
> The output should look like this:
> <B>
> Tag B
> <C>
> Tag C
> </C>
> </B>
> <B>
> Tag B again
> </B>
>
> Any help would be appreciated...
>
> Bhavdeep Sethi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]