Hi John: I haven't read this in detail yet, but I've got a plane ride from Seattle to San Francisco this afternoon during which I'll try to take a look at the problem....
--G > -----Original Message----- > From: John Kaputin [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 22, 2005 7:45 AM > To: [email protected] > Subject: XmlSchema error in simple content extension > > Could someone familiar with ws-commons XmlSchema look at this? > > org.apache.ws.commons.schema.XmlSchemaException: No namespace found in > given base simple content type > at > org.apache.ws.commons.schema.SchemaBuilder.handleSimpleContent > Extension(SchemaBuilder.java:769) > at > org.apache.ws.commons.schema.SchemaBuilder.handleSimpleContent > (SchemaBuilder.java:644) > at > org.apache.ws.commons.schema.SchemaBuilder.handleComplexType(S > chemaBuilder.java:577) > at > org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElem > ent(SchemaBuilder.java:96) > at > org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchem > aCollection.java:132) > > The test case wsdl is http://www.uddi.org/schema/uddi_v2.xsd > > The problem fragment is: > .... > <xsd:complexType name="accessPoint"> > <xsd:simpleContent> > <xsd:extension base="string"> > > The problem seems to be in the > SchemaBuilder.handleSimpleContentExtension > method. It throws an exception because it expects the value > of attribute > 'base' to be explicitly prefixed (e.g. base="xsd:string") so > it can look up > the namespace for the prefix. > > if (extEl.hasAttribute("base")) { > String name = extEl.getAttribute("base"); <<name = "string" > String nsFromEl = Tokenizer.tokenize(name, ":")[0]; <<nsFromEl = > "string" > Object result = schema.namespaces.get(nsFromEl); <<result = null > > > Perhaps it should be similar to the handleSimpleType method's > treatment of > the 'base' attribute ... let 'namespace' default to the empty > string "" for > unprefixed values, which can then be used to look up the > default namespace > for the schema (e.g. xmlns="http://www.w3.org/2001/XMLSchema") > > if (restrictionEl.hasAttribute("base")) { > String name = restrictionEl.getAttribute("base"); > String[] temp = Tokenizer.tokenize(name, ":"); > String namespace = ""; > > if (temp.length != 1) { > namespace = temp[0]; <<use prefix if present, > otherwise use empty string > } > > > regards, > John Kaputin > > >
