• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

XML : how to parse effectively ?

Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Dear Sirs !
I am a newbie in XML world and I need to parse and also write to file yhe next XML Format :
<FORMAT NAME="InputQG30Format">
But I have no idea how i can do that ? I will very appretiate your attempt to help me .
How i can parse it ? What is the better parser for this case ? Each clue and code snippet will be properly appretiated .
Thank you ,

author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can parse it using different methods,
1.Java with Xerces or crimson
3.ASP with MSXML
4. ......
1.If you want to write a java code to parse the input XML you can read this tutorial and try
using DOM orUSing SAX These two tutorials will give you some basics ideas on how to parse the xml. You can download either Xerces or Crimson as Parser, I found Crimson is faster.
2.you can write XSLT to convert the inputXML in to any format you want.You have to learn XSLT which is relatively easy.(don't have good tutorial links now,will give you on monday). But the XML tutorials at this link http://www.w3schools.com/ and the XML Processing tutorials will sure help you,the former will teach you the fundas of XML.
3.OR download MSXML from MS site ,after installing double click MSXML help from your desktop,you will get bunch of tutorials to parse xml using asp,vb,js,vbscript etc.,
[ December 22, 2002: Message edited by: Balaji Loganathan ]
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not everybody here is a sir that can help you out.
FormatName fn = (FormatName)u.unmarshal(xmlFile);
FormatName tempfn = ObjectFactory.createFormatName();
TransactionCode tc = ObjectFactory.createTransactionCode();
Marshaller m = jc.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
m.marshal(tempfn, xmlOutFile);
If you're interested in using java objects created from the xml, and are more comfortable with Java, using JAXB might help you.
permaculture is largely about replacing oil with people. And one tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic