You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2004/11/23 15:27:12 UTC

svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

Author: joerg
Date: Tue Nov 23 06:27:10 2004
New Revision: 106302

Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java
Log:
fixed the way of fixing the handling for null namespace URIs ...

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java?view=diff&rev=106302&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java&r1=106301&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java&r2=106302
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java	(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java	Tue Nov 23 06:27:10 2004
@@ -213,7 +213,7 @@
      */
     public void startElement(String uri, String loc, String raw, Attributes a)
     throws SAXException {
-        if ((uri == null || this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
+        if (((uri == null && this.extractURI.equals("")) || this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
             extractLevel++;
             fragmentID++;
             if (getLogger().isDebugEnabled()) {
@@ -264,7 +264,7 @@
             super.endElement(uri, loc, raw);
         } else {
             this.serializer.endElement(uri, loc, raw);
-            if ((uri == null || this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
+            if (((uri == null && this.extractURI.equals("")) || this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
                 extractLevel--;
                 if (getLogger().isDebugEnabled()) {
                     getLogger().debug("extractLevel now " + extractLevel + ".");

Re: svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

Posted by Joerg Heinicke <jo...@gmx.de>.
On 24.11.2004 01:24, Vadim Gritsenko wrote:

>>> IMHO, adding single line would be simplier:
>>>
>>>            if (uri == null) uri = "";
>>>
>>> And it can not be null anyway, so logging a warning is an option.
>>>
>>>> -        if ((uri == null || this.extractURI.equals(uri)) && 
>>>> this.extractElement.equals(loc)) {
>>>> +        if (((uri == null && this.extractURI.equals("")) || 
>>>> this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
>>
>>
>>
>> I had this in mind too, but should a transformer fix the behaviour of 
>> another component? In theory you can add this fix to every transformer 
>> or serializer.
> 
> 
> Well, if you decide not to fix - than we should rollback the change! Not 
> that I'm against it, though :)

That would be consequent then :-) Ok, I will fix it tomorrow by the one 
liner.

Joerg

Re: svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Joerg Heinicke wrote:
> On 23.11.2004 17:14, Vadim Gritsenko wrote:
> 
>> IMHO, adding single line would be simplier:
>>
>>            if (uri == null) uri = "";
>>
>> And it can not be null anyway, so logging a warning is an option.
>>
>>> -        if ((uri == null || this.extractURI.equals(uri)) && 
>>> this.extractElement.equals(loc)) {
>>> +        if (((uri == null && this.extractURI.equals("")) || 
>>> this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
> 
> 
> I had this in mind too, but should a transformer fix the behaviour of 
> another component? In theory you can add this fix to every transformer 
> or serializer.

Well, if you decide not to fix - than we should rollback the change! Not that 
I'm against it, though :)

Vadim

Re: svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

Posted by Joerg Heinicke <jo...@gmx.de>.
On 23.11.2004 17:14, Vadim Gritsenko wrote:

> IMHO, adding single line would be simplier:
> 
>            if (uri == null) uri = "";
> 
> And it can not be null anyway, so logging a warning is an option.
> 
>> -        if ((uri == null || this.extractURI.equals(uri)) && 
>> this.extractElement.equals(loc)) {
>> +        if (((uri == null && this.extractURI.equals("")) || 
>> this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {

I had this in mind too, but should a transformer fix the behaviour of 
another component? In theory you can add this fix to every transformer 
or serializer.

Joerg

Re: svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
joerg@apache.org wrote:
> Author: joerg
> Date: Tue Nov 23 06:27:10 2004
> New Revision: 106302
> 
> Modified:
>    cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java
> Log:
> fixed the way of fixing the handling for null namespace URIs ...
> 
> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java
> Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java?view=diff&rev=106302&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java&r1=106301&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java&r2=106302
> ==============================================================================
> --- cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java	(original)
> +++ cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java	Tue Nov 23 06:27:10 2004
> @@ -213,7 +213,7 @@
>       */
>      public void startElement(String uri, String loc, String raw, Attributes a)
>      throws SAXException {

IMHO, adding single line would be simplier:

            if (uri == null) uri = "";

And it can not be null anyway, so logging a warning is an option.

Vadim


> -        if ((uri == null || this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
> +        if (((uri == null && this.extractURI.equals("")) || this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
>              extractLevel++;
>              fragmentID++;
>              if (getLogger().isDebugEnabled()) {