You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Karl Scheibelhofer <Ka...@iaik.at> on 2001/05/09 15:51:14 UTC

RE: ID handling when importing and appending nodes

i contacted the DOM mailing list for clarification.
here is an answer:

-----Original Message-----
From: www-dom-request@w3.org [mailto:www-dom-request@w3.org]On Behalf Of
Joseph Kesselman
Sent: Tuesday, May 08, 2001 7:13 PM
To: www-dom@w3.org
Subject: Re: importNode and handling of ID attributes



>is it the responsibility of the 'importNode' function to take care of ID
>attributes?

Yes, _IF_ the importing DOM understands IDs and has the information
available to determine whether an attribute is or isn't an ID. As
you point
out, this currently relies on some undocumented and unexposed magic within
the DOM implementation, so the right answer is to check your DOM
implementation's documentation to find out what it does. (Not all
DOMs have
or use ID information, as we mentioned in the description of
getElementByID.)

Note that the question of which attributes are and aren't IDs would be
determined by the importing document, _not_ by the source document.

Again, DOM Level 3's DTD/Schema support will provide a more rigorous
definition of this behavior, for those DOMs which choose to implement that
module.

______________________________________
 Joe Kesselman  / IBM Research


> -----Original Message-----
> From: Karl Scheibelhofer [mailto:Karl.Scheibelhofer@iaik.at]
> Sent: Wednesday, April 25, 2001 8:31 AM
> To: Xerces-j Dev
> Subject: ID handling when importing and appending nodes
>
>
> hi,
>
> i realized that xerces does not care about the handling of ID attributes,
> when you import and append nodes from a different document; i.e.
> attributes
> of type ID. but i think xerces should (must) take care of this an register
> the ID attributes to the new document coreectly. it is the only solution
> that makes sense, because the user has no chance to figure out what nodes
> are of type ID, if he needs to handle arbitrary types of documents. only
> xerces can know this.
> if xerces does not care about ID attributes when importing nodes, this is
> the case for the current xerces, you can forget the getElementById(String)
> method, because it won't work, if you use importNode(Node,boolean).
>
> i posted this topic already on the user list some days ago, but
> got not much
> feedback.
>
> regards
>
>   Karl
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>
>


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