Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDOM - How to Strip unwanted elements?

843834Mar 20 2003 — edited Mar 21 2003
I have a piece of XML, such as

<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Form type="/Tx" userName="(Details of disability)" fieldName="(disability)" />
<Form type="/Tx" userName="(Reason)" fieldName="(reason)" />
<Form value="(postNo)" type="/Tx" userName="(Post Reference Number)" fieldName="(POST_REFERENCE_NO)" />
<Form value="(Administration)" type="/Tx" userName="(Department)" fieldName="(DEPARTMENT)" />
<Form value="(Times)" type="/Tx" userName="(Where did you see the post advertised?)" fieldName="(ADVERTISED)" />
<Form value="(Ted)" type="/Tx" userName="(First Name)" fieldName="(FIRST_NAME)" />
<Form value="(Baker)" type="/Tx" userName="(Last Name)" fieldName="(LAST_NAME)" />
<Form value="(Mr)" type="/Tx" userName="(Title)" fieldName="(TITLE)" />
<Form value="(None)" type="/Tx" userName="(Previous Last Name)" fieldName="(PREV_LAST_NAME)" />
<Form value="(M)" type="/Tx" userName="(Sex M /F)" fieldName="(SEX)" />
</Root>

I only wish to process the Elements that do not have a value attrbute, Elements that have type=.... are not required.

Does anyone know the best way to strip these out before I begin parsing the values I wish with JDOM please?

Many thanks
Chris

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2003
Added on Mar 20 2003
4 comments
91 views