Skip to main content



      Home
Home » Archived » XML Schema Definition (XSD) » Incremental update of the facet's list
Incremental update of the facet's list [message #591980] Wed, 29 September 2004 07:26
Eclipse UserFriend
Hi,

I have a problem with updating the list of facets after adding a new facet
to the facet contents. Here is the corresponding code snippet:

----------------------------

// load a schema
XSDSchema schema = load("test.xsd");
// Incrementally update the schema after each edit change
schema.setIncrementalUpdate(true);

// Build a new simple type and add it to the loaded schema
XSDSimpleTypeDefinition baseType = (XSDSimpleTypeDefinition)
schema.getTypeDefinitions().get(0);
XSDSimpleTypeDefinition simpleType = XSDFactory.eINSTANCE
.createXSDSimpleTypeDefinition();
simpleType.setBaseTypeDefinition(baseType);
schema.getContents().add(simpleType);

// Create a new facet and add it to the type
XSDMinLengthFacet minLength =
XSDFactory.eINSTANCE.createXSDMinLengthFacet();
minLength.setValue(10);
simpleType.getFacetContents().add(minLength);

// Print the facets of the type: MinLength isn't contained in the list
System.out.println(simpleType.getFacets());

// Enforce an update. Shouldn't be necessary because of the incremental
update
schema.update();
// Print the facets: Now MinLength is contained
System.out.println(simpleType.getFacets());

--------------------------


Shouldn't the manual update be unnecessary because the incremental update
is set to true? Or did I miss something in the JavaDoc or in my code?

Cheers
Klaas
Previous Topic:Parsing Question
Next Topic:EMF Corner launched (Contribute your models, projects, files, utilities... for peer review by the EM
Goto Forum:
  


Current Time: Sat Nov 08 22:47:45 EST 2025

Powered by FUDForum. Page generated in 0.23423 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top