Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[repositoryValidator] xi:include should be supported #112

Open
YuvalCohen opened this issue Feb 5, 2021 · 9 comments
Open

[repositoryValidator] xi:include should be supported #112

YuvalCohen opened this issue Feb 5, 2021 · 9 comments

Comments

@YuvalCohen
Copy link

There should be a simple way to support xi:include in the xsd repository files.

This is a basic requirement for Orchestra to serve any project which is slightly larger then FIX repository and requires to split the repository to multiple xsd files.

At the moment, repositoryValidator report an error: Attribute 'xml:base' is not allowed to appear in element '...' (name of the element where the xi:include was added)

Further information about this error can be found in:

[https://stackoverflow.com/questions/22774425/attempting-to-connect-xml-files-with-xinclude-attribute-xmlbase-error/22791471#22791471]
and way to supress the error can be found in: [http://xerces.apache.org/xerces2-j/features.html#xinclude.fixup-base-uris]

Thanks in advance.
The repositoryValidator is a very useful tool.

@kleihan
Copy link
Member

kleihan commented Feb 7, 2021

Agree with the proposal for the next version of Orchestra. SBE V1.0 supports the import of encodings, see Message Schema - Data encodings - Encoding name - Importing encodings (Chapter 6.5.2.1 in PDF).

@donmendelson
Copy link
Member

@YuvalCohen the Orchestra repository schema does both things recommended by that article. It imports xml.xsd and it declares xml:base in top-level elements under <repository>. Unfortunately, Xinclude requires that attribute in every element that you wish to include; you can't include at random locations. Are you trying to include at the top-level, or at lower levels of the schema?

Also, RepositoryValidator sets a switch to make the parser XIncludeAware, another requirement. I'll have to test validator with includes to see if it works as expected.

@YuvalCohen
Copy link
Author

@donmendelson The requirement si to be able to split large and complicated repository to multiple files.
I believe that it is basic requirement for any future use of Orchestra (i.e. scalable).

At the moment, it seems that repositoryValidator does not like xi:include.
We are happy to follow any guidelines or methods that will enable us to have each message, component, and/or codeSet in separated files. So far we tried with xi:include which is not welcome by the repositoryValidator.

@donmendelson
Copy link
Member

I altered a unit test for RepositoryValidator as follows and got it to run with an Xinclude:

Modified test resource OrchestraFIXLatest.xml and moved a portion to another file.

  1. Added xmlns:xi="http://www.w3.org/2001/XInclude" to root element.
  2. Replaced <fixr:datatypes> element with <xi:include href="src/test/resources/datatypes.xml"/> (path is tricky with xinclude)
  3. Created datatypes.xml with contents of <fixr:datatypes>
  4. Added namespace to the included file as <fixr:datatypes xmlns:fixr="http://fixprotocol.io/2020/orchestra/repository">

The output did produce some errors or warnings, but they seem to be correct, not a problem with include instructions.

@YuvalCohen
Copy link
Author

@donmendelson Thanks.
Is there a possibility to write: a (single) message, (a single) component and (a single) codeset in dedicated files (i.e. each in its 'own file') and include all of them in the main repository file?

If so, can you please provide some description about what each of these files needs to contain?

@donmendelson
Copy link
Member

@YuvalCohen since XIinclude requires explicit include points to be declared in the schema, what you ask requires a modification. We are about to promote Orchestra version 1.0 to Technical Standard, but we can take your request as a requirement for version 1.1.

@donmendelson
Copy link
Member

Now that Orchestra version 1.0 is Technical Standard, we should reconsider all requests for schema changes to become version 1.1.

@donmendelson donmendelson added this to the Orchestra v1.1 milestone Aug 13, 2021
@kleihan
Copy link
Member

kleihan commented Nov 4, 2022

Added the following to v1.1 RC1 section 3.1.4 Support for XInclude:

For example, <fixr:datatypes> element can be replaced with the path to the XML file, e.g. <xi:include href="src/test/resources/datatypes.xml"/>. The datatypes then need to be defined in a separate file datatypes.xml that needs to contain the same namespace as the root element of the repository, i.e. <fixr:datatypes xmlns:fixr="http://fixprotocol.io/2023/orchestra/repository">.

kleihan added a commit that referenced this issue Oct 27, 2023
Optional name references for objects
@kleihan
Copy link
Member

kleihan commented Oct 30, 2023

This issue only updates the documentation of V1.1 RC1. There is currently no requirement to separate out individual elements of the top elements supporting XInclude (actors, concepts, sections, categories, messages, groups, components, fields, code sets, datatypes, scenarios). If the need arises, a separate issue should be entered and can be addressed in a later RC of v1.1.

The issue remains open to address the bug in the Repository Validator tool.

@kleihan kleihan changed the title repositoryValidator should support xi:include [repositoryValidator] xi:include should be supported Jun 3, 2024
@kleihan kleihan removed this from the Orchestra v1.1RC1 milestone Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants