Return-Path: X-Original-To: apmail-axis-java-user-archive@www.apache.org Delivered-To: apmail-axis-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D193ADD31 for ; Mon, 1 Oct 2012 10:02:45 +0000 (UTC) Received: (qmail 32071 invoked by uid 500); 1 Oct 2012 10:02:44 -0000 Delivered-To: apmail-axis-java-user-archive@axis.apache.org Received: (qmail 31916 invoked by uid 500); 1 Oct 2012 10:02:44 -0000 Mailing-List: contact java-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@axis.apache.org Delivered-To: mailing list java-user@axis.apache.org Received: (qmail 31887 invoked by uid 99); 1 Oct 2012 10:02:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 10:02:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of filippo.agazzi@studenti.unipr.it designates 74.125.82.51 as permitted sender) Received: from [74.125.82.51] (HELO mail-wg0-f51.google.com) (74.125.82.51) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 10:02:36 +0000 Received: by wgbed3 with SMTP id ed3so2051271wgb.32 for ; Mon, 01 Oct 2012 03:02:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=mw9vy/sZwcfwmi+C3CkAOLSZT6SzYNamrQa4jGhuu+8=; b=Jk8XNsqFU87Q/t27++RzAaZjljMw/HrhVInFDckU8PyB+Yv42h7XH2qTL3BQOAZrTB RbQLXov+K+5OvmNuIO5bCaFLNgrZ+Z98/F21AEWPykqIfhB/i5E+PRWj4U8Xcsx2clXH ECWGN9oFZjpkshT2mqGw652SxXMHHXkaxDUepGCfGhJnnBWA1f5mIdnbBY7Bg3aKkTAo AAZ8fE8p6sKU818OpSbsBO17yLVINpOcf50r2hN0Ujdq0R+A9Fr0kOpK/D2SOTxxDYdy Gns/gEeSYf037eHfDeMhymXWbg4SDTp3iI/CHrwNH72n1DrXHqgGtI58qx7WnuHKBQyr LpRg== MIME-Version: 1.0 Received: by 10.180.85.99 with SMTP id g3mr13504892wiz.5.1349085733763; Mon, 01 Oct 2012 03:02:13 -0700 (PDT) Received: by 10.180.164.106 with HTTP; Mon, 1 Oct 2012 03:02:13 -0700 (PDT) Date: Mon, 1 Oct 2012 12:02:13 +0200 Message-ID: Subject: [AXIS2][AXIOM] org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR with OMElement created from XML file. HELP ME PLEASE, IMPORTANT! From: FILIPPO AGAZZI To: java-user@axis.apache.org Content-Type: multipart/alternative; boundary=f46d04182568eeb9ff04cafc7f14 X-Gm-Message-State: ALoCoQkDP08c9dYyILUpYwY9crHWAqUaPIYfe9OKLOoYhgCIpY+dsq9I34ui/SZ33NmpsdLeBkY2 X-Virus-Checked: Checked by ClamAV on apache.org --f46d04182568eeb9ff04cafc7f14 Content-Type: text/plain; charset=ISO-8859-1 Hi, i've got a big problem with this: i wanto to do sth like this. FileInputStream policyStream = null; try { policyStream = new FileInputStream (policy_file); } catch (FileNotFoundException e) { e.printStackTrace(); } StAXOMBuilder stAXOMBuilder = new StAXOMBuilder(policyStream); OMElement documentElement = stAXOMBuilder.getDocumentElement(); tnPolicyColl.addChild(documentElement); where tnPolicyColl is an OMElement created with a determinate OMFactory. But i get an error " WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it." By many searches i understand that thw two OMElement must have the same OMFactory. But, the problem is: how can i do this, when i need to attach as a child an OMElement created from a source, that is a n XML File? I try also this: FileReader soapFileReader = new FileReader(policy_file); XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(soapFileReader); StAXOMBuilder stAXOMBuilder = new StAXOMBuilder(omFactory, parser); OMElement documentElement = stAXOMBuilder.getDocumentElement(); But it didn't work. How can i creat an AXIOM object, with a child created from XML File? Please help me, i'm in big trouble! Thanks in advance, Agazzi --f46d04182568eeb9ff04cafc7f14 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,
i've got a big problem with this: i wanto to do sth like this.
FileInputStream policyStream =3D null;
=A0=A0=A0 =A0=A0=A0 =A0=A0= =A0 =A0=A0=A0 try {
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 po= licyStream =3D new FileInputStream (policy_file);
=A0=A0=A0 =A0=A0=A0 = =A0=A0=A0 =A0=A0=A0 } catch (FileNotFoundException e) {
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 e.printStackTrace();
= =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 }
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 = =A0=A0=A0 StAXOMBuilder stAXOMBuilder =3D new StAXOMBuilder(policyStream);<= br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 OMElement documentElement =3D st= AXOMBuilder.getDocumentElement();

tnPolicyColl.addChild(documentElement);
where tnPolicyColl is an OME= lement created with a determinate OMFactory.

But i get an error &quo= t; WRONG_DOCUMENT_ERR: A node is used in a different document than the one = that created it." By many searches i understand that thw two OMElement= must have the same OMFactory. But, the problem is: how can i do this, when= i need to attach as a child an OMElement created from a source, that is a = n XML File? I try also this:

FileReader soapFileReader =3D new FileReader(policy_file);
=A0=A0=A0= =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 XMLStreamReader parser =3D=A0 XMLInputFactor= y.newInstance().createXMLStreamReader(soapFileReader);
=A0=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0=A0=A0 StAXOMBuilder stAXOMBuilder =3D=A0 new StAXOMBuilde= r(omFactory, parser);
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 OMElement documentElement =3D stAXO= MBuilder.getDocumentElement();

But it didn't work. How can i cre= at an AXIOM object, with a child created from XML File? Please help me, i&#= 39;m in big trouble!
Thanks in advance,
Agazzi
--f46d04182568eeb9ff04cafc7f14--