Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Changing XSDSchema / Clone
Changing XSDSchema / Clone [message #602975] Mon, 21 April 2008 17:38
Eclipse User
Originally posted by: spotthoff.gmx.de

Hi,
I am trying to change a XSDSchema Object. In my use case I want to change
just a copy of this schema not the original one.

Everything seems to work fine but the cloning does not clone the complexe
types as it seems. In my understanding both lines below should have the
same result concerning the code at the end.
All complexe Types are null. Why? Where is my fault?

1. change.test((XSDSchema)schema.cloneConcreteComponent(true, false));
2. change.test(schema);

But the result of statement 1 is:
bla 2: SKU - org.eclipse.xsd.impl.XSDSimpleTypeDefinitionImpl@1a99561
(element: null) (name: SKU, targetNamespace: null) (variety: <unset>,
final: null, lexicalFinal: null, validFacets: null)
bla 2: USState - org.eclipse.xsd.impl.XSDSimpleTypeDefinitionImpl@8e32e7
(element: null) (name: USState, targetNamespace: null) (variety: <unset>,
final: null, lexicalFinal: null, validFacets: null)


and of statement 2:
bla 1: herstellerorg.eclipse.xsd.impl.XSDParticleImpl@1a99561 (element:
[xs:all: null]) (minOccurs: <unset>, maxOccurs: <unset>)
bla 1: Itemsorg.eclipse.xsd.impl.XSDParticleImpl@8e32e7 (element:
[xs:sequence: null]) (minOccurs: <unset>, maxOccurs: <unset>)
bla 1: partsorg.eclipse.xsd.impl.XSDParticleImpl@1b000e7 (element:
[xs:sequence: null]) (minOccurs: <unset>, maxOccurs: <unset>)
bla 1: PurchaseOrderTypeorg.eclipse.xsd.impl.XSDParticleImpl@b76fa
(element: [xs:sequence: null]) (minOccurs: <unset>, maxOccurs: <unset>)
bla 2: SKU - org.eclipse.xsd.impl.XSDSimpleTypeDefinitionImpl@b01d43
(element: [xs:simpleType: null]) (name: SKU, targetNamespace: null)
(variety: atomic, final: [], lexicalFinal: null, validFacets: [length,
minLength, maxLength, pattern, enumeration, whiteSpace])
bla 1: USAddressorg.eclipse.xsd.impl.XSDParticleImpl@513cf0 (element:
[xs:sequence: null]) (minOccurs: <unset>, maxOccurs: <unset>)
bla 2: USState - org.eclipse.xsd.impl.XSDSimpleTypeDefinitionImpl@177b3cd
(element: [xs:simpleType: null]) (name: USState, targetNamespace: null)
(variety: atomic, final: [], lexicalFinal: null, validFacets: [length,
minLength, maxLength, pattern, enumeration, whiteSpace])


#### Test Code:
private void test(XSDSchema s){
XSDTypeDefinition type = null;

EList <XSDTypeDefinition> types = s.getTypeDefinitions();
for(Iterator<XSDTypeDefinition> it = types.iterator();
it.hasNext();){
XSDTypeDefinition typ = it.next();
if(typ.getComplexType()!= null){
XSDParticle t = typ.getComplexType();
System.out.println("bla1: " + typ.getName() + t);
}
if(typ.getSimpleType()!= null){
System.out.println("bla2: " + typ.getName() +
typ.getSimpleType());
}
}
}
Previous Topic:[Announcement] Eclipse/OMG Symposium at the OMG Technical Meeting in Ottawa
Next Topic:Changing XSDSchema / Clone
Goto Forum:
  


Current Time: Thu Jul 31 11:46:47 EDT 2014

Powered by FUDForum. Page generated in 0.01971 seconds