Actually, just found the following code at lines 78 ff of the XPathHelper class:

        switch (structure.getStructureType()) {
        case Structure.ELEMENT:
            parent = ((ElementDecl) structure).getParent();
            if (parent.getStructureType() != Structure.SCHEMA) {
                getSchemaLocation(parent, location, dealWithAnonTypes);
            }
            location.append(ExtendedBinding.PATH_SEPARATOR);
            location.append(((ElementDecl) structure).getName());
            if (parent instanceof Schema) {
                Schema schema = (Schema) parent;
                if (schema.getTargetNamespace() != null) {
                    String targetNamespace = schema.getTargetNamespace();
                    location.append("{" + targetNamespace + "}");
                }
            }
            break;

This seems to indicate that support for specifying a namespace uri in the binding is *partially* in place. But as far as I can tell, this logic seems to exist for XML elements only .. :-(. But then again, this should be not too hard to fix and apply across all necessary structure types.

Regards
Werner

On 06.09.2010 21:50, Werner Guttmann wrote:
Hi Stevo,

On 25.08.2010 14:36, Stevo Slavić wrote:
Hello castor users,

Say one has two xsd's, each with its own namespace, and they have
multiple
elements with same name. For tuning code generation one can configure
namespace-to-package binding in binding.xml. If each namespace is
bound to a
different package, elements with same name will result in classes with
same
name but within different packages. If one uses these classes, with same
name, within same class, one of them will have to be referenced using
full
class name which is very ugly.
Yes, agreed. But given the complexity of some XML schemas I have seen,
probably the only way to go about once you start generating - let's say
- 100+ classes from your set of XML schemas.

I've looked but could not find a way to configure element-to-class name
binding which would be namespace aware, so that a different class name
can
be configured for a given element name, depending on namespace element
belongs to. Did I miss something?
No, as far as I remember. But let's cross-check things first.


Regards,
Stevo.
Kind Regards
Werner

---------------------------------------------------------------------
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


Reply via email to