You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Dustin Whitney <du...@gmail.com> on 2007/05/09 00:36:19 UTC
JXPath setting values with predicates
Hello,
I like JXPath, but I'd like to make a change to the source, and I'm
hoping for some advice here. When using the
JXPathContext.createPathAndSetValue() method on some Java beans, I get an
exception if something like:
/appQuestions[@detailGroup = 'Rental Reimbursement' and @detailName =
'Number']/detail
results in the predicate returning an null value. But, using the same
createPathAndSetValue() method with that XPath when the predicate does not
result in null, works just fine. I could easily turn my predicate into an
object if I were dumped into my AbstractFactory.createObject() method. Can
anyone suggest what I might change to make that happen, or give a good
explanation as to why I should not do that?
Thanks,
Dustin
Re: JXPath setting values with predicates
Posted by Matt Benson <gu...@yahoo.com>.
--- Dustin Whitney <du...@gmail.com> wrote:
> Well, I quit the job where I was going to use that.
> However, it would be
> awesome if what I described worked :) I remember
> searching through the code
> and making a few changes, but not really getting
> anywhere.
Seems kind of strange now that I read it carefully.
There is code in the RI that disallows this, probably
because it's a PITA. :) That said, there would be no
reason you couldn't extend the RI to allow this, in
theory. I'll leave it at that.
Thanks,
Matt
>
> -Dustin
>
> On 7/3/07, Matt Benson <gu...@yahoo.com> wrote:
> >
> > Was just going through my flagged mail and
> realized
> > I'd never followed up here. What's your current
> > status, Dustin?
> >
> > -Matt
> >
> > --- Dustin Whitney <du...@gmail.com>
> wrote:
> >
> > > Hello,
> > >
> > > I like JXPath, but I'd like to make a change
> to
> > > the source, and I'm
> > > hoping for some advice here. When using the
> > > JXPathContext.createPathAndSetValue() method on
> some
> > > Java beans, I get an
> > > exception if something like:
> > >
> > > /appQuestions[@detailGroup = 'Rental
> Reimbursement'
> > > and @detailName =
> > > 'Number']/detail
> > >
> > > results in the predicate returning an null
> value.
> > > But, using the same
> > > createPathAndSetValue() method with that XPath
> when
> > > the predicate does not
> > > result in null, works just fine. I could easily
> > > turn my predicate into an
> > > object if I were dumped into my
> > > AbstractFactory.createObject() method. Can
> > > anyone suggest what I might change to make that
> > > happen, or give a good
> > > explanation as to why I should not do that?
> > >
> > > Thanks,
> > > Dustin
> > >
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Shape Yahoo! in your own image. Join our Network
> Research Panel today!
> >
>
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
> >
> >
> >
>
____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: JXPath setting values with predicates
Posted by Dustin Whitney <du...@gmail.com>.
Well, I quit the job where I was going to use that. However, it would be
awesome if what I described worked :) I remember searching through the code
and making a few changes, but not really getting anywhere.
-Dustin
On 7/3/07, Matt Benson <gu...@yahoo.com> wrote:
>
> Was just going through my flagged mail and realized
> I'd never followed up here. What's your current
> status, Dustin?
>
> -Matt
>
> --- Dustin Whitney <du...@gmail.com> wrote:
>
> > Hello,
> >
> > I like JXPath, but I'd like to make a change to
> > the source, and I'm
> > hoping for some advice here. When using the
> > JXPathContext.createPathAndSetValue() method on some
> > Java beans, I get an
> > exception if something like:
> >
> > /appQuestions[@detailGroup = 'Rental Reimbursement'
> > and @detailName =
> > 'Number']/detail
> >
> > results in the predicate returning an null value.
> > But, using the same
> > createPathAndSetValue() method with that XPath when
> > the predicate does not
> > result in null, works just fine. I could easily
> > turn my predicate into an
> > object if I were dumped into my
> > AbstractFactory.createObject() method. Can
> > anyone suggest what I might change to make that
> > happen, or give a good
> > explanation as to why I should not do that?
> >
> > Thanks,
> > Dustin
> >
>
>
>
>
> ____________________________________________________________________________________
> Shape Yahoo! in your own image. Join our Network Research Panel today!
> http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
>
>
>
Re: JXPath setting values with predicates
Posted by Matt Benson <gu...@yahoo.com>.
Was just going through my flagged mail and realized
I'd never followed up here. What's your current
status, Dustin?
-Matt
--- Dustin Whitney <du...@gmail.com> wrote:
> Hello,
>
> I like JXPath, but I'd like to make a change to
> the source, and I'm
> hoping for some advice here. When using the
> JXPathContext.createPathAndSetValue() method on some
> Java beans, I get an
> exception if something like:
>
> /appQuestions[@detailGroup = 'Rental Reimbursement'
> and @detailName =
> 'Number']/detail
>
> results in the predicate returning an null value.
> But, using the same
> createPathAndSetValue() method with that XPath when
> the predicate does not
> result in null, works just fine. I could easily
> turn my predicate into an
> object if I were dumped into my
> AbstractFactory.createObject() method. Can
> anyone suggest what I might change to make that
> happen, or give a good
> explanation as to why I should not do that?
>
> Thanks,
> Dustin
>
____________________________________________________________________________________
Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org