I figured you had 2.7.0 or 2.7.1 kicking around somewhere.

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

"Sergey Vidyuk" <[EMAIL PROTECTED]> wrote on 10/09/2006 12:44:12 PM:

> oops. I had xerces 2.7 in endorsed dir of tomcat. Seems that code works.
> My fault!
> Great thanks!
> 
> On 10/9/06, Sergey Vidyuk <[EMAIL PROTECTED]> wrote:
> > Yes. xercesImpl.jar in folder WEB-INF/lib/ has version 2.8.1.
> > Should i move it to endorsed folder of tomcat?
> >
> > Thanks for response.
> >
> > Sergey
> >
> > On 10/9/06, Michael Glavassevich <[EMAIL PROTECTED]> wrote:
> > > Are you sure you were using Xerces 2.8.1 when you tried this? This 
looks
> > > identical to a bug [1][2] that was reported last year and fixed in 
Xerces
> > > 2.8.0. The test which was attached to that bug report still works 
for me.
> > >
> > > [1]
> > > http://mail-archives.apache.org/mod_mbox/xerces-j-users/200510.
> mbox/[EMAIL PROTECTED]
> > > [2] http://issues.apache.org/jira/browse/XERCESJ-1106
> > >
> > > Michael Glavassevich
> > > XML Parser Development
> > > IBM Toronto Lab
> > > E-mail: [EMAIL PROTECTED]
> > > E-mail: [EMAIL PROTECTED]
> > >
> > > "Sergey Vidyuk" <[EMAIL PROTECTED]> wrote on 10/09/2006 11:23:41 AM:
> > >
> > > > When trying to adopt node after parsing
> > > >     public static Node parseString(Document doc, String content)
> > > >             throws Exception
> > > > StringReader contentReader = new StringReader(content);
> > > >         InputSource source = new InputSource(contentReader);
> > > >         DocumentBuilder b = XMLTools.get(false, false);
> > > >         Document sourceDoc = b.parse(source);
> > > >         XMLTools.release(b, false, false);
> > > >         Node root = sourceDoc.getFirstChild();
> > > >         Node imported = doc.adoptNode(root);
> > > >         if (imported == null) {
> > > >             System.out.println("not adopted");
> > > >             imported = doc.importNode(root, true);
> > > >         }
> > > > return imported;
> > > > }
> > > >
> > > >
> > > > folowing error occur:
> > > > java.lang.ClassCastException: org.apache.xerces.dom.DocumentImpl
> > > >         at
> > > org.apache.xerces.dom.DeferredAttrImpl.synchronizeChildren(Unknown
> > > > Source)
> > > >         at org.apache.xerces.dom.AttrImpl.setOwnerDocument(Unknown
> > > Source)
> > > >         at
> > > org.apache.xerces.dom.NamedNodeMapImpl.setOwnerDocument(Unknown
> > > > Source)
> > > >         at 
org.apache.xerces.dom.ElementImpl.setOwnerDocument(Unknown
> > > Source)
> > > >         at 
org.apache.xerces.dom.ParentNode.setOwnerDocument(Unknown
> > > Source)
> > > >         at 
org.apache.xerces.dom.ElementImpl.setOwnerDocument(Unknown
> > > Source)
> > > >         at 
org.apache.xerces.dom.CoreDocumentImpl.adoptNode(Unknown
> > > Source)
> > > >
> > > >
> > > > Java: JDK 1.5.0_08 Xerces 2.8.1
> > > >
> > > > What I do wrong?
> > > >
> > > > 
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to