Ticket #437 (closed task: fixed)
Ref-contraction in OMDoc1.2
|Reported by:||cmueller||Owned by:||dmisev|
|Component:||System Implementation (SI)||Version:|
|Keywords:||Cc:||vzholudev, kohlhase, nmueller, clange, frabe|
|Due to close:||Include in GanttChart:||no|
|Dependencies:||Due to assign:|
Description (last modified by cmueller) (diff)
Ref contraction is the replacement of ref elements with OMDoc elements. It is a two step process including the (a) loading of the referenced OMDoc elements and (b) replacement of the loaded content with the respective ref.
The method implementing ref contraction should be available to any OMDoc element.
Implement a method that takes an URI as input and returns the referenced element. The method loads the OMDoc element from the respective target source.
For now we only support the following URIs:
- absolute paths to documents in the filesystem (the URI can reference any element in the document)
- relative filepaths, where we only allow paths relative to the current doc (no backward edges), e.g. we can parse "subfolder/doc1#el1" but not "../folder/doc1#el1"
For any other URI the method should return a warning (or error) saying "Sorry, the processing of URIs such as X is not yet implemented.". In particular, this relates to more complicated relative filepaths (talked to Normen if you want to understand why this can be tricky) and references to web sources (starting with http or https).
The loaded element replaces the respective ref element. Note that this process should be constructive, i.e. a replacement does not modify the original source but modifies a copy.