Open mchlrch opened 5 years ago
Here's one approach for implementing this functionality:
Inspect XML to get inventory of paths, include the path inventory in XmlLogicalSource
(build AST and serialize DSL file). I haven't done much with XPath so far, so I don't know, if the paths will be
Sprachzonen/Sprachzone[attribute::Sprache='DE']/Synonym[attribute::Nr='1']/Definition[./Typ='ab']/Text
or only
Sprachzonen/Sprachzone/Synonym/Definition/Text
Implement proposal provider for Referenceable.value
. Create proposals based on the path inventory.
Add validation rule that checks Referenceable.value
to be valid XPath
- Implement proposal provider for Referenceable.value. Create proposals based on the path inventory.
It makes sense to first play with the proposal provider and check if that approach is workable, before implementing the other parts
Goal: A standalone CLI tool that reads out XML paths, generates the appropriate EMF object model for a
LogicalSource
and then serializes into DSL text.xrm-cli -extract-sources -xml foobar.xml > foobar-sources.xrm