adaptivity_options.rnc produces invalid relax-rng schema
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fluidity |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
A long way down in adaptivity_
element format {
"triangle",
comment
}
This produces an invalid RNG file, since elements cannot contain data and string children.
Minimal test case:
$ cat > foo.rnc <<\EOF
start =
(
element format {
element comment {
}?
}
)
EOF
$ spud-preprocess foo.rnc
$ jing foo.rng
foo.rng:4:28: error: group of "string" or "data" element
xmllint also complains
$ xmllint --relaxng foo.rng >/dev/null
foo.rng:4: element element: Relax-NG parser error : Element format has a content type error
Relax-NG schema foo.rng failed to compile
I'm not sure what the correct definition here was meant to be, maybe:
element format {
attribute name {"triangle"},
element comment {
}?
Related branches
- Cian Wilson: Approve
-
Diff: 53 lines (+6/-4)4 files modifiedassemble/Adapt_State_Prescribed.F90 (+1/-1)
schemas/adaptivity_options.rnc (+1/-1)
schemas/adaptivity_options.rng (+3/-1)
tests/geostrophic_interpolation_gp/balanced.flml (+1/-1)
Changed in fluidity: | |
status: | New → Fix Committed |
Changed in fluidity: | |
status: | Fix Committed → Fix Released |
I'd agree that "triangle" should be an name attribute, this would bring it into line with the mesh format options under geometry/mesh, which I'm guessing this was meant to emulate.
You'll need to change the code at assemble/ Adapt_State_ Prescribed. F90:109 from: base_path // "/mesh/ from_file/ format" , format) base_path // "/mesh/ from_file/ format/ name", format)
call get_option(
to:
call get_option(
though.
That format variable doesn't then actually seem to get used anywhere mind you but get_option will still throw an error if it can't find it.