JDOM - How to Strip unwanted elements?
843834Mar 20 2003 — edited Mar 21 2003I 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