Closed sekur closed 8 years ago
Here's an example:
xpath = prop.path.trim('/foo/bar').extends('address')
With the newly modified xpath
you can use it in various ways:
model.in xpath
prop.find xpath
xpath.apply <some object>
BTW, new XPath instances are schema-aware so if you try to alter the expression to no longer be part of the underlying schema, it will throw an error.
From the context of an Event handler routine, it should be easier to find relative data element(s) from the perspective of the
prop
which generated the event. Since theprop
which triggers the event of interest can be any sub-tree element inside theModel
, we need a way to extract sufficient level of XPath details that we can then extend from in order to get to the data element(s) of interest.We will need to enhance the
Property
instance to provide access to theXPath
instance which you can tweak in order to allow you to grab the related data of interest.This enhancement was derived from suggestions from @ramukima.