It is affected by the namespace setting.  The key element in the new test is 
equivalent to <xsd:key>, not <key> in no namespace.  Technically we shouldn't be doing 
that, since we don't own the schema namespace and because <xsd:key> already has 
meaning, I believe.

The only reason this works in your test is because the MapDeserializer isn't checking 
that the namespace is "", which is nice because it's "friendly", but is actually wrong 
according to the schema for the Map type.

--Glen

> -----Original Message-----
> From: R J Scheuerle Jr [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 26, 2002 10:11 AM
> To: [EMAIL PROTECTED]
> Subject: RE: cvs commit: xml-axis/java/test/encoding 
> TestDeser1999.java
> Te stDeser2000.java TestDeser2001.java
> 
> 
> 
> Actually I think its a good test because "key" is an 
> unqualified element
> and should therefore be unaffected by the namespace settings.
> 
> (full disclosure: I already added the test.)
> 
> 
> Rich Scheuerle
> IBM WebSphere & Axis Web Services Development
> 512-838-5115  (IBM TL 678-5115)
> 
> 
>                                                               
>                                                          
>                       Glen Daniels                            
>                                                          
>                       <gdaniels@macrome        To:       
> "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>         
>                       dia.com>                 cc:            
>                                                          
>                                                Subject:  RE: 
> cvs commit: xml-axis/java/test/encoding                   
   
>                    09/26/2002 09:01          
> TestDeser1999.java Te      stDeser2000.java 
> TestDeser2001.java         
>                       AM                                      
>                                                          
>                       Please respond to                       
>                                                          
>                       axis-dev                                
>                                                          
>                                                               
>                                                          
>                                                               
>                                                          
> 
> 
> 
> 
> +1, except for the fact that you shouldn't really do it 
> there.... since the
> "key" element in the XSD namespace has an already-defined meaning, I
> believe, and it's not in our map type.  Just a plea for 
> correctness even in
> tests. :)
> 
> A better test would be with a custom namespace in which we have a type
> mapped:
> 
>  <arg xmlns="mynamespace" xsi:type="myType">
>    <intField>5</intField>
>  </arg>
> 
> --Glen
> 
> > -----Original Message-----
> > From: R J Scheuerle Jr [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 26, 2002 9:58 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: cvs commit: xml-axis/java/test/encoding
> > TestDeser1999.java
> > TestDeser2000.java TestDeser2001.java
> >
> >
> >
> > I am changing one the tests per my note below.  Will check in
> > once I can
> > run the tests again.
> >
> > Rich Scheuerle
> > IBM WebSphere & Axis Web Services Development
> > 512-838-5115  (IBM TL 678-5115)
> >
> >
> >
> >
> >                       R J Scheuerle
> >
> >                       Jr/Austin/IBM@IBM        To:
> > [EMAIL PROTECTED]
> >                       US                       cc:
> >
> >                                                Subject:  Re:
> > cvs commit: xml-axis/java/test/encoding
> >                       09/26/2002 08:41
> > TestDeser1999.java TestDeser2000.java TestDeser2001.java
> >
> >                       AM
> >
> >                       Please respond to
> >
> >                       axis-dev
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Great piece of sleuthing Glen.  I am surprised that this was
> > not handled
> > correctly.  ++1
> >
> > Probably should change one of the offending tests to actually
> > test this
> > feature.
> >
> >                        "</item><item>" +
> >                           "<key xsi:type=\"string\" xmlns="..xsd
> > namespace.." >hi</key>" +
> >                           "<value xsi:null=\"true\"/>" +
> >                          "</item>" +
> > Rich Scheuerle
> > IBM WebSphere & Axis Web Services Development
> > 512-838-5115  (IBM TL 678-5115)
> >
> >
> >
> >                       [EMAIL PROTECTED]
> >
> >                       rg                       To:
> > [EMAIL PROTECTED]
> >                                                cc:
> >
> >                       09/25/2002 05:25         Subject:  cvs commit:
> > xml-axis/java/test/encoding TestDeser1999.java
> >                       PM                        TestDeser2000.java
> > TestDeser2001.java
> >                       Please respond to
> >
> >                       axis-dev
> >
> >
> >
> >
> >
> >
> > gdaniels    2002/09/25 15:25:24
> >
> >   Modified:    java/src/org/apache/axis/encoding
> >                         DeserializationContextImpl.java
> >                java/test/encoding TestDeser1999.java
> > TestDeser2000.java
> >                         TestDeser2001.java
> >   Log:
> >   Correctly use the in-scope default namespace to resolve
> > QNames with no
> >   prefixes (such as xsi:type="type").
> >
> >   This change smoked out three XML bugs in the 
> deserialization tests,
> >   which are now fixed.
> >
> >   This change will hopefully fix
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12873
> >
> >   Revision  Changes    Path
> >   1.64      +6 -9
> > xml-axis/java/src/org/apache/axis/encoding/DeserializationCont
> > extImpl.java
> >
> >   Index: DeserializationContextImpl.java
> >   
> ===================================================================
> >   RCS file:
> > /home/cvs/xml-axis/java/src/org/apache/axis/encoding/Deseriali
> > zationContextImpl.java,v
> >
> >
> >   retrieving revision 1.63
> >   retrieving revision 1.64
> >   diff -u -r1.63 -r1.64
> >   --- DeserializationContextImpl.java            18 Sep 2002
> > 16:10:37 -0000
> >        1.63
> >   +++ DeserializationContextImpl.java            25 Sep 2002
> > 22:25:24 -0000
> >        1.64
> >   @@ -328,15 +328,12 @@
> >
> >            // OK, this is a QName, so look up the prefix in
> > our current
> > mappings.
> >            int i = qNameStr.indexOf(':');
> >   -        if (i == -1)
> >   -            return null;
> >   -
> >   -        String nsURI = getNamespaceURI(qNameStr.substring(0, i));
> >   -
> >   -        //log.debug("namespace = " + nsURI);
> >   -
> >   -        if (nsURI == null)
> >   -            return null;
> >   +        String nsURI;
> >   +        if (i == -1) {
> >   +            nsURI = getNamespaceURI("");
> >   +        } else {
> >   +            nsURI = getNamespaceURI(qNameStr.substring(0, i));
> >   +        }
> >
> >            return new QName(nsURI, qNameStr.substring(i + 1));
> >        }
> >
> >
> >
> >   1.7       +1 -1      
> xml-axis/java/test/encoding/TestDeser1999.java
> >
> >   Index: TestDeser1999.java
> >   
> ===================================================================
> >   RCS file: 
> /home/cvs/xml-axis/java/test/encoding/TestDeser1999.java,v
> >   retrieving revision 1.6
> >   retrieving revision 1.7
> >   diff -u -r1.6 -r1.7
> >   --- TestDeser1999.java             27 Jun 2002 23:10:36 -0000
> > 1.6
> >   +++ TestDeser1999.java             25 Sep 2002 22:25:24 -0000
> > 1.7
> >   @@ -24,7 +24,7 @@
> >                           "<key xsi:null=\"true\"/>" +
> >                           "<value
> > xsi:type=\"xsd:boolean\">false</value>" +
> >
> >                          "</item><item>" +
> >   -                       "<key xsi:type=\"string\">hi</key>" +
> >   +                       "<key xsi:type=\"xsd:string\">hi</key>" +
> >                           "<value xsi:null=\"true\"/>" +
> >                          "</item>" +
> >                        "</result>",
> >
> >
> >
> >   1.7       +1 -1      
> xml-axis/java/test/encoding/TestDeser2000.java
> >
> >   Index: TestDeser2000.java
> >   
> ===================================================================
> >   RCS file: 
> /home/cvs/xml-axis/java/test/encoding/TestDeser2000.java,v
> >   retrieving revision 1.6
> >   retrieving revision 1.7
> >   diff -u -r1.6 -r1.7
> >   --- TestDeser2000.java             27 Jun 2002 23:10:36 -0000
> > 1.6
> >   +++ TestDeser2000.java             25 Sep 2002 22:25:24 -0000
> > 1.7
> >   @@ -24,7 +24,7 @@
> >                           "<key xsi:null=\"true\"/>" +
> >                           "<value
> > xsi:type=\"xsd:boolean\">false</value>" +
> >
> >                          "</item><item>" +
> >   -                       "<key xsi:type=\"string\">hi</key>" +
> >   +                       "<key xsi:type=\"xsd:string\">hi</key>" +
> >                           "<value xsi:null=\"true\"/>" +
> >                          "</item>" +
> >                        "</result>",
> >
> >
> >
> >   1.25      +1 -1      
> xml-axis/java/test/encoding/TestDeser2001.java
> >
> >   Index: TestDeser2001.java
> >   
> ===================================================================
> >   RCS file: 
> /home/cvs/xml-axis/java/test/encoding/TestDeser2001.java,v
> >   retrieving revision 1.24
> >   retrieving revision 1.25
> >   diff -u -r1.24 -r1.25
> >   --- TestDeser2001.java             15 Sep 2002 19:16:17 -0000
> > 1.24
> >   +++ TestDeser2001.java             25 Sep 2002 22:25:24 -0000
> > 1.25
> >   @@ -250,7 +250,7 @@
> >                           "<key xsi:nil=\"true\"/>" +
> >                           "<value
> > xsi:type=\"xsd:boolean\">false</value>" +
> >                          "</item><item>" +
> >   -                       "<key xsi:type=\"string\">hi</key>" +
> >   +                       "<key xsi:type=\"xsd:string\">hi</key>" +
> >                           "<value xsi:nil=\"true\"/>" +
> >                          "</item>" +
> >                        "</result>",
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> 
> 
> 
> 

Reply via email to