#152 closed enhancement (released)
Test and fix extensibility of current schemas
Reported by: | ibboard | Owned by: | ibboard |
---|---|---|---|
Priority: | major | Milestone: | WarFoundry 0.1 |
Component: | WarFoundry-API | Version: | Unknown or N/A |
Keywords: | schema extensability | Cc: | |
Blocked By: | Blocking: | #150 |
Description (last modified by )
ticket:150 requires an extension to the schema. Ideally, WarFoundry should be both backwards and forwards compatible (i.e. newer apps can use older files but not take advantage of new features because the files don't define it, but older apps can also use newer files and just ignore the newer features that they don't understand). This hasn't been properly tested, though, and I suspect the schemas might not be correctly defined to support this as they stand.
Attachments (1)
Change History (35)
comment:1 Changed 10 years ago by
Blocking: | 175 added |
---|
comment:2 Changed 10 years ago by
Description: | modified (diff) |
---|---|
Owner: | set to ibboard |
Status: | new → accepted |
comment:3 Changed 10 years ago by
Summary: | Test extensibility of current schemas → Test and fix extensibility of current schemas |
---|
comment:4 Changed 10 years ago by
Can't seem to get rid of
XmlSchema error: Attribute declaration was not found for http://ibboard.co.uk/warfoundry/attrib:extraAttrib XML
even when schema has <anyAttribute> and the schema for the extra attribute is loaded in the namespace manager and the schema cache.
comment:5 Changed 10 years ago by
Ooops - helps if the extra schema is actually copied to the output folder (or if Mono would say "can't find file" rather than ignoring the fact you've added a non-existant schema).
comment:6 Changed 10 years ago by
comment:7 Changed 10 years ago by
Backwards compatibility is looking possible through careful definition of new attributes with default values or new elements that are optional, but forwards compatibility needs more exploration as it will currently fail validation because the old app won't understand the new namespace.
comment:8 Changed 10 years ago by
Blocking: | 175 removed |
---|
Remove #175 because that level of backward/forward compatibility is too much work for an initial beta version.
Solution for forward compatibility is XSLTs to remove things we don't understand and post-cleansing validation instead of load-time validation.
comment:9 Changed 10 years ago by
comment:10 Changed 10 years ago by
comment:11 Changed 10 years ago by
released: | → no |
---|---|
Version: | → N/A |
XSLT method suggested in comment:8 may work, but might need extra thought about attributes outside our namespace (all extensions).
comment:12 Changed 10 years ago by
Alternatives to XSD may provide more useful functionality cleanly, but may not be supported by .Net: http://www.xfront.com/backward-forward-compatibility/
comment:13 Changed 10 years ago by
Better solution, based on discussion with a work colleague: don't try for backwards and forwards compatibility on a single schema, instead have a schema for each version with later versions adding on to and re-using the earlier ones. No parsing/prep needed, all unrecognised elements from later schemas should be ignored automatically and namespacing means that the XML XPath queries should still work fine.
If it works, dev versions of WarFoundry will be subject to change but we'll have a lock-down at each versioned release.
Changed 10 years ago by
Attachment: | Empire-Extended.race added |
---|
Test Empire.race file with attributes from extra namespaces
comment:14 Changed 10 years ago by
The previous attachment adds
xmlns:ext="http://ibboard.co.uk/warfoundry/attrib" ext:extraAttrib="en"
to the standard test race, but the schema for http://ibboard.co.uk/warfoundry/attrib isn't defined, so we get
Problem validating against schema for WarFoundry data: XmlSchema error: Attribute declaration was not found for http://ibboard.co.uk/warfoundry/attrib:extraAttrib XML Line 2, Position 155.
There will be a fix somewhere, but this effectively limits our extensibility until we can handle (ignore) any schemas that we don't know but validate against those that we do know. Method for post-validation may help.
comment:15 Changed 10 years ago by
comment:16 Changed 10 years ago by
comment:17 Changed 10 years ago by
comment:18 Changed 10 years ago by
comment:19 Changed 10 years ago by
comment:20 Changed 10 years ago by
Pre or post-load validation doesn't make a difference. Validation process seems to need all schemas or none (Mono source code).
I've not yet worked out how to either do partial validation (only validate against the schemas we have) or use an XSLT or similar to remove all unknown elements/attributes, but retain any elements/attributes that might be used by extensions that supply their own schemas (XSLT is a fixed document, as far as I've seen).
comment:21 Changed 10 years ago by
Recent "fixes" to move from xs:any to xs:sequence seem to work fine in Mono, but not in .Net. Latest WinForms app currently complains about ambiguity of ##any with race:unitAbilities.
comment:22 Changed 10 years ago by
comment:23 Changed 10 years ago by
comment:24 Changed 10 years ago by
comment:25 Changed 10 years ago by
comment:26 Changed 10 years ago by
comment:27 Changed 10 years ago by
comment:28 Changed 10 years ago by
comment:29 Changed 10 years ago by
comment:30 Changed 10 years ago by
comment:31 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
comment:32 Changed 10 years ago by
comment:34 Changed 10 years ago by
Resolution: | fixed → released |
---|
Move to new "released" resolution for v0.1b7
Extending schemas causes file load to file. Need to investigate how to get C# to recognise the
anyAttribute
andany
tags in the schema (details)