Re: XML parser and writer




Brandon McCombs wrote:
Jeff Higgins wrote:
Jeff Higgins wrote:
Brandon McCombs wrote:
Hey guys,

I'm writing a program to help people track various items and placing
them on a calendar. These items are mainly ones that reoccur (monthly
bills for example). Each item (or task) has various properties that are
set for it and I was thinking of storing all the data in an XML file.
I'd parse the file and have the data available throughout the execution
of the program. Updates to the file would occur when someone edits a
task to change its re-occurrence frequency, etc. Therefore I will need
to both easily parse and write new XML files. I don't have a DTD or
schema developed and I may later so any API I use will have to work w/o
that for now. Can anyone suggest a simple API for parsing/writing my
own made-up XML files? I've ruled out SAX since it only parses and was
thinking of using DOM but I don't know if that will work because I've
never did any programming with XML before.

thanks for any pointers

Maybe a Java-XML binding framework?
XStream, Castor, JAXB come to mind.

OTOH, why not some database technology?

I thought about an internal (to the app) database however I wanted to
strike a balance between beginning and advanced user configurability and
the ease with which to carry the user settings from computer to computer.
In my mind, an advanced user can edit the XML file directly at the risk of
messing stuff up (that's where it would be nice to eventually have a
schema defined) instead of using a GUI interface I'll eventually create
for beginner users. Simply copying the XML file from 1 computer to
another makes it easy for a user to use the application on multiple
computers if desired (although it would be up to them to keep them sync'ed
up).

Using a database made both of those things more difficult in my mind. An
advanced user would have no way of modifying an internal db and an
external db would just be overkill and make the installation of the app
overly complicated.

Any thoughts to the contrary? Maybe my knowledge is incorrect regarding
internal (embedded?) databases.


Well, first, thanks for the invitation to exercise my contrarian tendency.
:)
And second, my extensive knowledge of and real development experience with
the above subjects are hereby disclaimed.

I can say though that I have tried unsuccessfully more than once to soften
my hard head against the difficulty of using the Document Object Model
as a relational database. I think it could make sense to allow your user
to import and export his Calendar in XML format for the purpose of
transport.
But as a data model for something even as simple as a single user Calendar/
Tasklist the DOM would quickly become unwieldy especially if you have any
intention of using any part of the relations in the relational database.
You may also consider your Calendar over time, and over multiple users,
and over feature creep and over data types. Querying the DOM for all high
priority alerts after noon in the second week of January. :(

Having that said; If you view tour Calendar as a document the the DOM is
certainly the way to go.

JH



.



Relevant Pages

  • Re: XML parser and writer
    ... I'm writing a program to help people track various items and placing them on a calendar. ... I thought about an internal database however I wanted to strike a balance between beginning and advanced user configurability and the ease with which to carry the user settings from computer to computer. ... an advanced user can edit the XML file directly at the risk of messing stuff up instead of using a GUI interface I'll eventually create for beginner users. ... When the application starts up, and just before the current month is displayed, I build a data structure that contains all the dates for all the tasks on a month by month basis so every time a month is displayed in the calendar all the tasks and all their occurrences are displayed. ...
    (comp.lang.java.programmer)
  • Re: Ini File vs Registry
    ... impossible to "incrementally" update an XML file. ... I'd rather see an abstract Registry API with application ... Any component accesses methods of the parser to update the DOM. ... The Registry is a transacted database and has an implicit backup hive. ...
    (microsoft.public.vc.mfc)
  • Re: XML parser and writer
    ... them on a calendar. ... Therefore I will need to both easily parse and write new XML files. ... why not some database technology? ... an advanced user can edit the XML file directly at ...
    (comp.lang.java.programmer)
  • Re: Store XML to database
    ... using DOM. ... I have created this much and now i want to store this XML file in the database. ...
    (comp.lang.java.help)
  • Re: Exchange Calendar Issue
    ... Date mismatch for calendar items. ... Use Isinteg.exe to fix the Pub1.edb database and the Priv1.edb ... Microsoft CSS Online Newsgroup Support ... <public folder in Exchange 2003 SP2 ...
    (microsoft.public.windows.server.sbs)