Re: Interpreting XML tag as HashMap

Ben Coburn <[email protected]> Mon, 28 Oct 2002 15:36:01 -0500 (EST)
Newsgroups gmane.comp.java.enhydra.zeus
Message-ID <[email protected]>
On Mon, 28 Oct 2002, Christophe Contreras wrote:

> Hello Zeus people; sent this mail 5 days ago, and it didn't pass
> are there server problems ?
> cc
> ----------
> 
> 
> Hello Ben
> 
> Your "key" is really near to the ID/IDREF concept.
> I have been quickly looking to this, because I need a system too that
> could help refering to XML elements that are identified by this kind of
> attribute; but it seems (or seemed, at the time I had a look) that Zeus
> is unable to deal with such attributes.
> 
> Your idea of a HashMap is quite good; mine was quite same, except I
> don't think having such a table inside an element is the best way to
> deal with ID/IDREF. I was thinking about an extern register that would
> be the manager of identified entities; and well, in fact I had this idea
> yesterday ;-)
> 
> 
> It would be interesting if anyone has his own ideas to share them in
> there, since ID and IDREF are very usefull XML stuff...
> 
> So, comments are welcome! :-)
> 
> Regards,
> Christophe
> 

Um... I think I saw a copy of it come from the list-serv. Anyway I looked
up IDREF & IDs and they are not exactly what I was looking for. I was
thinking of hashing child elements based on a "key" attribute because my
XML is designed to model a class that I need to serialise. The problem
with IDs is that they are not scoped to the enclosing tag, and I need to
represent more than one hashtable (which could cause conflicts with IDs).

Currently I have been reading about Java's SAX perser API. It looks like 
writing my own custom classes will be easyer and more effective than 
trying to extend classes that were generated by Zeus. 

I think I am having these trobles with the generated classes because my
XML is derived from specific classes that I need to serialse, not a
pre-existing XML format. 

Has anyone been working on a more configurable code generator for Zeus? 
How about a code generator that will even allow you to specify an 
interface to your own code that particular generated classes will 
implement? (It could even insert dummy methods in the code so that the 
classes will still compile right away.

                            Regards, Ben Coburn


/*------------------------------------------------------------ 
Ben_Coburn ([email protected]) {http://www.silicodon.net/};
------------------------------------------------------------*/