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.

--
Elliotte Rusty Harold  [EMAIL PROTECTED]
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to