
Well, after testing some other cases, I noticed that the patch leaves some other problems considered as valid. =( But the idea is to specify that the only root element allowed is <cdl:cdl> - something that decreases the reuse of the schema, as some authors say. I will try to find a better way to make this work. I've also noticed that /test/cdl/valid/cmp/cmp-switch.cdl and cmp-flow.cdl are not well-formed. Guilherme Steve Loughran wrote:
Guilherme Mauro Germoglio Barbosa / Projeto Ourgrid - Projeto Ourgrid/LSD wrote:
Hello all,
I've been looking at your repository and I found out that some cdl files located in /deployment/test/cdl/invalid/ are considered valid according to the cdl schema in the repository.
One of them is /deployment/test/cdl/invalid/wrong_root_elt_type.cdl /that has its root element /<cdl:expression> /instead of <cdl:cdl> as it must be. I think the CDL XMLSchema (xml-cdl.xsd) should care about invalidating this kind of error - I modified the current schema to invalidate this.
would you care to submit a patch?
The other is /deployment/test/cdl/invalid/expression-duplicate-variables.cdl /- unfortunately this one we still don't know how to invalidate through the schema.
So my question is if the invalid files from the repository must be invalidated simply by XMLSchema or the parser implementation should care about these errors.
Yes, some of the stuff in invalid/ is invalid semantically, not syntactically. There are limits to XSD's powers. As I write more of the import and resolution tests, we'll have docs in there that are invalid there to, for example
Import tests -multiple imports of the same doc into different namespaces (is that invalid?) -multiple imports of different docs into the same namespace -docs that dont resolve to valid urls, even on the classpath
resolution -things that dont resolve
extends -self referential extension
others -conflicting attributes -expressions that dont make sense
etc. etc. I'm just adding tests as i go along. We could structure them better, i suppose. I am glad that you have embraced testing!