Results 1 to 2 of 2
- 06-02-2011, 11:41 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 1
- Rep Power
- 0
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>)
<bigmac>
<RECORD id="000103585">
<HEAD>A, a</HEAD>
<SORTKEY>A0000000000</SORTKEY><FLAGS></FLAGS>
<PRON><PRN>e1</PRN><PRN type="say">ay</PRN></PRON>
<BODY><CHUNK>
<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>
<DEF id="089"><DTEXT>the first in any series.</DTEXT>
</DEF>
<DEF id="380"><DTEXT>the highest mark for school, college, or university work; alpha.</DTEXT>
</DEF>
<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>
<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></CHUNK><CHUNK>
<POS>phrase</POS>
<DEF id="728"><SUBHEAD>from A to Z</SUBHEAD><DTEXT>from beginning to end.</DTEXT>
</DEF></CHUNK>
</BODY>
</RECORD>
<RECORD id="000098504"><HEAD>a<SUP>1</SUP></HEAD>
<SORTKEY>A0990010100</SORTKEY><FLAGS></FLAGS>
<PRON><PRN>7</PRN><PRN type="SAY">uh</PRN><LABEL>emphatic</LABEL><PRN>e1</PRN><PRN type="SAY">ay</PRN></PRON>
<BODY><CHUNK>
<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>
<DEF id="110"><DTEXT>another</DTEXT><IP>he is a Cicero in eloquence.</IP>
</DEF>
<DEF id="620"><DTEXT>one</DTEXT><IP>two of a kind</IP><IP>a thousand.</IP>
</DEF>
<DEF id="164"><DTEXT>any (a single)</DTEXT><IP>not a one.</IP>
</DEF>
<DEF id="808"><DTEXT>indefinite plural</DTEXT><IP>a few</IP><IP>a great many.</IP>
</DEF></CHUNK><VARIANTS><VARPREFIX>before a vowel sound</VARPREFIX><VAR>an</VAR></VARIANTS>
</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>
<RECORD id="000099926">
<HEAD>a<SUP>2</SUP></HEAD>
<SORTKEY>A0990010200</SORTKEY><FLAGS></FLAGS>
<PRON><PRN>7</PRN><PRN type="SAY">uh</PRN></PRON>
<BODY><CHUNK>
<POS>adjective or indefinite article</POS>
<DEF id="185"><DTEXT>each; every</DTEXT><IP>three times a day.</IP>
</DEF></CHUNK>
</BODY><WRDETY>originally <I>a</I> (preposition), <LANG>Old English</LANG> <I>an</I>, <I>on</I>, confused with the indefinite article</WRDETY>
</RECORD>
<RECORD id="000000599"><HEAD>a'</HEAD>
<SORTKEY>A0991010000</SORTKEY><FLAGS></FLAGS>
<PRON><PRN>a</PRN><PRN type="SAY">ah</PRN><PRN>c</PRN><PRN type="SAY">aw</PRN></PRON>
<BODY><LABEL>Scottish</LABEL><CHUNK>
<POS>adjective</POS>
<DEF id="422"><DTEXT>all</DTEXT><IP>for a' that.</IP>
</DEF></CHUNK><CHUNK>
<POS>pronoun</POS>
<DEF id="187"><DTEXT>all</DTEXT><IP>an a'.</IP>
</DEF></CHUNK><VARIANTS><VAR>a</VAR></VARIANTS>
</BODY>
</RECORD>
</bigmac>
I really appreciate if you reply ASAP. Thank you.
- 06-02-2011, 11:59 PM #2
Similar Threads
-
HTML FILE parsing.
By makpandian in forum New To JavaReplies: 8Last Post: 11-02-2010, 03:00 PM -
parsing xml file
By mp.saaravanan in forum New To JavaReplies: 1Last Post: 05-02-2010, 02:55 PM -
E:\IT 215 Java Programming\Inventory.java:211: reached end of file while parsing
By tlouvierre in forum New To JavaReplies: 1Last Post: 05-31-2009, 06:48 PM -
Parsing XML File
By rstar7 in forum XMLReplies: 1Last Post: 10-10-2008, 03:31 AM -
[SOLVED] java.lang.NullPointerException while Parsing a file
By lene in forum New To JavaReplies: 6Last Post: 05-14-2008, 04:04 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks