You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stefan Heimann <ma...@stefanheimann.net> on 2002/09/01 16:08:09 UTC

[Digester] Namespacesupport, Patch

Hi all,

as posted earlier, here is the patch that adds support for rules that
can match element in different namespaces. For example, its possible
the have a pattern ``/foo:a/bar:b'' that matches

<foo:a>
  <bar:b/>
</foo:a>

but not

<foo:a>
  <foo:b/>
</foo:a>

You would setup the rule like that:

Rules rules = digester.getRules();
rules.registerNamespacePrefix("foo", "http://www.foo.com");
rules.registerNamespacePrefix("bar", "http://www.bar.com");
rules.addRule("/foo:a/bar:b", new MyRule());


I have updated the matching behaviour of RulesBase and
ExtendedBaseRules. The matching semantic did not change, there are
only some more possibilities.

All unit-tests are running.

Bye,
  Stefan

-- 
Stefan Heimann       | http://www.stefanheimann.net
Brandensteinstr. 5   | http://www.cantaloop.org
D-79110 Freiburg     | http://cvsshell.sourceforge.net

Re: [Digester] Namespacesupport, Patch

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Tuesday, September 3, 2002, at 12:43 PM, Stefan Heimann wrote:

<snip>

> I posted some questions and suggestions 2 weeks ago, but the reaction
> was not that overwhelming...

your timing was bad. not only during a release cycle for digester but also 
for tomcat.

> Anyway, I would be cool, if one of the commiters could post a comment
> on my patch. It's a little bit disappointing sending a patch to a
> mailinglist without getting feedback from a commiter.

i'm a committer :)

i've not looked at your patch because from our previous discussions, i don'
t feel that i'd be comfortable committing it. i personally don't have the 
time and energy to maintain two branches which are largely incompatible. 
(other people might feel differently.)

but i do think that your patch and the design discussions about it have 
been useful. i think that we'll be able to design something that is 
(largely) compatible with improved namespace support but it'll probably be 
based on the exist code rather than starting with your patch.

- robert


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re: [Digester] Namespacesupport, Patch

Posted by Stefan Heimann <ma...@stefanheimann.net>.
On Mon, Sep 02, 2002 at 10:18:49PM +0100, robert burrell donkin wrote:
> On Monday, September 2, 2002, at 03:15 PM, Christopher Lenz wrote:
> 
> >Stefan Heimann wrote:
> 
> <snip>
> 
> >>You could also write the class DigesterContext and the QNameList would
> >>be one of its property.
> >>Have you also implemented your proposal?
> >
> >No, just some parts to see if what I was wanting to do was at all 
> >possible. I wanted to get feedback from the community first.
> 
> probably a wise move :)
> 
> i've taken a (quick) look at your proposal and i'm in broad agreement. 
> what's more, i think that the time is now right to think about making 
> these kinds of changes.
> 
> (i can't speak for anyone else but) i have a number of observations and 
> comments which i'd like to make. i'm not sure how the best to make them 
> (and i'll need some more time to think about some of them) but i'd say 
> starting to implement would be a little premature just yet.

I posted some questions and suggestions 2 weeks ago, but the reaction
was not that overwhelming...

Anyway, I would be cool, if one of the commiters could post a comment
on my patch. It's a little bit disappointing sending a patch to a
mailinglist without getting feedback from a commiter.

Bye,
  Stefan

-- 
Stefan Heimann       | http://www.stefanheimann.net
Brandensteinstr. 5   | http://www.cantaloop.org
D-79110 Freiburg     | http://cvsshell.sourceforge.net

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Digester] Namespacesupport, Patch

Posted by Christopher Lenz <cm...@gmx.de>.
Stefan Heimann wrote:
> Maybe you should also have a look at the discusion some weeks ago:
> 
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgId=426673
> 
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgId=440886
> 
> Bye,
>   Stefan

Stefan,
I obviously missed that thread (was unsubscribed during vacation)...
Apologies :P

-- 
Christopher Lenz
/=/ cmlenz at gmx.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re: [Digester] Namespacesupport, Patch

Posted by Stefan Heimann <ma...@stefanheimann.net>.
On Mon, Sep 02, 2002 at 04:15:55PM +0200, Christopher Lenz wrote:
> Stefan Heimann wrote:
> 
> No, just some parts to see if what I was wanting to do was at all 
> possible. I wanted to get feedback from the community first.

Maybe you should also have a look at the discusion some weeks ago:

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgId=426673

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgId=440886

Bye,
  Stefan

-- 
Stefan Heimann       | http://www.stefanheimann.net
Brandensteinstr. 5   | http://www.cantaloop.org
D-79110 Freiburg     | http://cvsshell.sourceforge.net

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Digester] Namespacesupport, Patch

Posted by robert burrell donkin <ro...@mac.com>.
On Monday, September 2, 2002, at 03:15 PM, Christopher Lenz wrote:

> Stefan Heimann wrote:

<snip>

>> You could also write the class DigesterContext and the QNameList would
>> be one of its property.
>> Have you also implemented your proposal?
>
> No, just some parts to see if what I was wanting to do was at all 
> possible. I wanted to get feedback from the community first.

probably a wise move :)

i've taken a (quick) look at your proposal and i'm in broad agreement. 
what's more, i think that the time is now right to think about making 
these kinds of changes.

(i can't speak for anyone else but) i have a number of observations and 
comments which i'd like to make. i'm not sure how the best to make them 
(and i'll need some more time to think about some of them) but i'd say 
starting to implement would be a little premature just yet.

- robert


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Digester] Namespacesupport, Patch

Posted by Christopher Lenz <cm...@gmx.de>.
Stefan Heimann wrote:
> I have read your proposal. It describes the problem very good. My
> patch is very near to your proposal. Just rename QNameList into
> DigesterContext and add some more method (the methods you've suggested
> would be very helpful) and you are done. 

Yeah, I've been looking at your patch and noticed a lot of things that I 
have (or would have) done similarly. The main point is that I think 
there should be an interim release with the appropriate deprecations 
etc, so I'd break up the patch into smaller chunks, and also there are 
some changes that I don't think are necessary. But that's up to the 
committers to decide, I guess :o)

> You could also write the class DigesterContext and the QNameList would
> be one of its property.
> 
> Have you also implemented your proposal?

No, just some parts to see if what I was wanting to do was at all 
possible. I wanted to get feedback from the community first.

-- 
Christopher Lenz
/=/ cmlenz at gmx.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re: [Digester] Namespacesupport, Patch

Posted by Stefan Heimann <ma...@stefanheimann.net>.
On Mon, Sep 02, 2002 at 03:34:28PM +0200, Christopher Lenz wrote:
> Stefan Heimann wrote:
> >On Mon, Sep 02, 2002 at 02:58:26PM +0200, Christopher Lenz wrote:
> >
> >>Hi Stefan,
> >>
> >>Stefan Heimann wrote:
> >>
> >>>Hi all,
> >>>
> >>>as posted earlier, here is the patch that adds support for rules that
> >>>can match element in different namespaces. For example, its possible
> >>>the have a pattern ``/foo:a/bar:b'' that matches
> >>
> >>[...]
> >>
> >>>I have updated the matching behaviour of RulesBase and
> >>>ExtendedBaseRules. The matching semantic did not change, there are
> >>>only some more possibilities.
> >>
> >>While I would love to see the functionality you've added in Digester, I 
> >>think the change should be done with more care.
> >
> >
> >Could you describe more exactly what you mean by ``with more care''?
> 
> Maybe that sounded too harsh, I didn't want to express that the code was 
> not good or anything ;o)
> 
> My basic concern is that you're proposing backwards incompatible API 
> changes just to replace the pattern-String with a QNameList (IIRC). My 
> suggestion is to replace it with a more generic class that represents 
> the input document context (I've called it DigesterContext in my 
> example). The reasoning for this is that it allows further extension, 
> like matching against attributes or body text.

I have read your proposal. It describes the problem very good. My
patch is very near to your proposal. Just rename QNameList into
DigesterContext and add some more method (the methods you've suggested
would be very helpful) and you are done. 

