Results 1 to 2 of 2
  1. #1
    jay.mehta is offline Member
    Join Date
    Jun 2011
    Rep Power

    Default Parsing complext XML file using java

    Hello friends, I need to parse a complex XML file given below. And I have to get the results like

    Head -> All the Labels inside the Head (HashMap<String, TreeSet>)

    Label -> Associated Head (HashMap<String, Set>)


    <RECORD id="000103585">
    <HEAD>A, a</HEAD>
    <PRON><PRN>e1</PRN><PRN type="say">ay</PRN></PRON>
    <POS>noun</POS><INFLECTION><INF number="pl">A's</INF><INF number="pl">As</INF><INF number="pl">a's</INF></INFLECTION>
    <DEF id="568"><DTEXT>the first letter of the English alphabet.</DTEXT>
    <DEF id="089"><DTEXT>the first in any series.</DTEXT>
    <DEF id="380"><DTEXT>the highest mark for school, college, or university work; alpha.</DTEXT>
    <DEF id="724"><LABEL>Music</LABEL>
    <SUBDEF id="510"><DTEXT>the sixth degree in the scale of C major, or the first in the relative minor scale (A minor).</DTEXT></SUBDEF>
    <SUBDEF id="794"><DTEXT>a written or printed note representing this tone.</DTEXT></SUBDEF>
    <SUBDEF id="883"><DTEXT>a string, key, or pipe tuned to this note.</DTEXT></SUBDEF>
    <SUBDEF id="100"><DTEXT>(in the fixed system of solmisation) the sixth note of the scale, called <I>la</I>.</DTEXT></SUBDEF>
    <SUBDEF id="660"><DTEXT>the note to which concert performers tune their instruments; concert A.</DTEXT></SUBDEF>
    <DEF id="549"><DTEXT>a series of standard paper sizes, such as A1, A3, etc., being subdivisions of the basic A0 size, 1189 times; 841 mm.</DTEXT>
    <DEF id="728"><SUBHEAD>from A to Z</SUBHEAD><DTEXT>from beginning to end.</DTEXT>

    <RECORD id="000098504"><HEAD>a<SUP>1</SUP></HEAD>
    <PRON><PRN>7</PRN><PRN type="SAY">uh</PRN><LABEL>emphatic</LABEL><PRN>e1</PRN><PRN type="SAY">ay</PRN></PRON>
    <POS>adjective or indefinite article</POS>
    <DEFPREFIX>a word used especially before nouns beginning with a consonant sound to mean:</DEFPREFIX>
    <DEF id="478"><DTEXT>some (indefinite singular referring to one individual of a class)</DTEXT><IP>a child</IP><IP>a house</IP><IP>a star.</IP>
    <DEF id="110"><DTEXT>another</DTEXT><IP>he is a Cicero in eloquence.</IP>
    <DEF id="620"><DTEXT>one</DTEXT><IP>two of a kind</IP><IP>a thousand.</IP>
    <DEF id="164"><DTEXT>any (a single)</DTEXT><IP>not a one.</IP>
    <DEF id="808"><DTEXT>indefinite plural</DTEXT><IP>a few</IP><IP>a great many.</IP>
    </BODY><WRDETY><LANG>Middle English</LANG>, phonetic <LANG>variant</LANG> of <LINK>
    <DESTHEAD recid="000099534">an<SUP>1</SUP></DESTHEAD></LINK></WRDETY> <USAGE type="LANGUAGE">The variant <I>an</I> is used before a vowel, as in <I>an address</I>, <I>an umbrella</I>. Pronunciation rather than spelling is the criterion: for example words like <I>hour</I> and <I>honour</I> have <I>an</I> before them because the initial <I>h</I> is not pronounced, while words like <I>union</I> and <I>user</I> take <I>a</I> because they are pronounced as if beginning with an initial <I>y</I> consonant. A few words with initial <I>h</I> are variable: most speakers pronounce an initial <I>h</I> in <I>historical</I> (<I>a historical survey</I>), some do not (<I>an historical survey</I>).</USAGE>

    <RECORD id="000099926">

    <PRON><PRN>7</PRN><PRN type="SAY">uh</PRN></PRON>
    <POS>adjective or indefinite article</POS>
    <DEF id="185"><DTEXT>each; every</DTEXT><IP>three times a day.</IP>
    </BODY><WRDETY>originally <I>a</I> (preposition), <LANG>Old English</LANG> <I>an</I>, <I>on</I>, confused with the indefinite article</WRDETY>

    <RECORD id="000000599"><HEAD>a'</HEAD>
    <PRON><PRN>a</PRN><PRN type="SAY">ah</PRN><PRN>c</PRN><PRN type="SAY">aw</PRN></PRON>
    <DEF id="422"><DTEXT>all</DTEXT><IP>for a' that.</IP>
    <DEF id="187"><DTEXT>all</DTEXT><IP>an a'.</IP>


    I really appreciate if you reply ASAP. Thank you.

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Tucson, AZ
    Rep Power

Similar Threads

  1. HTML FILE parsing.
    By makpandian in forum New To Java
    Replies: 8
    Last Post: 11-02-2010, 04:00 PM
  2. parsing xml file
    By mp.saaravanan in forum New To Java
    Replies: 1
    Last Post: 05-02-2010, 03:55 PM
  3. Replies: 1
    Last Post: 05-31-2009, 07:48 PM
  4. Parsing XML File
    By rstar7 in forum XML
    Replies: 1
    Last Post: 10-10-2008, 04:31 AM
  5. Replies: 6
    Last Post: 05-14-2008, 05:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts