John, a) the attributes have to be created in the scope of the oldDoc b) the attributes have to be added to node that is to be imported
regards, Harald -----Original Message----- From: tom john [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 4. April 2002 17:27 To: [EMAIL PROTECTED] Subject: RE: Error importing node with rdf Harald, thanks for the hint, but i still have the same problem. i added "xmlns:rdf" "xmlns:rm" & attribute in the node i am importing to: please check how i did it. Document newDoc = new DocumentImpl(); Node root = newDoc.createElement("root"); Attr rdfAttr = newDoc.createAttribute("xmlns:rdf"); rdfAttr.setValue("http://www.w3.org/1999/02/22-rdf-syntax-ns#"); Attr rdfAttrf = newDoc.createAttribute("xmlns:rm"); rdfAttrf.setValue("file:/schema/RelationMap#"); root = newDoc.importNode(node,true); newDoc.appendChild(root); thanks it gives error in the line whee i import NODE --- "Lemmin, Harald" <[EMAIL PROTECTED]> wrote: > John, > > one of your nodes contains a prefixed attribute. So > specify a namespace for > this prefix: > <node xmlns:yourprefix="someURI" > yourprefix:prefixedAttribute="avalue>...</node> > > regards, > Harald > > > -----Original Message----- > From: tom john [mailto:[EMAIL PROTECTED] > Sent: Donnerstag, 4. April 2002 16:07 > To: [EMAIL PROTECTED] > Subject: Error importing node with rdf > > > hi, > i need to import a node to a new document. but gives > error if a node contains 'rdf' tags. > can anyone help me with this problem? > > here is how i am doing now. > > 'node' - a node i have to import > > Document newDoc = new DocumentImpl(); > > newDoc.importNode(node, true); > > > ERROR MSG i get > org.w3c.dom.DOMException: DOM003 Namespace error > at > org.apache.xerces.dom.AttrNSImpl.<init>(AttrNSImpl.java:125) > at > org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(CoreDocumentImpl.ja > va:1355) > > looks like i have to specifiy namespace... how can i > do that? > thanks > > __________________________________________________ > Do You Yahoo!? > Yahoo! Tax Center - online filing with TurboTax > http://taxes.yahoo.com/ > > --------------------------------------------------------------------- > 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] > __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ --------------------------------------------------------------------- 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]
