You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Matt Garman <ga...@raw-sewage.net> on 2004/04/27 19:05:36 UTC

xerces "style"???

Hello!

I'm not sure if this is the right place to ask this kind of question or
not.  If this is inappropriate for this list, I apologize (and request
suggestions on other forums).

Anyway, I'm using xerces-c to read in some fairly complicated XML files.
The files are complicated in that there are a lot of different elements
and data types.

What I'm concerned about is keeping my code as readable, maintainable,
and simple as possible.  Is there a elegant way to maintain all element
information in code?

Right now, in my Handler's startElement() method, I essentially have a
lengthy if/else if block (and sometimes some other logic) to keep track
of state (i.e. what element I'm currently looking at).

Granted the code is simple, but it's certainly not pretty, and (as a
rule of thumb) when I start writing ugly code, I wonder if I'm missing
something.

Any thoughts here?  Is there any existing code that might give me some
good ideas on how to best structure my program?  E.g., some example
programs that are a little more substantial than those distributed with
xerces-c?

Thanks!
Matt

-- 
Matt Garman
email at: http://raw-sewage.net/index.php?file=email

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org