Link to home
Start Free TrialLog in
Avatar of lordiano
lordiano

asked on

Xerces Parser Help needed URGENT

Hi, I am trying to write a parser that can parse a XML file, and then use RSS to make a feed of my own XML schemas.
I need help in the Xerces XML parser part. Does anyone have sample code for using Xerces XML parser in parsing a XML file, by tagnames ..etc , or maybe tell me how I can parse XML file such as :
<RootNode>
 <List name = "something">
     <Item>item a</Item>
     <Description>Something</Description>
     <Prices>
        <Price>10</Price>
        <Price>11</Price>
     </Prices>
 </List>
</RootNode>

Where i will have multiple List,
I want to parse the List-Name, and the Item, description, prices(and all the individual Price)

The xml file can be located on disk or on web.

I read up on the RSS feed creation on java.sun.com especially the rome library.

How do I create feed that can be displayed as :

<List name = "something">
     <Item>item a</Item>
     <Description>Something</Description>
     <Price>something</Price>
</List>


Thanks for your help,
if you have sourcecode and would rather like to email please email to me at
<e-mail removed from Venabili>
(If you do email please let me know you emailed)




ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
lordiano,

Please do not post your e-mail in questions -- all the communication should be lead on the site. I removed it from here.

Thanks
Venabili
Java Page Editor
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lordiano
lordiano

ASKER

When I create Feed using ROME library, How can i create it so that it will have custome tag names?
I am creating it like :

entry = new SyndEntryImpl();
entry.setTitle("Rome v0.1");
entry.setLink("http://wiki.java.net/bin/view/Javawsxml/Rome01");
description = new SyndContentImpl();
description.setType("application/xml");
description.setValue("Initial release of Rome");
entry.setDescription(description);
entries.add(entry);
...

but this would be displayed as
<entry>
    <title> .... </title>
    <link>.... </link>
    <summary type = ............../>
</entry>

Is there a way I can rename the tag "entry" to something else?
and is there a way I can create custom tag other than title, link, entry..???

I will split points accordingly THANKS a lot for the help
Check the dtd or schema for the xml used - that will tell you what you can and can't use
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial