* @throws ItemStateException if an error occurs while reading item
* states.
*/
protected Path getRelativePath(NodeState nodeState, PropertyState propState)
throws RepositoryException, ItemStateException {
HierarchyManager hmgr = getContext().getHierarchyManager();
Path nodePath = hmgr.getPath(nodeState.getId());
Path propPath = hmgr.getPath(propState.getId());
Path p = nodePath.computeRelativePath(propPath);
// make sure it does not contain indexes
boolean clean = true;
Path.Element[] elements = p.getElements();
for (int i = 0; i < elements.length; i++) {