W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

Re: importNode and handling of ID attributes

From: Eric Lawson <ericl@isogen.com>
Date: Tue, 08 May 2001 09:23:38 -0500
Message-ID: <3AF8016A.33CBEC8B@isogen.com>
To: Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
CC: www-dom@w3.org
    That is a very interesting point. On top of that, I would also like to ask a
question about how fixed and defaulted attributes should be handled in a
importNode() operation.
    As we all know, importNode() is desigend to reflect the syntactic content of
the XML it describes, thus, importNode() does not import fixed and defaulted
attributes(more exactly, it only imports attributes directly expressed in the
document instance).
    My question is, what is the method to restore the fixed and defaulted
attributes in the DOM tree that has imported these nodes (which may conform to a
different DTD)?
    I believe that importNode() is not useful if it does not preserve both the
syntax and semantics of the content being imported. Without that, the document
importing the nodes only gets "half the picture".

    Any comments would be appreciated.

    Eric Lawson
    Sr. Software Engineer
    ISOGEN International
    (214)954-5109

Karl Scheibelhofer wrote:

> perhaphs, one of you could clearify this issue.
>
> is it the responsibility of the 'importNode' function to take care of ID
> attributes? i mean, should it investigate all imported attributes, if they
> are of type ID and register them to the document, such that a subsequent
> call to 'getElementById' really returns the expected result node. if the
> 'importNode' function does not care about ID attributes, the
> 'getElementById' is sort of useless after a call to 'importNode'. moreover,
> the application has no means to find out what attributes are of type ID and
> no way to register IDs to a document.
> i am aware of the fact that this can only work, if the attributes are of the
> same implementation.
>
> xerces-j for instance, does not care about the IDs. but i think this is not
> the right solution. in a current project, i realized that importNode is
> useless as it is, if you need IDs.
>
> regards
>
>   Karl Scheibelhofer
>
> --
>
> Karl Scheibelhofer, <mailto:Karl.Scheibelhofer@iaik.at>
> Institute for Applied Information Processing and Communications (IAIK)
> at Technical University of Graz, Austria, http://www.iaik.at
> Phone: (+43) (316) 873-5540
Received on Tuesday, 8 May 2001 10:27:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT