Hi Seth,
The hashtable in ECS provides a lookup mechanism to quickly retrieve
an Element by name. By default this name is the string representation of the
hashcode of the element being inserted. The extra vector keeps a list of
these names so that they can be retrieved in the correct order from the
hashtable.
I sent an email a few days ago about writing a Registry class. This was one
of the things I fancied playing around with. If using the name lookup
feature is not very important then a Hashtable + Vector combination is not a
time or memory efficient method of storing elements.
Also what do you think about having a DTD parsing program that generates
subclasses of the XML element with the relevant Attribute methods attached ?
Would this be useful or not ?
Graeme Wallace
Technical Director
Interactive Network Technologies
2901 Wilcrest Drive, #100
Houston
Texas, 77042
�
Tel: 1 713 975 7434
Fax: 1 713 975 1120
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
WWW: http://www.int.com
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Seth Ladd
> Sent: Friday, December 10, 1999 8:24 AM
> To: [EMAIL PROTECTED]
> Subject: more questions for developers
>
>
> Hello,
>
> Well, I found the culprit that reorders the elements in the tree. When
> printing via OutputStream, the code gets a list of elements from the
> Vector registryList. that vector is FIFO, and keeps things in order.
> When printing via PrintWriter, you get a list of "child" elements via
> the hashtable, which does /not/ keep things in a FIFO. What was the
> thinking behind this? Once I changed the code in output(PrintWriter) to
> use the registryList instead of registry, the elements all printed out
> fine. I can post the patch if anyone is wondering.
>
> Also, the filter class should be fixed to /not/ filter whitespace if the
> element is an XML object. Currently it is doing this:
>
> <tag>this is my sentence. I just left two spaces</tag>
>
> and filtering it to
>
> <tag>this is my sentence. I just left two spaces</tag>
>
> While the filter should correctly convert entities, it should not rip
> out spaces at end of sentences. I'll fix that later today.
>
> Anyway, I am curious as to why a hashtable was used when it won't keep
> things in a "FIFO" order, which is important when printing the tags.
>
> Thanks,
> Seth
>
>
> --
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Archives and Other: <http://java.apache.org/main/mail.html>
> Problems?: [EMAIL PROTECTED]
>
>
--
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]