Elliotte Harold wrote:
Murray Altheim wrote:
The type for an attribute is declared in its schema (e.g., its DTD).
If during processing you are either losing the connection to the
original schema, or you have validation turned off, the processor
won't know that a specific attribute has been declared as an ID.
I definitely know that its an ID when I start out, even though I'm not
validating. i.e. getElementByID works. I then go through a series of
contortions that involve extracting nodes, replacing them, copying them
into other documents and so forth. However I never actually touch the
attributes. They get carried along for the ride with their parent
elements. At the end of all this, getElementByID no longer works, and I
can't exactly put my finger on the place where it stops working.
I can believe that Xerces might not be storing the ID type with each
Attr object (though I do wonder what the type field that I see in my
debugger is doing). But there's certainly no fundamental reason the
IDness of an attribute should be loss just because the schema is
severed. JDOM and XOM don't lose it. And I don't see anything in the
DOM2 spec that indicates that an Attr should stop having ID type just
because it got moved from one element to another, or was imported into a
new document.
If Xerces is indeed forgetting which attributes are IDs, I'd like to
know about it, and know when it happens so maybe I can work around it.
Elliote,
I'm curious as well, since I use the DOM extensively within my
own application and have yet to have noticed any problem with
losing IDs, and I admittedly put my docs through a lot of heavy
contortions too. Like I said, perhaps stuffing printlns throughout
Xerces' and your code as the document goes through stages will
help narrow down where this happening, like perhaps writing a
temporary assertion method that causes a failure if at any time
the Document sent it shows up with no IDs.
Murray
......................................................................
Murray Altheim http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK .
The Rise of Pseudo Fascism -- David Neiwert
Part 1: The Morphing of the Conservative Movement
http://dneiwert.blogspot.com/2004_09_19_dneiwert_archive.html#109028353137888956
Part 2: The Architecture of Fascism
http://dneiwert.blogspot.com/2004_09_26_dneiwert_archive.html#109563628314780505
Part 3: The Pseudo-Fascist Campaign
http://dneiwert.blogspot.com/2004_10_03_dneiwert_archive.html#109596147171278590
Part 4: The Apocalyptic One-Party State
http://dneiwert.blogspot.com/2004_10_10_dneiwert_archive.html#109694976530359103
Part 5: Warfare By Other Means
http://dneiwert.blogspot.com/2004_10_17_dneiwert_archive.html#109755467135245579
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]