[digester] NodeCreateRule problem with jdk1.5.0

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[digester] NodeCreateRule problem with jdk1.5.0

Magnus Sirviö
Hi,

I have problems using NodeCreatRule to extract some xml when using
jdk1.5.0_02. When I use jdk1.4.2_08 it works as expected. Any hints?

Windows XP, commons-digester-1.6, commons-beanutils-1.7.0,
commons-logging-1.0.4

This is my simple test:

import org.apache.commons.digester.Digester;
import org.apache.commons.digester.NodeCreateRule;
import java.io.StringReader;

public class NodeCreateRuleTest
{
   private final static String TEST_XML =
       "<?xml version='1.0'?><root>ROOT BODY<alpha>ALPHA BODY</alpha>" +
       "<beta>BETA BODY</beta><gamma>GAMMA BODY</gamma></root>";

   public static void main(String[] args)
   {
     try
     {
       Digester digester = new Digester();
       digester.setValidating(false);
       digester.addRule("root/alpha", new NodeCreateRule());
       Object result = digester.parse(new StringReader(TEST_XML));
       System.out.println(result);
     }
     catch(Exception e)
     {
       System.err.println(e.getMessage());
     }
   }
}

Output with jdk1.4.2_08:
<alpha>ALPHA BODY</alpha>

Output with jdk1.5.0_02:
[alpha: null]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [digester] NodeCreateRule problem with jdk1.5.0

José Antonio Pérez Testa
Do you have endorsed libraries in some of the jdk?

Magnus Sirvi? wrote:

> Hi,
>
> I have problems using NodeCreatRule to extract some xml when using
> jdk1.5.0_02. When I use jdk1.4.2_08 it works as expected. Any hints?
>
> Windows XP, commons-digester-1.6, commons-beanutils-1.7.0,
> commons-logging-1.0.4
>
> This is my simple test:
>
> import org.apache.commons.digester.Digester;
> import org.apache.commons.digester.NodeCreateRule;
> import java.io.StringReader;
>
> public class NodeCreateRuleTest
> {
>   private final static String TEST_XML =
>       "<?xml version='1.0'?><root>ROOT BODY<alpha>ALPHA BODY</alpha>" +
>       "<beta>BETA BODY</beta><gamma>GAMMA BODY</gamma></root>";
>
>   public static void main(String[] args)
>   {
>     try
>     {
>       Digester digester = new Digester();
>       digester.setValidating(false);
>       digester.addRule("root/alpha", new NodeCreateRule());
>       Object result = digester.parse(new StringReader(TEST_XML));
>       System.out.println(result);
>     }
>     catch(Exception e)
>     {
>       System.err.println(e.getMessage());
>     }
>   }
> }
>
> Output with jdk1.4.2_08:
> <alpha>ALPHA BODY</alpha>
>
> Output with jdk1.5.0_02:
> [alpha: null]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


--

Jos? Antonio P?rez Testa
Ingenier?a de Servicios e Innovaci?n t?cnologica.

Tel?maco 3
28027 - Madrid (ESPA?A)
Tel: +34-91-480.81.12
 
[hidden email]
www.indra.es


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [digester] NodeCreateRule problem with jdk1.5.0

Magnus Sirviö
In reply to this post by Magnus Sirviö
No I'm not using any endorsed libraries.

Jos? Antonio P?rez Testa wrote:

