GEOS icon indicating copy to clipboard operation
GEOS copied to clipboard

XML Inclusions

Open untereiner opened this issue 10 months ago • 3 comments

Describe the issue For now inclusions are handled by an ad hoc xml element. There is need of a special treatment to use included files.

Proposed cleanup XML Inclusions (XInclude) is a W3C specification that defines a way to include XML fragments from different sources into a single document. We could use this official mechanism instead of an ad hoc one. What do you think ?

Additional context n.a.

untereiner avatar Apr 10 '24 10:04 untereiner

This is do-able, but I have a few concerns:

  1. Our xml interpreter (pugixml) does not support xi:include natively, so we would have to do this all ourselves
  2. The syntax of xi:include isn't as user friendly as our current implementation
  3. Validating the included xml files is a bit harder using xinclude, as they aren't required to conform to the parent schema

cssherman avatar Apr 10 '24 16:04 cssherman

This is do-able, but I have a few concerns:

  1. Our xml interpreter (pugixml) does not support xi:include natively, so we would have to do this all ourselves

I just saw that: https://github.com/zeux/pugixml/issues/338 It seems weird but yes, we would have to to it

  1. The syntax of xi:include isn't as user friendly as our current implementation

aside from the xi: not sure it is very different

<Included>
  <File name="./FieldCaseTutorial3_base.xml" />
</Included>

vs

<xi:include href="./FieldCaseTutorial3_base.xml"/> 
  1. Validating the included xml files is a bit harder using xinclude, as they aren't required to conform to the parent schema

I don't understand this concern. Do you have an example ?

untereiner avatar Apr 11 '24 08:04 untereiner

For me a schema makes a whole. There is not parent or child schemas. Using xinclude in xml files is just a way to break down the complexity of a large document.

untereiner avatar Apr 16 '24 20:04 untereiner