govelogo <govel...@gmail.com> wrote on 07/03/2009 10:44:17 AM: > Hi there, > > I am running the jaxp.TypeInfoWriter to parse a xml. For one > element, I got this result, > > startElement(name="{http://crm.testschema. > ca/xml/as/ServiceAndOfferMapping/v1-0}associatedWithServices",type="{ > http://crm.testschema.ca/xml/as/ServiceAndOfferMapping/v1-0} > #AnonType_associatedWithServicesInstalledProductOfferingValueType",qname=" > saom:associatedWithServices",attributes={}) > > inside the ServiceAndOfferMapping (saom) .xsd, > "associatedWithServices" is defined here as below, (the schema for > cbeservice-v1-5 is "http://ossj.org/xml/Common-CBEService/v1-5")> > > <xs:complexType name="InstalledProductOfferingValueType"> > <xs:complexContent> > <xs:extension base="cbeproductoffering-v1-5:ProductOfferingValue"> > <xs:sequence> > <xs:element name="associatedWithServices" minOccurs="0"> > <xs:complexType> > <xs:complexContent> > <xs:extension base="cbeservice-v1-5:ArrayOfServiceKey"/> > </xs:complexContent> > </xs:complexType> > </xs:element> > </xs:sequence> > </xs:extension> > </xs:complexContent> > </xs:complexType> > <xs:element name="serviceAndOfferMapping" type="saom: > ServiceAndOfferMappingType"/> > > My question is why the type name is not shown as the base type ( > cbeservice-v1-5:ArrayOfServiceKey), but rather like a garbage string > (in red color)?
Because the base type is not its type. The type of "associatedWithServices" actually has no name. It's anonymous, however the API [1] you're using requires that implementations produce an "anonymous type name" [2] to uniquely identify the anonymous type and that is what you're getting. > many thanks, > David [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo [2] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/glossary.html#dt-anonymous Thanks. Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: mrgla...@ca.ibm.com E-mail: mrgla...@apache.org