-
Notifications
You must be signed in to change notification settings - Fork 5
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
Normalization of XML #5
Comments
After some thought - I think normalization will be actually more useful for being sure that declarations of used namespaces in fact exist in XML document. Also, as normalization may be a costly operation so it may a good idea to do it when parsing. Idea sketch: Add We can have a symmetrical print method e.g. The problem with that idea is that it still relies on assumption that user uses just namespaces returned by Another idea would be to use path dependant types to restrict user to use just declared namespaces. The disadvantage may be that AST itself would probably need to carry that info on typelevel. Reasonable solution would be to allow for arbitrary namespaces usages on AST and optics level and do the whole normalization thing (more precisely - restricting usages of namespaces just to declared ones) on DSL level. |
At some point we will want to have reasonable output. Outside of pure formatting aspect it would be nice to e.g. try to avoid multiple namespace declarations for the same namespaces. Probably all namespace declarations should be moved to root element.
Such operations should be optional - there may be some cases when user want to avoid unneccessary transformations as want to have output as much similar to input as it's possible.
There's an example of such behavior (namely - many namespace declarations for one namespace) in test
replaceOrAddAttr for ResolvedNameMatcher
inOpticsBuilderSpec
The text was updated successfully, but these errors were encountered: