Skip to content

Commit eeb15ef

Browse files
committed
Add a method to ds:Reference to determine if it's an XPointer
Signed-off-by: Jaime Pérez <jaimepc@gmail.com>
1 parent 49ee59c commit eeb15ef

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/XML/ds/Reference.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ private function setURI(?string $URI): void
171171
}
172172

173173

174+
/**
175+
* Determine whether this is an xpointer reference.
176+
*
177+
* @return bool
178+
*/
179+
public function isXPointer(): bool
180+
{
181+
return !empty($this->URI) && preg_match('/^#xpointer\(.+\)$/', $this->URI);
182+
}
183+
184+
174185
/**
175186
* Convert XML into a Reference element
176187
*

0 commit comments

Comments
 (0)