>Do you have endorsed libraries in some of the jdk?
>
>Magnus Sirvi? wrote:
>
>  
>
>>Hi,
>>
>>I have problems using NodeCreatRule to extract some xml when using
>>jdk1.5.0_02. When I use jdk1.4.2_08 it works as expected. Any hints?
>>
>>Windows XP, commons-digester-1.6, commons-beanutils-1.7.0,
>>commons-logging-1.0.4
>>
>>This is my simple test:
>>
>>import org.apache.commons.digester.Digester;
>>import org.apache.commons.digester.NodeCreateRule;
>>import java.io.StringReader;
>>
>>public class NodeCreateRuleTest
>>{
>>  private final static String TEST_XML =
>>      "<?xml version='1.0'?><root>ROOT BODY<alpha>ALPHA BODY</alpha>" +
>>      "<beta>BETA BODY</beta><gamma>GAMMA BODY</gamma></root>";
>>
>>  public static void main(String[] args)
>>  {
>>    try
>>    {
>>      Digester digester = new Digester();
>>      digester.setValidating(false);
>>      digester.addRule("root/alpha", new NodeCreateRule());
>>      Object result = digester.parse(new StringReader(TEST_XML));
>>      System.out.println(result);
>>    }
>>    catch(Exception e)
>>    {
>>      System.err.println(e.getMessage());
>>    }
>>  }
>>}
>>
>>Output with jdk1.4.2_08:
>><alpha>ALPHA BODY</alpha>
>>
>>Output with jdk1.5.0_02:
>>[alpha: null]
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>    
>>
>
>
>--
>
>Jos? Antonio P?rez Testa
>Ingenier?a de Servicios e Innovaci?n t?cnologica.
>
>Tel?maco 3
>28027 - Madrid (ESPA?A)
>Tel: +34-91-480.81.12
>
>[hidden email]
>www.indra.es
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [digester] NodeCreateRule problem with jdk1.5.0

Simon Kitching
Hi Magnus,

Sorry but I don't have a clue why that might be happening.

A first step to diagnosing the problem would be to enable logging in
digester and see if anything useful is output there. See
  http://wiki.apache.org/jakarta-commons/Digester/FAQ

Otherwise I think you'll need to debug this one yourself.

Initially, I would think it is something specific to your environment,
as I use JDK1.5 here and the standard unit tests (including
NodeCreateRule tests) work fine for me.

I'll try to find time to run the test you included below, but don't know
when that might be.

Regards,

Simon

On Fri, 2005-05-20 at 16:15 +0200, Magnus Sirvi? wrote:

> No I'm not using any endorsed libraries.
>
> Jos? Antonio P?rez Testa wrote:
>
> >Do you have endorsed libraries in some of the jdk?
> >
> >Magnus Sirvi? wrote:
> >
> >  
> >
> >>Hi,
> >>
> >>I have problems using NodeCreatRule to extract some xml when using
> >>jdk1.5.0_02. When I use jdk1.4.2_08 it works as expected. Any hints?
> >>
> >>Windows XP, commons-digester-1.6, commons-beanutils-1.7.0,
> >>commons-logging-1.0.4
> >>
> >>This is my simple test:
> >>
> >>import org.apache.commons.digester.Digester;
> >>import org.apache.commons.digester.NodeCreateRule;
> >>import java.io.StringReader;
> >>
> >>public class NodeCreateRuleTest
> >>{
> >>  private final static String TEST_XML =
> >>      "<?xml version='1.0'?><root>ROOT BODY<alpha>ALPHA BODY</alpha>" +
> >>      "<beta>BETA BODY</beta><gamma>GAMMA BODY</gamma></root>";
> >>
> >>  public static void main(String[] args)
> >>  {
> >>    try
> >>    {
> >>      Digester digester = new Digester();
> >>      digester.setValidating(false);
> >>      digester.addRule("root/alpha", new NodeCreateRule());
> >>      Object result = digester.parse(new StringReader(TEST_XML));
> >>      System.out.println(result);
> >>    }
> >>    catch(Exception e)
> >>    {
> >>      System.err.println(e.getMessage());
> >>    }
> >>  }
> >>}
> >>
> >>Output with jdk1.4.2_08:
> >><alpha>ALPHA BODY</alpha>
> >>
> >>Output with jdk1.5.0_02:
> >>[alpha: null]
> >>
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [hidden email]
> >>For additional commands, e-mail: [hidden email]
> >>
> >>    
> >>
> >
> >
> >--
> >
> >Jos? Antonio P?rez Testa
> >Ingenier?a de Servicios e Innovaci?n t?cnologica.
> >
> >Tel?maco 3
> >28027 - Madrid (ESPA?A)
> >Tel: +34-91-480.81.12
> >
> >[hidden email]
> >www.indra.es
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [hidden email]
> >For additional commands, e-mail: [hidden email]
> >
> >  
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]