GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
210 stars 84 forks source link

XML Inclusions #3073

Open untereiner opened 5 months ago

untereiner commented 5 months ago

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.

cssherman commented 5 months ago

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

untereiner commented 5 months ago

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 commented 5 months ago

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.