XML help...

Discussion in 'Computer Science & Culture' started by ImRatbastard, Mar 10, 2003.

Thread Status:
Not open for further replies.
  1. ImRatbastard Registered Member

    Messages:
    26
    I'm looking for a tutorial/articles on reading/writing XML files. I'd essentially like to use the XML file in place of a database and use it to populate my html pages on a website. It requires that I read from/write to the XML file. I've read a few tutorials but they all make it appear a lot harder than it should be. I'd prefer to use a java platform as well.

    Anyway, if anyone has any suggestions, they'd be greatly appreciated.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. LSatyl Registered Senior Member

    Messages:
    44
    Well, you cannot do anything with an xml file, if you don't first have an xml parser. And using an XML parser is not as straightforwars as it could be, so it *is* rather difficult. You can either use a complete parser (like Xerces, see below), or, depending on your programming skills, you can use a SAX parser.

    Since you state that you'd like to use java as the language, the first places to look are Sun's Java XML Pages and Apache's XML pages , since the old Apache XML engine (Crimson) forms the base for Sun's JAXP. The Apache project has *tons* of java/xml projects, all open source, all well documented.

    If you need a basic Java/XML tutorial, look at this one from Sun. It explains the basic API calls for JAXP. If you understand this, it's easy to replace JAXP with e.g. Xerces, since they're both based on the XML specifications by the W3C.

    Another good introduction is XML for the absolute beginner.

    If you'd like to use a SAX parser, take a look at this tutorial.

    hth
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. ImRatbastard Registered Member

    Messages:
    26
    Thanks for your help. I'll take a look at these.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. CompiledMonkey The Lurker Registered Senior Member

    Messages:
    96
    Honestly, I wouldn't use XML files in place of a database like MySQL. There is much more overhead involved with using XML IMO. Also, it's going to be more of a PITA. But, if you're stuck on XML, check out JAXP like mentioned above.
     
Thread Status:
Not open for further replies.

Share This Page