You could also write the class DigesterContext and the QNameList would
be one of its property.

Have you also implemented your proposal?

Bye,
  Stefan

-- 
Stefan Heimann       | http://www.stefanheimann.net
Brandensteinstr. 5   | http://www.cantaloop.org
D-79110 Freiburg     | http://cvsshell.sourceforge.net

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Digester] Namespacesupport, Patch

Posted by Christopher Lenz <cm...@gmx.de>.
Stefan Heimann wrote:
> On Mon, Sep 02, 2002 at 02:58:26PM +0200, Christopher Lenz wrote:
> 
>>Hi Stefan,
>>
>>Stefan Heimann wrote:
>>
>>>Hi all,
>>>
>>>as posted earlier, here is the patch that adds support for rules that
>>>can match element in different namespaces. For example, its possible
>>>the have a pattern ``/foo:a/bar:b'' that matches
>>
>>[...]
>>
>>>I have updated the matching behaviour of RulesBase and
>>>ExtendedBaseRules. The matching semantic did not change, there are
>>>only some more possibilities.
>>
>>While I would love to see the functionality you've added in Digester, I 
>>think the change should be done with more care.
> 
> 
> Could you describe more exactly what you mean by ``with more care''?

Maybe that sounded too harsh, I didn't want to express that the code was 
not good or anything ;o)

My basic concern is that you're proposing backwards incompatible API 
changes just to replace the pattern-String with a QNameList (IIRC). My 
suggestion is to replace it with a more generic class that represents 
the input document context (I've called it DigesterContext in my 
example). The reasoning for this is that it allows further extension, 
like matching against attributes or body text.

For example, the DigesterContext implementation could be made pluggable 
to allow real document object models that enable full-blown XPath 
pattern matching. Of course that's an extreme example, what I want to 
express is that if the API is changed, it should be done with further 
extensions in mind.

I've posted my PROPOSAL a couple of minutes ago, maybe you wanna read it 
(but it's looooooooong ;o))

-- 
Christopher Lenz
/=/ cmlenz at gmx.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re: [Digester] Namespacesupport, Patch

Posted by Stefan Heimann <ma...@stefanheimann.net>.
On Mon, Sep 02, 2002 at 02:58:26PM +0200, Christopher Lenz wrote:
> Hi Stefan,
> 
> Stefan Heimann wrote:
> >Hi all,
> >
> >as posted earlier, here is the patch that adds support for rules that
> >can match element in different namespaces. For example, its possible
> >the have a pattern ``/foo:a/bar:b'' that matches
> [...]
> >I have updated the matching behaviour of RulesBase and
> >ExtendedBaseRules. The matching semantic did not change, there are
> >only some more possibilities.
> 
> While I would love to see the functionality you've added in Digester, I 
> think the change should be done with more care.

Could you describe more exactly what you mean by ``with more care''?


Bye,
  Stefan

-- 
Stefan Heimann       | http://www.stefanheimann.net
Brandensteinstr. 5   | http://www.cantaloop.org
D-79110 Freiburg     | http://cvsshell.sourceforge.net

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Digester] Namespacesupport, Patch

Posted by Christopher Lenz <cm...@gmx.de>.
Hi Stefan,

Stefan Heimann wrote:
> Hi all,
> 
> as posted earlier, here is the patch that adds support for rules that
> can match element in different namespaces. For example, its possible
> the have a pattern ``/foo:a/bar:b'' that matches
[...]
> I have updated the matching behaviour of RulesBase and
> ExtendedBaseRules. The matching semantic did not change, there are
> only some more possibilities.

While I would love to see the functionality you've added in Digester, I 
think the change should be done with more care.

Strangely, I've been myself playing with such changes (see 
http://nagoya.apache.org/eyebrowse/BrowseList?\
listName=commons-user@jakarta.apache.org&by=thread&from=230243) and was 
just writing together a PROPOSAL for an implementation that I'll be 
sending to this list in a couple of minutes.

Note: I'm not a digester-contributor or even commons-committer, so I'm 
basically just expressing my concerns as a user ;o)

-- 
Christopher Lenz
/=/ cmlenz at gmx.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>