Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 88083 invoked from network); 4 Feb 2009 19:35:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2009 19:35:42 -0000 Received: (qmail 77405 invoked by uid 500); 4 Feb 2009 19:35:38 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 77331 invoked by uid 500); 4 Feb 2009 19:35:38 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 77320 invoked by uid 99); 4 Feb 2009 19:35:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 11:35:38 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rahul.akolkar@gmail.com designates 74.125.92.149 as permitted sender) Received: from [74.125.92.149] (HELO qw-out-1920.google.com) (74.125.92.149) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 19:35:31 +0000 Received: by qw-out-1920.google.com with SMTP id 4so1065313qwk.60 for ; Wed, 04 Feb 2009 11:35:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=W4C5oMdkdbFSGchdmg3CHoCEka2Sz7iru/lw7dMQNd4=; b=vAMkY53QY5170KjM8Uq2pIDqLiuYGDjpAP0AVhtybkqFADk0SQ2UlQZB54Llwp4hpX 5tEU3Akfl0xlXBeeeeShdenFHsU0uNVDJE9jGuZov53fc+BlqSDg2edsUavxqmQZ5K+G ilOHNh9a58qSa8yGQOIFfxITIWQ9VYxgyvV7I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gnPNF+TakmnuuYmO9eMYd2cS/gona6qI+7O9nFjyvGqJAqG6LBOD4+xB70MEE1GKQR j9QH+Dl6T4DYjLIWarOCbTM+2gGj/ryfJwh4vNNuxDYlFnP9RvNj8Y+6VJClVS5zPdgR hdn/9MOQ6xmK0YXd+ZDa6Af98On38Z3QpMYF8= MIME-Version: 1.0 Received: by 10.229.94.129 with SMTP id z1mr816243qcm.22.1233776110577; Wed, 04 Feb 2009 11:35:10 -0800 (PST) In-Reply-To: <3068ddbc0902041043l25346f60gcc2cbd34e77a4a63@mail.gmail.com> References: <3068ddbc0902041043l25346f60gcc2cbd34e77a4a63@mail.gmail.com> Date: Wed, 4 Feb 2009 14:35:10 -0500 Message-ID: Subject: Re: Digester pattern with attribute From: Rahul Akolkar To: Commons Users List Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Feb 4, 2009 at 1:43 PM, =E5=D7=C7=C5=CE=C9=CA =E1=CE=D4=C1=C5=D7 wrote: > Hi > > Can I use attribute value as a constraint in a pattern for Digester? > > For example > > > ... > > 00000000 > 99999999 > > ... > > > I would like to use pattern to match home phone only. Something like > "contact/phone[@type=3D'home']". > No. Commons Digester uses what it calls element matching patterns -- they aren't true XPath expressions so the example above can't be used as intended (only element names are matched). Short of defining your own digester Rule or Rules implementations, perhaps you can simply ignore the bits you don't care about (so lets say you use SetNextRule to add Phone objects to a Contact object, you could ignore phones that aren't home phones). -Rahul > ------ > Evgeny > > Thanks > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org