Return-Path: Delivered-To: apmail-xmlbeans-user-archive@www.apache.org Received: (qmail 17930 invoked from network); 29 Sep 2006 09:12:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Sep 2006 09:12:36 -0000 Received: (qmail 56074 invoked by uid 500); 29 Sep 2006 09:12:35 -0000 Delivered-To: apmail-xmlbeans-user-archive@xmlbeans.apache.org Received: (qmail 56045 invoked by uid 500); 29 Sep 2006 09:12:34 -0000 Mailing-List: contact user-help@xmlbeans.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: user@xmlbeans.apache.org List-Id: Delivered-To: mailing list user@xmlbeans.apache.org Received: (qmail 56034 invoked by uid 99); 29 Sep 2006 09:12:34 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Sep 2006 02:12:34 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [194.109.24.21] ([194.109.24.21:4578] helo=smtp-vbr1.xs4all.nl) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id C4/25-10102-083EC154 for ; Fri, 29 Sep 2006 02:12:34 -0700 Received: from lembeh (x-hive.xs4all.nl [80.126.178.42]) by smtp-vbr1.xs4all.nl (8.13.8/8.13.8) with ESMTP id k8T9CT9A056152 for ; Fri, 29 Sep 2006 11:12:29 +0200 (CEST) (envelope-from ewout@x-hive.com) Message-Id: <200609290912.k8T9CT9A056152@smtp-vbr1.xs4all.nl> From: "Ewout Graswinckel" To: Subject: Instantiating a section of an xml document Date: Fri, 29 Sep 2006 11:12:29 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 thread-index: Acbjp2NCqlq5zBpFSBCxzqZk1JF01w== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-Virus-Scanned: by XS4ALL Virus Scanner X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I'd like to know if it's possible to instantiate only a single node from a document. I'm using an xml database to return a node from some document using xquery/xpath. Once I have that node I'd like to use xmlbeans to easily access it. So far I've come up with this: ...... abc .... Class 'Block' represents the block element in the xml. Node n = getNodeFromDatabaseUsingXpath("doc('.')/descendant-or-self::block[1]"); Block block = (Block) XmlBeans.getContextTypeLoader().parse(n, Block.type, null); assertEquals("abc", block.getSomething()); // block.getSomething() == null This doesn't give any exceptions, but calling block.getSomething() simply returns null. I can get it to work if I let my query return an element instead of , but this is not desired in my case. Is there a better way to do this? Thanks, Ewout --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org For additional commands, e-mail: user-help@xmlbeans.apache.org