Oops, my fault; you are querying the type of the 'internationalPrice' element, which is <xsd:anyType> and as such should carry the XML schema name space.
I am not sure why this happens, but I know that Castor's source generator does not work with a real (physical) copy of the XML schema schema internally. Let me have another look. Werner Boris Dushanov wrote: > What I expect is that when a type is defined in > http://www.w3.org/2001/XMLSchema,the schema for that namespace is returned. > But the result is that my schema is parent of type with QName > {http://www.w3.org/2001/XMLSchema}anyType. > > Werner Guttmann wrote: >> In your XML schema, you define a target namespace of >> http://uri.seeburger.com/bisas/xformservice/schema; per definition (as >> you are setting elementFormDefault to 'qualified'), any global element >> definition will be assigned to this namespace. >> >> As such, the output generated below is correct. >> >> Why do you think that the call to get typeSchema.TargetNamespace() >> should return http://www.w3.org/2001/XMLSchema instead ? >> Werner >> >> Boris Dushanov wrote: >> >>> Hi, >>> >>> I've attached the test schema. >>> >>> My castor implementation version is 1.1.2.1. >>> >>> Regards, >>> Boris >>> >>> Werner Guttmann wrote: >>> >>>> What does the <schema> element definition look like ? It might as well >>>> be a bug (or not), but I need more information to be able to tell.. >>>> >>>> Werner >>>> >>>> Boris Dushanov wrote: >>>> >>>> >>>>> Hi all, >>>>> >>>>> I have an XML Schema in which the following element is defined : >>>>> >>>>> <xsd:element name="internationalPrice" type="xsd:anyType"/> >>>>> >>>>> I'm executing the following test code using castor : >>>>> SchemaReader reader = new >>>>> SchemaReader("mySchema.xsd"); >>>>> >>>>> Schema schema = reader.read(); >>>>> ElementDecl element = >>>>> schema.getElementDecl("internationalPrice"); >>>>> Schema typeSchema = element.getType().getSchema(); >>>>> System.out.println(typeSchema.getTargetNamespace()); >>>>> >>>>> I expect that http://www.w3.org/2001/XMLSchema will be printed as a >>>>> result but it is not.The target namespace of mySchema.xsd is printed. >>>>> Is this the right behaviour or there is some problem in the castor ? Or >>>>> maybe I'm missing something... >>>>> >>>>> Thanks in advance, >>>>> Boris >>>>> >>>>> >>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe from this list, please visit: >>>>> >>>>> http://xircles.codehaus.org/manage_email >>>>> >>>>> >>>>> >>>>> >>>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe from this list, please visit: >>>> >>>> http://xircles.codehaus.org/manage_email >>>> >>>> >>>> >>>> >>>> >>>> >>> ------------------------------------------------------------------------ >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> >> >> > > --------------------------------------------------------------------- To > unsubscribe from this list, please visit: > http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

