Paul Tomsic <[EMAIL PROTECTED]> wrote on 09/01/2006 02:52:26 PM:

> Hi, 
> 
> I'm trying to pre-cache nodes in a document that are
> of type mixed-content, so i do the checking, and find
> nodes that are mixed-content and store them in a list.
> 
> the problem is, though, when i try to compare various
> nodes that i've retrieved via Xpath against those that
> are in the list of mixed content nodes, my list
> contains PSVIElementNSImpl nodes as opposed to
> org.w3c.dom.Nodes, so a simple list.contains(node)
> fails.
>
> is there some way to compare these?

The DOM specification doesn't define what equals() means for DOM nodes. If 
you want to use them in java.util collections you should wrap them in 
another object whose equals() method calls Node.isEqualNode() [1]. This is 
the method defined by DOM for comparing whether two nodes are equal.

> i can't seem to cast it straight to a
> PSVIElementNSImpl (the node i'm trying to compare),
> b/c it's expecting a DeferredElementImpl.
> 
> thoughts?
> 
> thanks
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

[1] 
http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/Node.html#isEqualNode(org.w3c.dom.Node)


Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]


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

Reply via email to