[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is DOM vs SAX a red herring?



Larry Menten writes:
>But the use of elements does require that the parsed elements be cached until enough
>information has been collected to parse them.  Except for trivial examples, this means that
>you will be allocating memory dynamically to store these until you have collected enough
>elements to identify and configure the target object.
>...
>You have provided just the leaf.  With JUNOS  you must retain the entire 
>tree in memory:
>...
>I am storing just the name, namespace ID, and attribute list for one 
>single element.

Given that the data is hierarchical in nature, how does using
attributes relieve you from tracking where you are in the configuration
hierarchy? You've got to know the parent hierarchy for your particular
element, so you need to track the same information. Attributes may
change the form of the data, but not what you need to do with it.
SAX may give you a complete set of attributes at once, but it will
normally allocate memory for these strings before handing them to
your code. I'm not following the element-implies-dom-implies-big
progression, mostly 'cause we use element, don't use DOM, and have
a fairly small footprint.

Thanks,
 Phil

--
to unsubscribe send a message to netconf-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>