On 3/21/08, Jun Qian <[EMAIL PROTECTED]> wrote: > > Hi, > > Can someone please explain why when soap encoding is used, the instance > document generated by XmlBeans' SampleXmlUtil drops all the namespaces, even > if the schema says elementFormDefault="qualified"? > > > From SampleXmlUtil.java: > > if (_soapEnc) > xmlc.insertElement(element.getName().getLocalPart()); // soap > encoded? drop namespaces. > else > xmlc.insertElement(element.getName().getLocalPart(), > element.getName().getNamespaceURI()); > > > Schema example: > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > targetNamespace="http://foo.org/schema/test" > xmlns:tns="http://foo.org/schema/test" > elementFormDefault="qualified"> > <xsd:complexType name="idType"> > <xsd:sequence> > <xsd:element name="firstname" type="xsd:string"/> > <xsd:element name="lastname" type="xsd:string"></xsd:element> > </xsd:sequence> > </xsd:complexType> > <xsd:element name="contact"> > <xsd:complexType> > <xsd:sequence> > <xsd:element name="id" type="tns:idType"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:schema> > > > In the instance document generated by SampleXmlUtil, if soap encoding is > used, then the generated firstname and lastname elements are not ns > qualified. On the other hand, if soap encoding is not used, then the > generated firstname and lastname elements are ns qualified as expected. > > Thanks, > Jun > > ------------------------------ > Climb to the top of the charts! Play the word scramble challenge with star > power. Play > now!<http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan> >

