Lines Matching defs:id
27 * @param string $id The ID to resolve
32 public function resolveId($id, $rev = '', $isDateAt = false)
37 if ($conf['useslash']) $id = str_replace('/', ':', $id);
39 $id = str_replace(';', ':', $id);
41 $id = $this->resolvePrefix($id);
42 return $this->resolveRelatives($id);
48 * @param string $id
51 protected function resolvePrefix($id)
53 if ($id === '') return $id;
56 if ($id[0] === '~') {
57 $id = $this->contextID . ':' . substr($id, 1);
61 if ($id[0] === '.') {
63 $id = preg_replace('/^((\.+:)*)(\.+)(?=[^:\.])/', '\1\3:', $id);
64 $id = $this->contextNS . ':' . $id;
68 if ($this->contextID !== '' && strpos($id, ':') === false) {
69 $id = $this->contextNS . ':' . $id;
72 return $id;
78 * @param string $id
81 protected function resolveRelatives($id)
83 $id = rtrim($id, '.'); // trailing dots are invalid
84 if ($id === '') return '';
85 $trail = ($id[-1] === ':') ? ':' : ''; // keep trailing colon
88 $parts = explode(':', $id);
100 $id = implode(':', $result);
101 $id .= $trail;
103 return $id;