-
Notifications
You must be signed in to change notification settings - Fork 35
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
Register new Xsd Visitors #19
Comments
Hi, Each existing xsd type has its own visitor already defined at the moment.
parseMappers.put(XsdUnion.XSD_TAG, XsdUnion::parse);
Sorry for the long response, it was an interesting question that I didn't even considered while developing the library a long time ago. Hope it helped! |
Hi, thank you for the response! This can work for me, but I thought more on something like this: For each Xsd node type I can register a visitor without providing a new implementation for the respective Xsd node type. In the example above, I want to extend the XsdUnionVisitor class and give it as a visitor implementation to the XsdUnion instead of XsdUnionVisitor. For example, JavaCC gives such a freedom and using Visitors one can apply, for instance, type checking oder code generation by traversing the abstract syntax tree (AST). The use of the XsdParser can be extended to be used, for example, in this way: XsdParser xsdParser = new XsdParser(Config.XSD_SOURCE_PATH.concat(fileName)); However, the proposed solution is helpful and I can work with it. But it will be nice if one can add functionality just via the API using the visitor pattern without changing the code in the library. Best regards, |
Hello, I've made some changes to the way that element classes are attached to visitors. Now each element receives a function to create their own XsdAbstractElementVisitor which can be configured by implementing the interface I'll deploy this new version later today. Edit: The new version with these changes is available: 1.0.26. |
Thank you very much! I will look at it and will give you a feedback in the course of the day. |
I can work with the extension. Thank you! |
Hello,
is it possible to register my own Xsd visitors for the Xsd parser?
Greetings
Ivo
The text was updated successfully, but these errors were encountered: