use of org.whole.lang.queries.model.PathExpression in project whole by wholeplatform.
the class XsdLanguageTest method testModelToXsdMapping.
@Test
public void testModelToXsdMapping() {
try {
IBindingManager bm = BindingManagerFactory.instance.createBindingManager();
PathExpression path = new ModelToXmlSchemaQuery().create();
IEntity model = XmlBuilderPersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/artifacts/ArtifactsModel.xwl"));
Assert.assertNotNull(BehaviorUtils.evaluateFirstResult(path, model, bm));
IEntity mappedXsd = bm.wGet("schema");
IEntity xsd = loadXsd("artifacts.xsd");
Assert.assertTrue(OrderedMatcher.match(xsd, mappedXsd, comparatorsMap));
} catch (Exception e) {
Assert.fail(e.getMessage());
}
}
use of org.whole.lang.queries.model.PathExpression in project whole by wholeplatform.
the class GrammarsUIInterpreterVisitor method createGrammarBased.
public static IEntity createGrammarBased(Grammar entity, IBindingManager bm) {
// FIXME ensure normalized: NormalizerOperation.normalize(entity);
Grammar g = entity;
PathExpression pathExpression = new GrammarsToGrammarBasedQuery().create();
IEntity grammarBased = BehaviorUtils.evaluateFirstResult(pathExpression, g, bm);
return NormalizerOperation.normalize(grammarBased);
}
Aggregations